-
Notifications
You must be signed in to change notification settings - Fork 6
feat: rust algod client #179
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
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
8b891fe
wip: utils crate with composer
joe-p 37608d4
wip: working utils py (with some modifications)
joe-p 5552911
wip: working utils ts
joe-p 326ed8e
wip: get uniffi compiling again
joe-p a7f3776
wip: use Mutex for WASM, toString, and transactions getter
joe-p 5f1a167
wip: valueOf and proper toString via JSON.stringify
joe-p bbe4e6e
wip: toJSON
joe-p 84f8e5e
wip: test error
joe-p 4fca1ae
wip: fetch
joe-p ba89749
wip: blocking HTTPClient
joe-p 6b30bc6
async http client
joe-p 726c301
wip: AlgodClient
joe-p 8f261ed
wip: so close
joe-p 2cf84d9
wip: AlgodClient class and async extern, still same error
joe-p 00b784e
wip: working
joe-p 44e9f34
wip: split out wasm mod
joe-p 2f5eb2e
wip: almost working, just need to split out httpclient trait
joe-p 44b9bf4
wip: split out http trait
joe-p 07a666f
wip: working utils py without http test
joe-p 84e2f01
wip: passing pytest w/ http call!
joe-p 249d275
wip: working TS!
joe-p e011f45
wip: unified wasm and uniffi
joe-p 7ffb4a9
wip: split out wasm file
joe-p 874a6b4
wip: move wasm externs into http crate
joe-p b900e3d
wip: split out unified mutex
joe-p bff57fe
wip: rename FfiMutex
joe-p a1c1f53
wip: HTTP -> Http
joe-p b7a6641
wip: add some comments
joe-p 2b2eba2
wip: add default client to http crate
joe-p aaff444
change main to node.cjs
joe-p fc8f7bc
wip: add_payment in rust utils
joe-p cdf4c91
wip: algod_api crate
joe-p 21d516a
wip: proper transactions/params deserialization
joe-p 13a69c7
wip: build() function
joe-p 5bd2a2d
Merge branch 'main' into spike/utils_crate
joe-p d5214d8
wip: assign group
joe-p 4ee2034
wip: return an already build group
joe-p a17eb49
wip: gather signatures
joe-p 0c40e9c
wip: use traits for signer/signer getter
joe-p 10a7aa6
wip: rm utils_ffi
joe-p c97d362
wip: fix __init__.py
joe-p 4e70e67
wip: rm unused variables
joe-p 7e3b7fb
wip: fix http trait wasm feat
joe-p b1da130
wip: rm utils packages
joe-p d4c330a
wip: make signer traits async
joe-p fcfa5b5
chore: fix typo
joe-p c9b26d9
Merge branch 'main' into feat/rust_utils
joe-p 9d4e137
feat(ffi_mutex): set ffi_uniffi as the default trait
joe-p 9db75dd
chore: fmt/clippy
joe-p d8ee065
fix(utils): http client trait with ffi_wasm
joe-p e4b3b2c
chore: fix typo
joe-p cc8526a
chore: rename algokit_http_client crate
joe-p 4324c93
fix(utils): use appropriate error types
joe-p 380e44e
fix(http_client): avoid unwrap
joe-p afb55ca
chore: add docstring
joe-p 6c56a67
feat: custom jinja based rust client generator
aorumbayev 5cfefa9
chore: generate rust client crate
aorumbayev 4832bee
refactor: a file per endpoint
aorumbayev 62fc442
chore: wip
aorumbayev d2f3193
chore: wip
aorumbayev 4ae3411
chore: adding basic tests for raw rust client
aorumbayev 2cc1ab1
chore: refining tests
aorumbayev f7ae886
chore: commenting out cd for old oas based py ts clients; reorganizin…
aorumbayev 6de4f6a
chore: removing native api clients
aorumbayev c693554
chore: refactoring oas generator with ruff and mypy conventions
aorumbayev 5604359
chore: refining generator; basic ci pipeline
aorumbayev 804a4ab
refactor: tag extra fields with explicit x-algokit-bigint
aorumbayev 2987eac
chore: various fmt and clippy fixes
aorumbayev ce6ba39
Merge remote-tracking branch 'origin/main' into feat/rust-client
aorumbayev 9f0b579
chore: clippy warnings
aorumbayev 6beeb5b
Merge branch 'main' into feat/rust-client
PatrickDinh 28b8f79
chore: remove 200Response postfix
PatrickDinh 00aad1e
fix: compile issues
PatrickDinh 5c46d5e
Merge pull request #181 from algorandfoundation/feat/rust-client-pat
PatrickDinh c5a3535
chore: add u64 fields
PatrickDinh 6d45be8
Merge pull request #184 from algorandfoundation/feat/rust-client-pat
PatrickDinh ead4ca1
Merge remote-tracking branch 'origin/main' into feat/rust-client
aorumbayev 57fd2b3
refactor: HTTP client creation
aorumbayev b289f1d
refactor: Enhance API client generation
aorumbayev 876a56b
chore: clarify on algod_client_tests that are to be moved in follow prs
aorumbayev d439bff
refactor: Improve integer type selection
aorumbayev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Algod Client Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "crates/algod_client/**" | ||
- "crates/algod_client_tests/**" | ||
- "crates/algokit_http_client/**" | ||
- "crates/algokit_transact/**" | ||
- ".github/workflows/algod_client_tests.yml" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "crates/algod_client/**" | ||
- "crates/algod_client_tests/**" | ||
- "crates/algokit_http_client/**" | ||
- "crates/algokit_transact/**" | ||
- ".github/workflows/algod_client_tests.yml" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
algod_client_tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: 1.85.0 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Install algokit CLI | ||
run: uv tool install algokit | ||
|
||
- name: Add uv tools to PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Verify algokit installation | ||
run: | | ||
algokit --version | ||
which algokit | ||
|
||
- name: Build algod_client | ||
run: cargo build -p algod_client | ||
|
||
- name: Build algod_client_tests | ||
run: cargo build -p algod_client_tests | ||
|
||
- name: Run algod_client integration tests | ||
run: cargo test -p algod_client_tests --verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: API OAS Generator CI | ||
# This workflow tests the OpenAPI Specification (OAS) generator in the api/ folder. | ||
# It validates the Python-based Jinja2 generator, ensures generated Rust code compiles, | ||
# and checks for output stability. For testing the generated algod_client crate itself, | ||
# see the algod_client_tests.yml workflow. | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "api/**" | ||
- "tools/api_tools/**" | ||
- ".github/workflows/api_ci.yml" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "api/**" | ||
- "tools/api_tools/**" | ||
- ".github/workflows/api_ci.yml" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
API_DIR: api | ||
OUTPUT_DIR: crates/algod_client | ||
|
||
jobs: | ||
oas_generator_check: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: 1.85.0 | ||
components: rustfmt | ||
|
||
- uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Install bun dependencies | ||
working-directory: ${{ env.API_DIR }} | ||
run: bun install | ||
|
||
- name: Install uv dependencies | ||
working-directory: ${{ env.API_DIR }}/oas_generator | ||
run: uv sync --extra dev | ||
|
||
- name: Run OAS generator linting | ||
run: cargo api lint-oas | ||
|
||
- name: Run OAS generator tests | ||
run: cargo api test-oas | ||
|
||
- name: Store original state for stability check | ||
run: | | ||
git diff --name-only HEAD~1..HEAD -- ${{ env.OUTPUT_DIR }} > /tmp/initial_changes.txt || true | ||
git status --porcelain ${{ env.OUTPUT_DIR }} > /tmp/initial_status.txt || true | ||
|
||
- name: Generate algod API client | ||
run: cargo api generate-algod | ||
|
||
- name: Check for output stability | ||
run: | | ||
git status --porcelain ${{ env.OUTPUT_DIR }} > /tmp/post_generation_status.txt | ||
|
||
if [ -s /tmp/post_generation_status.txt ]; then | ||
echo "❌ Output instability detected! The following files were modified or created:" | ||
cat /tmp/post_generation_status.txt | ||
echo "" | ||
echo "🔍 Detailed diff:" | ||
git diff --no-pager ${{ env.OUTPUT_DIR }} | ||
echo "" | ||
echo "💡 This indicates that the generated code is not in sync with the current specification." | ||
echo " Please run 'cargo api generate-algod' and commit the changes." | ||
exit 1 | ||
else | ||
echo "✅ Output stability check passed - no unexpected changes detected" | ||
fi | ||
|
||
- name: Verify generated code compiles | ||
run: | | ||
cargo check --manifest-path Cargo.toml -p algod_client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.