Skip to content

Commit 5c18663

Browse files
committed
updated neutron files. added crypto and state_verifier files
1 parent e034bc4 commit 5c18663

File tree

10 files changed

+218
-13
lines changed

10 files changed

+218
-13
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
95ff2706ab42221f1098a054a792c153c49f4798
3-
=======
4-
v6.0.0
5-
>>>>>>> main
1+
828f75e2de165b4ff7d786abf6405c784194e9f6
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod v1beta1;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
use neutron_std_derive::CosmwasmExt;
2+
/// PubKey defines a type alias for an ecdsa.PublicKey that implements
3+
/// Tendermint's PubKey interface. It represents the 33-byte compressed public
4+
/// key format.
5+
#[allow(clippy::derive_partial_eq_without_eq)]
6+
#[derive(
7+
Clone,
8+
PartialEq,
9+
Eq,
10+
::prost::Message,
11+
::serde::Serialize,
12+
::serde::Deserialize,
13+
::schemars::JsonSchema,
14+
CosmwasmExt,
15+
)]
16+
#[proto_message(type_url = "/neutron.crypto.v1beta1.ethsecp256k1.PubKey")]
17+
pub struct PubKey {
18+
#[prost(bytes = "vec", tag = "1")]
19+
#[serde(
20+
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
21+
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
22+
)]
23+
pub key: ::prost::alloc::vec::Vec<u8>,
24+
}
25+
/// PrivKey defines a type alias for an ecdsa.PrivateKey that implements
26+
/// Tendermint's PrivateKey interface.
27+
#[allow(clippy::derive_partial_eq_without_eq)]
28+
#[derive(
29+
Clone,
30+
PartialEq,
31+
Eq,
32+
::prost::Message,
33+
::serde::Serialize,
34+
::serde::Deserialize,
35+
::schemars::JsonSchema,
36+
CosmwasmExt,
37+
)]
38+
#[proto_message(type_url = "/neutron.crypto.v1beta1.ethsecp256k1.PrivKey")]
39+
pub struct PrivKey {
40+
#[prost(bytes = "vec", tag = "1")]
41+
#[serde(
42+
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
43+
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
44+
)]
45+
pub key: ::prost::alloc::vec::Vec<u8>,
46+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod ethsecp256k1;

packages/neutron-std/src/types/neutron/dex/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ pub struct MsgMultiHopSwap {
633633
#[prost(string, tag = "5")]
634634
pub exit_limit_price: ::prost::alloc::string::String,
635635
/// If pickBestRoute == true then all routes are run and the route with the
636-
/// best price is chosen otherwise, the first succesful route is used.
636+
/// best price is chosen otherwise, the first successful route is used.
637637
#[prost(bool, tag = "6")]
638638
pub pick_best_route: bool,
639639
}
@@ -1440,7 +1440,7 @@ pub struct QueryEstimateMultiHopSwapRequest {
14401440
#[prost(string, tag = "5")]
14411441
pub exit_limit_price: ::prost::alloc::string::String,
14421442
/// If pickBestRoute == true then all routes are run and the route with the
1443-
/// best price is chosen otherwise, the first succesful route is used.
1443+
/// best price is chosen otherwise, the first successful route is used.
14441444
#[prost(bool, tag = "6")]
14451445
pub pick_best_route: bool,
14461446
}

