Skip to content

Commit

Permalink
Add autogenerated algod client (#213)
Browse files Browse the repository at this point in the history
* Add autogenerated algod client

* Fix test.env

* Migrate health_check to new client

* Migrate get_status to new client

* Add error logging

* Remove logging and add a message to the error

* Use u64 for integers in algonaut_algod

* Use byteslices in place of PathBuf

* Integrate algod autogenerated client

* Make it compile

* Make the examples compile

* Fix genesis hash ser-de

* Fix example app_create

* Fix part of the examples

- app_call
- app_clear_state
- app_optin
- app_update

* Fix some examples

* make tests compile

* Remove algod models from algonaut_model

* Fix de-ser-ialization of binary data

* Minor fixes

* Re-export ServiceError in the root of the crate

* Rename ServiceError to Error

* Add Block type alias

* Rename algod_exp to openapi_algod

* Refactor workspace

* Re-export new crates

* Format code

* Clippy

* Fix tests

* Rename Algod methods

* Fix tests
  • Loading branch information
manuelmauro authored Apr 23, 2023
1 parent a428f2a commit c58d109
Show file tree
Hide file tree
Showing 147 changed files with 9,444 additions and 3,523 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Continuous integration

jobs:
check:
name: Check
name: cargo-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions-rs/cargo@v1

wasm-check:
name: Check WASM
name: cargo-check-wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -38,7 +38,7 @@ jobs:
args: --target wasm32-unknown-unknown

tests:
name: Tests
name: cargo-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -50,10 +50,10 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --lib --examples --test test_logic_signature
args: --workspace --lib --examples --tests

fmt:
name: Rustfmt
name: cargo-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -69,7 +69,7 @@ jobs:
args: --all -- --check

clippy:
name: Clippy
name: cargo-clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
27 changes: 17 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,39 @@ version = "0.4.2"

[workspace]
members = [
"algonaut_client",
"algonaut_algod",
"algonaut_model",
"algonaut_core",
"algonaut_crypto",
"algonaut_encoding",
"algonaut_indexer",
"algonaut_kmd",
"algonaut_transaction",
"algonaut_abi",
]

[dependencies]
algonaut_client = { path = "algonaut_client", version = "0.4.2", default-features = false }
algonaut_algod = { path = "algonaut_algod", version = "0.4.2" }
algonaut_model = { path = "algonaut_model", version = "0.4.2" }
algonaut_core = { path = "algonaut_core", version = "0.4.2" }
algonaut_crypto = { path = "algonaut_crypto", version = "0.4.2" }
algonaut_encoding = { path = "algonaut_encoding", version = "0.4.2" }
algonaut_indexer = { path = "algonaut_indexer", version = "0.4.2", default-features = false }
algonaut_kmd = { path = "algonaut_kmd", version = "0.4.2", default-features = false }
algonaut_transaction = { path = "algonaut_transaction", version = "0.4.2" }
algonaut_abi = { path = "algonaut_abi", version = "0.4.2" }
log = "0.4.0"
data-encoding = "2.3.1"
env_logger = "0.10.0"
thiserror = "1.0.23"
rmp-serde = "1.0.0"
num-traits = "0.2.14"
num-bigint = "0.4.3"
futures-timer = "3.0.2"
instant = { version = "0.1", features = ["now"] }
data-encoding = "2.3.1"
log = "0.4.0"
num-bigint = "0.4.3"
num-traits = "0.2.14"
reqwest = "0.11.16"
rmp-serde = "1.0.0"
serde_json = "1.0.0"
sha2 = "0.10.1"
thiserror = "1.0.23"

[target.'cfg(target_arch = "wasm32")'.dependencies]
gloo-timers = { version = "0.2.4", features = ["futures"] }
Expand All @@ -55,10 +61,11 @@ async-trait = "0.1.51"

[features]
default = ["native"]
native = ["algonaut_client/native"]
rustls = ["algonaut_client/rustls"]
native = ["algonaut_indexer/native", "algonaut_kmd/native"]
rustls = ["algonaut_indexer/rustls", "algonaut_indexer/rustls"]

[[test]]
name = "features_runner"
# Allows Cucumber to print output instead of libtest
harness = false
test = false
3 changes: 3 additions & 0 deletions algonaut_algod/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target/
**/*.rs.bk
Cargo.lock
23 changes: 23 additions & 0 deletions algonaut_algod/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
128 changes: 128 additions & 0 deletions algonaut_algod/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.gitignore
.openapi-generator-ignore
.travis.yml
Cargo.toml
README.md
docs/AbortCatchup200Response.md
docs/Account.md
docs/AccountApplicationInformation200Response.md
docs/AccountAssetInformation200Response.md
docs/AccountParticipation.md
docs/AccountStateDelta.md
docs/AddParticipationKey200Response.md
docs/Application.md
docs/ApplicationLocalState.md
docs/ApplicationParams.md
docs/ApplicationStateSchema.md
docs/Asset.md
docs/AssetHolding.md
docs/AssetParams.md
docs/Box.md
docs/BoxDescriptor.md
docs/BuildVersion.md
docs/CommonApi.md
docs/DataApi.md
docs/DryrunRequest.md
docs/DryrunSource.md
docs/DryrunState.md
docs/DryrunTxnResult.md
docs/ErrorResponse.md
docs/EvalDelta.md
docs/EvalDeltaKeyValue.md
docs/ExperimentalApi.md
docs/GetApplicationBoxes200Response.md
docs/GetBlock200Response.md
docs/GetBlockHash200Response.md
docs/GetPendingTransactionsByAddress200Response.md
docs/GetStatus200Response.md
docs/GetSupply200Response.md
docs/GetSyncRound200Response.md
docs/GetTransactionProof200Response.md
docs/KvDelta.md
docs/LightBlockHeaderProof.md
docs/NonparticipatingApi.md
docs/ParticipatingApi.md
docs/ParticipationKey.md
docs/PendingTransactionResponse.md
docs/PrivateApi.md
docs/PublicApi.md
docs/RawTransaction200Response.md
docs/SimulateRequest.md
docs/SimulateRequestTransactionGroup.md
docs/SimulateTransaction200Response.md
docs/SimulateTransactionGroupResult.md
docs/SimulateTransactionResult.md
docs/StartCatchup200Response.md
docs/StateProof.md
docs/StateProofMessage.md
docs/TealCompile200Response.md
docs/TealDisassemble200Response.md
docs/TealDryrun200Response.md
docs/TealKeyValue.md
docs/TealValue.md
docs/TransactionParams200Response.md
docs/Version.md
git_push.sh
src/apis/common_api.rs
src/apis/configuration.rs
src/apis/data_api.rs
src/apis/experimental_api.rs
src/apis/mod.rs
src/apis/nonparticipating_api.rs
src/apis/participating_api.rs
src/apis/private_api.rs
src/apis/public_api.rs
src/lib.rs
src/models/abort_catchup_200_response.rs
src/models/account.rs
src/models/account_application_information_200_response.rs
src/models/account_asset_information_200_response.rs
src/models/account_participation.rs
src/models/account_state_delta.rs
src/models/add_participation_key_200_response.rs
src/models/application.rs
src/models/application_local_state.rs
src/models/application_params.rs
src/models/application_state_schema.rs
src/models/asset.rs
src/models/asset_holding.rs
src/models/asset_params.rs
src/models/box_descriptor.rs
src/models/build_version.rs
src/models/dryrun_request.rs
src/models/dryrun_source.rs
src/models/dryrun_state.rs
src/models/dryrun_txn_result.rs
src/models/error_response.rs
src/models/eval_delta.rs
src/models/eval_delta_key_value.rs
src/models/get_application_boxes_200_response.rs
src/models/get_block_200_response.rs
src/models/get_block_hash_200_response.rs
src/models/get_pending_transactions_by_address_200_response.rs
src/models/get_status_200_response.rs
src/models/get_supply_200_response.rs
src/models/get_sync_round_200_response.rs
src/models/get_transaction_proof_200_response.rs
src/models/kv_delta.rs
src/models/light_block_header_proof.rs
src/models/mod.rs
src/models/model_box.rs
src/models/participation_key.rs
src/models/pending_transaction_response.rs
src/models/raw_transaction_200_response.rs
src/models/simulate_request.rs
src/models/simulate_request_transaction_group.rs
src/models/simulate_transaction_200_response.rs
src/models/simulate_transaction_group_result.rs
src/models/simulate_transaction_result.rs
src/models/start_catchup_200_response.rs
src/models/state_proof.rs
src/models/state_proof_message.rs
src/models/teal_compile_200_response.rs
src/models/teal_disassemble_200_response.rs
src/models/teal_dryrun_200_response.rs
src/models/teal_key_value.rs
src/models/teal_value.rs
src/models/transaction_params_200_response.rs
src/models/version.rs
1 change: 1 addition & 0 deletions algonaut_algod/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.6.0-SNAPSHOT
1 change: 1 addition & 0 deletions algonaut_algod/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: rust
21 changes: 21 additions & 0 deletions algonaut_algod/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "algonaut_algod"
version = "0.4.2"
authors = ["[email protected]"]
description = "API endpoint for algod operations."
# Override this license by providing a License Object in the OpenAPI.
license = "MIT"
edition = "2018"

[dependencies]
algonaut_crypto = { path = "../algonaut_crypto", version = "0.4.2" }
algonaut_encoding = { path = "../algonaut_encoding", version = "0.4.2" }
algonaut_model = { path = "../algonaut_model", version = "0.4.2" }
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0"
url = "^2.2"
uuid = { version = "^1.0", features = ["serde"] }
[dependencies.reqwest]
version = "^0.11"
features = ["json", "multipart"]
Loading

0 comments on commit c58d109

Please sign in to comment.