Skip to content

Commit

Permalink
updated cosmrs and tendermint-rpc to their most recent versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuczyn committed Jan 13, 2025
1 parent 102cd10 commit 65f3ffd
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 142 deletions.
96 changes: 59 additions & 37 deletions Cargo.lock

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

12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,11 @@ cw-controllers = { version = "=1.1.0" }
# cosmrs-related
bip32 = { version = "0.5.2", default-features = false }

# temporarily using a fork again (yay.) because we need staking and slashing support (which are already on main but not released)
# plus response message parsing (which is, as of the time of writing this message, waiting to get merged)
#cosmrs = { path = "../cosmos-rust-fork/cosmos-rust/cosmrs" }
cosmrs = { git = "https://github.com/cosmos/cosmos-rust", rev = "4b1332e6d8258ac845cef71589c8d362a669675a" } # unfortuntely we need a fork by yours truly to get the staking support
tendermint = "0.37.0" # same version as used by cosmrs
tendermint-rpc = "0.37.0" # same version as used by cosmrs
prost = { version = "0.12", default-features = false }

cosmrs = { version = "0.21.0" }
tendermint = "0.40.0"
tendermint-rpc = "0.40.0"
prost = { version = "0.13", default-features = false }

# wasm-related dependencies
gloo-utils = "0.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,20 @@ pub trait CosmWasmClient: TendermintRpcClient {
let req = QueryAllBalancesRequest {
address: address.to_string(),
pagination,
resolve_denom: false,
};

let mut res = self
.make_abci_query::<_, QueryAllBalancesResponse>(path.clone(), req)
.await?;

let early_break = res.balances.is_empty();
raw_balances.append(&mut res.balances);

if early_break {
break;
}

if let Some(next_key) = next_page_key(res.pagination) {
pagination = Some(create_pagination(next_key))
} else {
Expand Down Expand Up @@ -187,7 +194,13 @@ pub trait CosmWasmClient: TendermintRpcClient {
.make_abci_query::<_, QueryTotalSupplyResponse>(path.clone(), req)
.await?;

let early_break = res.supply.is_empty();
supply.append(&mut res.supply);

if early_break {
break;
}

if let Some(next_key) = next_page_key(res.pagination) {
pagination = Some(create_pagination(next_key))
} else {
Expand Down Expand Up @@ -328,7 +341,13 @@ pub trait CosmWasmClient: TendermintRpcClient {
.make_abci_query::<_, QueryCodesResponse>(path.clone(), req)
.await?;

let early_break = res.code_infos.is_empty();
raw_codes.append(&mut res.code_infos);

if early_break {
break;
}

if let Some(next_key) = next_page_key(res.pagination) {
pagination = Some(create_pagination(next_key))
} else {
Expand Down Expand Up @@ -373,7 +392,13 @@ pub trait CosmWasmClient: TendermintRpcClient {
.make_abci_query::<_, QueryContractsByCodeResponse>(path.clone(), req)
.await?;

let early_break = res.contracts.is_empty();
raw_contracts.append(&mut res.contracts);

if early_break {
break;
}

if let Some(next_key) = next_page_key(res.pagination) {
pagination = Some(create_pagination(next_key))
} else {
Expand Down Expand Up @@ -429,7 +454,13 @@ pub trait CosmWasmClient: TendermintRpcClient {
.make_abci_query::<_, QueryContractHistoryResponse>(path.clone(), req)
.await?;

let early_break = res.entries.is_empty();
raw_entries.append(&mut res.entries);

if early_break {
break;
}

if let Some(next_key) = next_page_key(res.pagination) {
pagination = Some(create_pagination(next_key))
} else {
Expand Down
Loading

0 comments on commit 65f3ffd

Please sign in to comment.