diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index 9f925ba..92bf166 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -v6.0.0 \ No newline at end of file +828f75e2de165b4ff7d786abf6405c784194e9f6 diff --git a/packages/neutron-std/src/types/neutron/crypto/mod.rs b/packages/neutron-std/src/types/neutron/crypto/mod.rs new file mode 100644 index 0000000..9f64fc8 --- /dev/null +++ b/packages/neutron-std/src/types/neutron/crypto/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/neutron-std/src/types/neutron/crypto/v1beta1/ethsecp256k1.rs b/packages/neutron-std/src/types/neutron/crypto/v1beta1/ethsecp256k1.rs new file mode 100644 index 0000000..eed362f --- /dev/null +++ b/packages/neutron-std/src/types/neutron/crypto/v1beta1/ethsecp256k1.rs @@ -0,0 +1,46 @@ +use neutron_std_derive::CosmwasmExt; +/// PubKey defines a type alias for an ecdsa.PublicKey that implements +/// Tendermint's PubKey interface. It represents the 33-byte compressed public +/// key format. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.crypto.v1beta1.ethsecp256k1.PubKey")] +pub struct PubKey { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, +} +/// PrivKey defines a type alias for an ecdsa.PrivateKey that implements +/// Tendermint's PrivateKey interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.crypto.v1beta1.ethsecp256k1.PrivKey")] +pub struct PrivKey { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, +} diff --git a/packages/neutron-std/src/types/neutron/crypto/v1beta1/mod.rs b/packages/neutron-std/src/types/neutron/crypto/v1beta1/mod.rs new file mode 100644 index 0000000..27e1814 --- /dev/null +++ b/packages/neutron-std/src/types/neutron/crypto/v1beta1/mod.rs @@ -0,0 +1 @@ +pub mod ethsecp256k1; diff --git a/packages/neutron-std/src/types/neutron/dex/mod.rs b/packages/neutron-std/src/types/neutron/dex/mod.rs index f303fdb..c093e46 100644 --- a/packages/neutron-std/src/types/neutron/dex/mod.rs +++ b/packages/neutron-std/src/types/neutron/dex/mod.rs @@ -633,7 +633,7 @@ pub struct MsgMultiHopSwap { #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, /// If pickBestRoute == true then all routes are run and the route with the - /// best price is chosen otherwise, the first succesful route is used. + /// best price is chosen otherwise, the first successful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } @@ -1440,7 +1440,7 @@ pub struct QueryEstimateMultiHopSwapRequest { #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, /// If pickBestRoute == true then all routes are run and the route with the - /// best price is chosen otherwise, the first succesful route is used. + /// best price is chosen otherwise, the first successful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } diff --git a/packages/neutron-std/src/types/neutron/mod.rs b/packages/neutron-std/src/types/neutron/mod.rs index e174fe2..90a6f00 100644 --- a/packages/neutron-std/src/types/neutron/mod.rs +++ b/packages/neutron-std/src/types/neutron/mod.rs @@ -1,5 +1,6 @@ pub mod contractmanager; pub mod cron; +pub mod crypto; pub mod dex; pub mod dynamicfees; pub mod feeburner; @@ -9,4 +10,5 @@ pub mod ibcratelimit; pub mod interchainqueries; pub mod interchaintxs; pub mod revenue; +pub mod state_verifier; pub mod transfer; diff --git a/packages/neutron-std/src/types/neutron/state_verifier/mod.rs b/packages/neutron-std/src/types/neutron/state_verifier/mod.rs new file mode 100644 index 0000000..a3a6d96 --- /dev/null +++ b/packages/neutron-std/src/types/neutron/state_verifier/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/neutron-std/src/types/neutron/state_verifier/v1.rs b/packages/neutron-std/src/types/neutron/state_verifier/v1.rs new file mode 100644 index 0000000..84f73d0 --- /dev/null +++ b/packages/neutron-std/src/types/neutron/state_verifier/v1.rs @@ -0,0 +1,161 @@ +use neutron_std_derive::CosmwasmExt; +/// Describes a "light" consensus state of the chain at a particular height +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.ConsensusState")] +pub struct ConsensusState { + /// Describes a block height for which the consensus height is saved + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// ConsensusState defines the consensus state from Tendermint + #[prost(message, optional, tag = "2")] + pub cs: ::core::option::Option< + super::super::super::ibc::lightclients::tendermint::v1::ConsensusState, + >, +} +/// Defines the state verifier module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub states: ::prost::alloc::vec::Vec, +} +/// Describes a structure to verify storage values from the chain state from a particular height in the past +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.QueryVerifyStateValuesRequest")] +#[proto_query( + path = "/neutron.state_verifier.v1.Query/VerifyStateValues", + response_type = QueryVerifyStateValuesResponse +)] +pub struct QueryVerifyStateValuesRequest { + /// Refers to the block height to which the storage values belong. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + /// A slice of neutron.interchainqueries.StorageValue which relate to the specified height and must be verified against + #[prost(message, repeated, tag = "2")] + pub storage_values: ::prost::alloc::vec::Vec, +} +/// Describes a response structure for `VerifyStateValues` query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.QueryVerifyStateValuesResponse")] +pub struct QueryVerifyStateValuesResponse { + /// The field describes a validity of all the storage values passed to the request at a specific height + #[prost(bool, tag = "1")] + pub valid: bool, +} +/// Describes a structure to query ConsensusState by the specified height +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.QueryConsensusStateRequest")] +#[proto_query( + path = "/neutron.state_verifier.v1.Query/QueryConsensusState", + response_type = QueryConsensusStateResponse +)] +pub struct QueryConsensusStateRequest { + /// Refers to the block height for which you want to query ConsensusState + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, +} +/// Describes a response structure for `QueryConsensusStateRequest` query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.state_verifier.v1.QueryConsensusStateResponse")] +pub struct QueryConsensusStateResponse { + /// ConsensusState defines the consensus state from the state-verifier module + #[prost(message, optional, tag = "2")] + pub cs: ::core::option::Option, +} +pub struct StateVerifierQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> StateVerifierQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn verify_state_values( + &self, + height: u64, + storage_values: ::prost::alloc::vec::Vec, + ) -> Result { + QueryVerifyStateValuesRequest { + height, + storage_values, + } + .query(self.querier) + } + pub fn query_consensus_state( + &self, + height: u64, + ) -> Result { + QueryConsensusStateRequest { height }.query(self.querier) + } +} diff --git a/packages/neutron-std/src/types/osmosis/tokenfactory/mod.rs b/packages/neutron-std/src/types/osmosis/tokenfactory/mod.rs index 215b75d..864b7c4 100644 --- a/packages/neutron-std/src/types/osmosis/tokenfactory/mod.rs +++ b/packages/neutron-std/src/types/osmosis/tokenfactory/mod.rs @@ -63,4 +63,11 @@ pub struct Params { /// whitelisted_hooks is the list of hooks which are allowed to be added and executed #[prost(message, repeated, tag = "4")] pub whitelisted_hooks: ::prost::alloc::vec::Vec, + /// Sets a limit on the gas that can be consumed by the before_send hook. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub track_before_send_gas_limit: u64, } diff --git a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs index 3aa13e0..01645e4 100644 --- a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs +++ b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs @@ -199,7 +199,7 @@ pub struct QueryDenomsFromCreatorRequest { #[prost(string, tag = "1")] pub creator: ::prost::alloc::string::String, } -/// QueryDenomsFromCreatorRequest defines the response structure for the +/// QueryDenomsFromCreatorResponse defines the response structure for the /// DenomsFromCreator gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index ed7dbea..2200868 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -25,7 +25,8 @@ const ADMIN_MODULE_REPO: &str = "https://github.com/neutron-org/admin-module.git const COSMOS_SDK_REV: &str = "v0.50.13-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "v6.0.0"; +const NEUTRON_REV: &str = "828f75e2de165b4ff7d786abf6405c784194e9f6"; + /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "8ab684b5eff649e2e335a6e1b439ae8b72afd392";