packages/neutron-std/src/types/neutron/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod contractmanager;
22
pub mod cron;
3+
pub mod crypto;
34
pub mod dex;
45
pub mod dynamicfees;
56
pub mod feeburner;
@@ -9,4 +10,5 @@ pub mod ibcratelimit;
910
pub mod interchainqueries;
1011
pub mod interchaintxs;
1112
pub mod revenue;
13+
pub mod state_verifier;
1214
pub mod transfer;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod v1;
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
use neutron_std_derive::CosmwasmExt;
2+
/// Describes a "light" consensus state of the chain at a particular height
3+
#[allow(clippy::derive_partial_eq_without_eq)]
4+
#[derive(
5+
Clone,
6+
PartialEq,
7+
Eq,
8+
::prost::Message,
9+
::serde::Serialize,
10+
::serde::Deserialize,
11+
::schemars::JsonSchema,
12+
CosmwasmExt,
13+
)]
14+
#[proto_message(type_url = "/neutron.state_verifier.v1.ConsensusState")]
15+
pub struct ConsensusState {
16+
/// Describes a block height for which the consensus height is saved
17+
#[prost(int64, tag = "1")]
18+
#[serde(
19+
serialize_with = "crate::serde::as_str::serialize",
20+
deserialize_with = "crate::serde::as_str::deserialize"
21+
)]
22+
pub height: i64,
23+
/// ConsensusState defines the consensus state from Tendermint
24+
#[prost(message, optional, tag = "2")]
25+
pub cs: ::core::option::Option<
26+
super::super::super::ibc::lightclients::tendermint::v1::ConsensusState,
27+
>,
28+
}
29+
/// Defines the state verifier module's genesis state.
30+
#[allow(clippy::derive_partial_eq_without_eq)]
31+
#[derive(
32+
Clone,
33+
PartialEq,
34+
Eq,
35+
::prost::Message,
36+
::serde::Serialize,
37+
::serde::Deserialize,
38+
::schemars::JsonSchema,
39+
CosmwasmExt,
40+
)]
41+
#[proto_message(type_url = "/neutron.state_verifier.v1.GenesisState")]
42+
pub struct GenesisState {
43+
#[prost(message, repeated, tag = "1")]
44+
pub states: ::prost::alloc::vec::Vec<ConsensusState>,
45+
}
46+
/// Describes a structure to verify storage values from the chain state from a particular height in the past
47+
#[allow(clippy::derive_partial_eq_without_eq)]
48+
#[derive(
49+
Clone,
50+
PartialEq,
51+
Eq,
52+
::prost::Message,
53+
::serde::Serialize,
54+
::serde::Deserialize,
55+
::schemars::JsonSchema,
56+
CosmwasmExt,
57+
)]
58+
#[proto_message(type_url = "/neutron.state_verifier.v1.QueryVerifyStateValuesRequest")]
59+
#[proto_query(
60+
path = "/neutron.state_verifier.v1.Query/VerifyStateValues",
61+
response_type = QueryVerifyStateValuesResponse
62+
)]
63+
pub struct QueryVerifyStateValuesRequest {
64+
/// Refers to the block height to which the storage values belong.
65+
#[prost(uint64, tag = "1")]
66+
#[serde(
67+
serialize_with = "crate::serde::as_str::serialize",
68+
deserialize_with = "crate::serde::as_str::deserialize"
69+
)]
70+
pub height: u64,
71+
/// A slice of neutron.interchainqueries.StorageValue which relate to the specified height and must be verified against
72+
#[prost(message, repeated, tag = "2")]
73+
pub storage_values: ::prost::alloc::vec::Vec<super::super::interchainqueries::StorageValue>,
74+
}
75+
/// Describes a response structure for `VerifyStateValues` query
76+
#[allow(clippy::derive_partial_eq_without_eq)]
77+
#[derive(
78+
Clone,
79+
PartialEq,
80+
Eq,
81+
::prost::Message,
82+
::serde::Serialize,
83+
::serde::Deserialize,
84+
::schemars::JsonSchema,
85+
CosmwasmExt,
86+
)]
87+
#[proto_message(type_url = "/neutron.state_verifier.v1.QueryVerifyStateValuesResponse")]
88+
pub struct QueryVerifyStateValuesResponse {
89+
/// The field describes a validity of all the storage values passed to the request at a specific height
90+
#[prost(bool, tag = "1")]
91+
pub valid: bool,
92+
}
93+
/// Describes a structure to query ConsensusState by the specified height
94+
#[allow(clippy::derive_partial_eq_without_eq)]
95+
#[derive(
96+
Clone,
97+
PartialEq,
98+
Eq,
99+
::prost::Message,
100+
::serde::Serialize,
101+
::serde::Deserialize,
102+
::schemars::JsonSchema,
103+
CosmwasmExt,
104+
)]
105+
#[proto_message(type_url = "/neutron.state_verifier.v1.QueryConsensusStateRequest")]
106+
#[proto_query(
107+
path = "/neutron.state_verifier.v1.Query/QueryConsensusState",
108+
response_type = QueryConsensusStateResponse
109+
)]
110+
pub struct QueryConsensusStateRequest {
111+
/// Refers to the block height for which you want to query ConsensusState
112+
#[prost(uint64, tag = "1")]
113+
#[serde(
114+
serialize_with = "crate::serde::as_str::serialize",
115+
deserialize_with = "crate::serde::as_str::deserialize"
116+
)]
117+
pub height: u64,
118+
}
119+
/// Describes a response structure for `QueryConsensusStateRequest` query
120+
#[allow(clippy::derive_partial_eq_without_eq)]
121+
#[derive(
122+
Clone,
123+
PartialEq,
124+
Eq,
125+
::prost::Message,
126+
::serde::Serialize,
127+
::serde::Deserialize,
128+
::schemars::JsonSchema,
129+
CosmwasmExt,
130+
)]
131+
#[proto_message(type_url = "/neutron.state_verifier.v1.QueryConsensusStateResponse")]
132+
pub struct QueryConsensusStateResponse {
133+
/// ConsensusState defines the consensus state from the state-verifier module
134+
#[prost(message, optional, tag = "2")]
135+
pub cs: ::core::option::Option<ConsensusState>,
136+
}
137+
pub struct StateVerifierQuerier<'a, Q: cosmwasm_std::CustomQuery> {
138+
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
139+
}
140+
impl<'a, Q: cosmwasm_std::CustomQuery> StateVerifierQuerier<'a, Q> {
141+
pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
142+
Self { querier }
143+
}
144+
pub fn verify_state_values(
145+
&self,
146+
height: u64,
147+
storage_values: ::prost::alloc::vec::Vec<super::super::interchainqueries::StorageValue>,
148+
) -> Result<QueryVerifyStateValuesResponse, cosmwasm_std::StdError> {
149+
QueryVerifyStateValuesRequest {
150+
height,
151+
storage_values,
152+
}
153+
.query(self.querier)
154+
}
155+
pub fn query_consensus_state(
156+
&self,
157+
height: u64,
158+
) -> Result<QueryConsensusStateResponse, cosmwasm_std::StdError> {
159+
QueryConsensusStateRequest { height }.query(self.querier)
160+
}
161+
}

packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub struct QueryDenomsFromCreatorRequest {
199199
#[prost(string, tag = "1")]
200200
pub creator: ::prost::alloc::string::String,
201201
}
202-
/// QueryDenomsFromCreatorRequest defines the response structure for the
202+
/// QueryDenomsFromCreatorResponse defines the response structure for the
203203
/// DenomsFromCreator gRPC query.
204204
#[allow(clippy::derive_partial_eq_without_eq)]
205205
#[derive(

proto-build/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ const ADMIN_MODULE_REPO: &str = "https://github.com/neutron-org/admin-module.git
2525
const COSMOS_SDK_REV: &str = "v0.50.13-neutron";
2626

2727
/// The Neutron commit or tag to be cloned and used to build the proto files
28-
<<<<<<< HEAD
29-
const NEUTRON_REV: &str = "95ff2706ab42221f1098a054a792c153c49f4798";
30-
=======
31-
const NEUTRON_REV: &str = "v6.0.0";
32-
>>>>>>> main
28+
const NEUTRON_REV: &str = "828f75e2de165b4ff7d786abf6405c784194e9f6";
29+
3330

3431
/// The wasmd commit or tag to be cloned and used to build the proto files
3532
const WASMD_REV: &str = "8ab684b5eff649e2e335a6e1b439ae8b72afd392";

0 commit comments

Comments
 (0)