Skip to content

feat: Add transaction builders and test object mother abstractions #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/python_uniffi_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
get_version:
runs-on: ubuntu-latest
outputs:
outputs:
tag: ${{ steps.semantic_release.outputs.tag }}
version: ${{ steps.semantic_release.outputs.version }}
version_commit_sha: ${{ steps.set_version_commit_sha.outputs.version_commit_sha }}
Expand Down Expand Up @@ -110,11 +110,11 @@ jobs:
with:
toolchain: 1.85.0
targets: ${{ matrix.target.name }}

- name: Install Poetry
run: |
pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down Expand Up @@ -244,15 +244,14 @@ jobs:
cd /workspace/packages/python/${{ inputs.crate }}
poetry run pytest
run: docker exec build-container bash -c "$RUN"

- name: Upload build artifacts
if: inputs.release
uses: actions/upload-artifact@v4
with:
name: ${{ env.TARGET }}-wheel
path: target/wheels


release:
if: inputs.release && needs.get_version.outputs.version != ''
needs:
Expand Down Expand Up @@ -292,7 +291,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
run: "bun semantic-release"

cleanup:
if: inputs.release && (failure() || cancelled())
runs-on: ubuntu-latest
Expand All @@ -310,8 +309,8 @@ jobs:
- name: Reset branch
if: needs.get_version.outputs.version_commit_sha != ''
env:
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git revert --no-commit ${{ needs.get_version.outputs.version_commit_sha }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules/
.build
.bin/
.vscode/
.DS_Store
166 changes: 153 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion crates/algokit_transact/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]

[features]
test_utils = ["dep:base64", "dep:ed25519-dalek", "dep:convert_case"]

[dependencies]
base32 = "0.5.1"
base64 = { version = "0.22.1", optional = true }
convert_case = { version = "0.8.0", optional = true }
derive_builder = { version = "0.20.2" }
ed25519-dalek = { version = "2.1.1", optional = true }
rmp-serde = "1.3.0"
rmpv = { version = "1.3.0", features = ["with-serde"] }
serde = { version = "1.0.216", features = ["derive"] }
Expand All @@ -18,4 +25,4 @@ thiserror = { workspace = true }

[dev-dependencies]
pretty_assertions = "1.4.1"
base64 = "0.22.1"
algokit_transact = { path = '.', features = ["test_utils"] }
8 changes: 6 additions & 2 deletions crates/algokit_transact/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ pub use constants::{
pub use error::AlgoKitTransactError;
pub use traits::{AlgorandMsgpack, TransactionId};
pub use transactions::{
AssetTransferTransactionFields, PayTransactionFields, SignedTransaction, Transaction,
TransactionHeader, TransactionType,
AssetTransferTransactionBuilder, AssetTransferTransactionFields, PaymentTransactionBuilder,
PaymentTransactionFields, SignedTransaction, Transaction, TransactionHeader,
TransactionHeaderBuilder, TransactionType,
};

#[cfg(test)]
mod tests;

#[cfg(feature = "test_utils")]
pub mod test_utils;
Loading