Skip to content

Commit

Permalink
Update prost to v0.12 and tonic to v0.10 (#150)
Browse files Browse the repository at this point in the history
* Update `prost` to v0.12 and `tonic` to v0.10

* Re-generate protos

* Add changelog entry

* Add temporary crates.io patch for `tendermint-proto` and `ics23`

* Patch malformed doc comment in generated Rust code

* Update tendermint-proto to latest released version (0.34.0)

* Update to `ics23` v0.10.3

* Update `ics23` to v0.11.0
  • Loading branch information
romac authored Oct 4, 2023
1 parent 9be0ca5 commit f74e9d1
Show file tree
Hide file tree
Showing 28 changed files with 402 additions and 229 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/145-prost-0.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update `prost` to v0.12 and `tonic` to v0.10
([\#145](https://github.com/cosmos/ibc-proto-rs/issues/145))
15 changes: 7 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,26 @@ doctest = false
all-features = true

[dependencies]
prost = { version = "0.11", default-features = false }
prost = { version = "0.12", default-features = false, features = ["prost-derive"] }
bytes = { version = "1.2", default-features = false }
tonic = { version = "0.9", default-features = false, optional = true }
tonic = { version = "0.10", default-features = false, optional = true }
serde = { version = "1.0", default-features = false }
schemars = { version = "0.8", optional = true }
subtle-encoding = { version = "0.5", default-features = false }
base64 = { version = "0.21", default-features = false, features = ["alloc"] }
flex-error = { version = "0.4", default-features = false }
ics23 = { version = "0.11.0" , default-features = false }

## for codec encode or decode
## Optional: enabled by the `parity-scale-codec` feature
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
scale-info = { version = "2.1.2", default-features = false, features = ["derive"], optional = true }

## for borsh encode or decode
## need tracking anchor-lang and near-sdk-rs borsh version
## Optional: enabled by the `borsh` feature
## For borsh encode or decode, needs to track `anchor-lang` and `near-sdk-rs` borsh version
borsh = { version = "0.10", default-features = false, optional = true }

ics23 = { version = "0.10.2" , default-features = false }

[dependencies.tendermint-proto]
version = "0.33"
version = "0.34"
default-features = false

[features]
Expand Down
28 changes: 17 additions & 11 deletions src/prost/cosmos.auth.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ pub mod msg_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).update_params(request).await
<T as Msg>::update_params(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1165,7 +1165,9 @@ pub mod query_server {
request: tonic::Request<super::QueryAccountsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).accounts(request).await };
let fut = async move {
<T as Query>::accounts(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -1209,7 +1211,9 @@ pub mod query_server {
request: tonic::Request<super::QueryAccountRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).account(request).await };
let fut = async move {
<T as Query>::account(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -1256,7 +1260,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).account_address_by_id(request).await
<T as Query>::account_address_by_id(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1299,7 +1303,9 @@ pub mod query_server {
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).params(request).await };
let fut = async move {
<T as Query>::params(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -1344,7 +1350,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).module_accounts(request).await
<T as Query>::module_accounts(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1392,7 +1398,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).module_account_by_name(request).await
<T as Query>::module_account_by_name(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1438,7 +1444,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).bech32_prefix(request).await
<T as Query>::bech32_prefix(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1484,7 +1490,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).address_bytes_to_string(request).await
<T as Query>::address_bytes_to_string(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1530,7 +1536,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).address_string_to_bytes(request).await
<T as Query>::address_string_to_bytes(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1576,7 +1582,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).account_info(request).await
<T as Query>::account_info(&inner, request).await
};
Box::pin(fut)
}
Expand Down
41 changes: 26 additions & 15 deletions src/prost/cosmos.bank.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,9 @@ pub mod msg_server {
request: tonic::Request<super::MsgSend>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).send(request).await };
let fut = async move {
<T as Msg>::send(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -588,7 +590,9 @@ pub mod msg_server {
request: tonic::Request<super::MsgMultiSend>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).multi_send(request).await };
let fut = async move {
<T as Msg>::multi_send(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -631,7 +635,7 @@ pub mod msg_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).update_params(request).await
<T as Msg>::update_params(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -675,7 +679,7 @@ pub mod msg_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).set_send_enabled(request).await
<T as Msg>::set_send_enabled(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1686,7 +1690,9 @@ pub mod query_server {
request: tonic::Request<super::QueryBalanceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).balance(request).await };
let fut = async move {
<T as Query>::balance(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -1731,7 +1737,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).all_balances(request).await
<T as Query>::all_balances(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1777,7 +1783,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).spendable_balances(request).await
<T as Query>::spendable_balances(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1826,7 +1832,8 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).spendable_balance_by_denom(request).await
<T as Query>::spendable_balance_by_denom(&inner, request)
.await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1872,7 +1879,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).total_supply(request).await
<T as Query>::total_supply(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -1917,7 +1924,9 @@ pub mod query_server {
request: tonic::Request<super::QuerySupplyOfRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).supply_of(request).await };
let fut = async move {
<T as Query>::supply_of(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -1959,7 +1968,9 @@ pub mod query_server {
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).params(request).await };
let fut = async move {
<T as Query>::params(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down Expand Up @@ -2004,7 +2015,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).denom_metadata(request).await
<T as Query>::denom_metadata(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -2050,7 +2061,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).denoms_metadata(request).await
<T as Query>::denoms_metadata(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -2096,7 +2107,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).denom_owners(request).await
<T as Query>::denom_owners(&inner, request).await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -2142,7 +2153,7 @@ pub mod query_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).send_enabled(request).await
<T as Query>::send_enabled(&inner, request).await
};
Box::pin(fut)
}
Expand Down
4 changes: 3 additions & 1 deletion src/prost/cosmos.base.node.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ pub mod service_server {
request: tonic::Request<super::ConfigRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).config(request).await };
let fut = async move {
<T as Service>::config(&inner, request).await
};
Box::pin(fut)
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/prost/cosmos.base.reflection.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ pub mod reflection_service_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).list_all_interfaces(request).await
<T as ReflectionService>::list_all_interfaces(
&inner,
request,
)
.await
};
Box::pin(fut)
}
Expand Down Expand Up @@ -353,7 +357,11 @@ pub mod reflection_service_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).list_implementations(request).await
<T as ReflectionService>::list_implementations(
&inner,
request,
)
.await
};
Box::pin(fut)
}
Expand Down
Loading

0 comments on commit f74e9d1

Please sign in to comment.