Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Rust libraries for Neutron. The following table shows every published crates maintained in this repository:

| Crate | Description | Crates.io | Docs |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [neutron-std](packages/neutron-std) | Neutron's proto-generated types and helpers for interacting with the appchain. Compatible with CosmWasm contract. | [![neutron-std on crates.io](https://img.shields.io/crates/v/neutron-std.svg)](https://crates.io/crates/neutron-std) | [![Docs](https://docs.rs/neutron-std/badge.svg)](https://docs.rs/neutron-std) |
| [neutron-std-derive](packages/neutron-std-derive) | Procedural macro for augmenting proto-generated types to create better developer ergonomics. Internally used by `neutron-std` | [![neutron-std-derive on crates.io](https://img.shields.io/crates/v/neutron-std-derive.svg)](https://crates.io/crates/neutron-std-derive) | [![Docs](https://docs.rs/neutron-std-derive/badge.svg)](https://docs.rs/neutron-std-derive) |
| Crate | Description | Crates.io | Docs |
|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| [neutron-std](packages/neutron-std) | Neutron's proto-generated types and helpers for interacting with the appchain. Compatible with CosmWasm contract. | [![neutron-std on crates.io](https://img.shields.io/crates/v/neutron-std.svg)](https://crates.io/crates/neutron-std) | [![Docs](https://docs.rs/neutron-std/badge.svg)](https://docs.rs/neutron-std) |
| [neutron-std-derive](packages/neutron-std-derive) | Procedural macro for augmenting proto-generated types to create better developer ergonomics. Internally used by `neutron-std` | [![neutron-std-derive on crates.io](https://img.shields.io/crates/v/neutron-std-derive.svg)](https://crates.io/crates/neutron-std-derive) | [![Docs](https://docs.rs/neutron-std-derive/badge.svg)](https://docs.rs/neutron-std-derive) |

---

Expand Down
2 changes: 1 addition & 1 deletion packages/neutron-std/src/types/NEUTRON_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6.0.0
09082cfc7a07a22218494277d68f30b7dd884a58
1 change: 1 addition & 0 deletions packages/neutron-std/src/types/neutron/crypto/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1beta1;
Original file line number Diff line number Diff line change
@@ -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<u8>,
}
/// 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<u8>,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod ethsecp256k1;
4 changes: 2 additions & 2 deletions packages/neutron-std/src/types/neutron/dex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 2 additions & 0 deletions packages/neutron-std/src/types/neutron/feerefunder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pub struct PacketId {
pub struct Params {
#[prost(message, optional, tag = "1")]
pub min_fee: ::core::option::Option<Fee>,
#[prost(bool, tag = "2")]
pub fee_enabled: bool,
}
/// GenesisState defines the fee module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
3 changes: 2 additions & 1 deletion packages/neutron-std/src/types/neutron/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod contractmanager;
pub mod cron;
pub mod crypto;
pub mod dex;
pub mod dynamicfees;
pub mod feeburner;
Expand All @@ -9,5 +10,5 @@ pub mod ibcratelimit;
pub mod interchainqueries;
pub mod interchaintxs;
pub mod revenue;
pub mod state_verifier;
pub mod transfer;
pub mod util;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1;
161 changes: 161 additions & 0 deletions packages/neutron-std/src/types/neutron/state_verifier/v1.rs
Original file line number Diff line number Diff line change
@@ -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<ConsensusState>,
}
/// 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<super::super::interchainqueries::StorageValue>,
}
/// 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<ConsensusState>,
}
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<super::super::interchainqueries::StorageValue>,
) -> Result<QueryVerifyStateValuesResponse, cosmwasm_std::StdError> {
QueryVerifyStateValuesRequest {
height,
storage_values,
}
.query(self.querier)
}
pub fn query_consensus_state(
&self,
height: u64,
) -> Result<QueryConsensusStateResponse, cosmwasm_std::StdError> {
QueryConsensusStateRequest { height }.query(self.querier)
}
}
84 changes: 0 additions & 84 deletions packages/neutron-std/src/types/neutron/util/forward_ref.rs

This file was deleted.

2 changes: 0 additions & 2 deletions packages/neutron-std/src/types/neutron/util/mod.rs

This file was deleted.

Loading