Skip to content
Draft
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
654 changes: 459 additions & 195 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ incremental = false
overflow-checks = true

[workspace.dependencies]
cosmwasm-std = "2.1.0"
cosmwasm-schema = { version = "2.1.0", default-features = false }
cw2 = "2.0.0"
cw-storage-plus = "2.0.0"
schemars = "0.8.15"
cosmwasm-std = { version = "3.0.1", features = [ "stargate" ] }
cosmwasm-schema = { version = "3.0.0", default-features = false }
cw2 = "3.0.0"
cw-storage-plus = "3.0.0"
schemars = "0.8.4"
serde = { version = "1.0.188", default-features = false }
serde-json-wasm = "1.0.0"
base64 = "0.21.7"
prost = "0.12.3"
prost-types = "0.12.1"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
prost = "0.14.1"
prost-types = "0.14.1"
bech32 = "0.9.1"
thiserror = "1.0.49"
protobuf = "~3.3.0"
hex = "0.4.3"
serde_json = { version = "1.0.87" }
tendermint-proto = "0.34.1"
speedate = "0.13.0"

cosmos-sdk-proto = { version = "0.28.0",git = "https://github.com/permissionlessweb/cosmos-rust", default-features = false }
tendermint-proto = { version = "0.40.4",git = "https://github.com/permissionlessweb/tendermint-rs", default-features = false }
19 changes: 9 additions & 10 deletions packages/neutron-std-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
.as_slice(),
);
match resp {
Err(e) => Err(cosmwasm_std::StdError::generic_err(format!(
Err(e) => Err(cosmwasm_std::StdError::msg(format!(
"Can't decode item: {}",
e
))),
Expand Down Expand Up @@ -126,15 +126,14 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
fn try_from(binary: cosmwasm_std::Binary) -> ::std::result::Result<Self, Self::Error> {
use ::prost::Message;
Self::decode(&binary[..]).map_err(|e| {
cosmwasm_std::StdError::parse_err(
cosmwasm_std::StdError::msg(
format!("Unable to decode {}: base64: {}, bytes array: {:?}, error: {:?}",
stringify!(#ident),
format!(
"Unable to decode binary: \n - base64: {}\n - bytes array: {:?}\n\n{:?}",
binary,
binary.to_vec(),
e
)
binary,
binary.to_vec(),
e
)
)
})
}
}
Expand All @@ -145,9 +144,9 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
fn try_from(result: cosmwasm_std::SubMsgResult) -> ::std::result::Result<Self, Self::Error> {
result
.into_result()
.map_err(|e| cosmwasm_std::StdError::generic_err(e))?
.map_err(|e| cosmwasm_std::StdError::msg(e))?
.data
.ok_or_else(|| cosmwasm_std::StdError::not_found("cosmwasm_std::SubMsgResult::<T>"))?
.ok_or_else(|| cosmwasm_std::StdError::msg("cosmwasm_std::SubMsgResult::<T>"))?
.try_into()
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/neutron-std/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ pub fn cosmwasm_to_proto_coins(

#[cfg(test)]
mod tests {
use cosmwasm_std::Uint128;
use cosmwasm_std::Uint256;

use super::*;

Expand All @@ -359,11 +359,11 @@ mod tests {
let coins = vec![
cosmwasm_std::Coin {
denom: "uatom".to_string(),
amount: Uint128::new(100),
amount: Uint256::new(100),
},
cosmwasm_std::Coin {
denom: "uosmo".to_string(),
amount: Uint128::new(200),
amount: Uint256::new(200),
},
];

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 @@
09082cfc7a07a22218494277d68f30b7dd884a58
v8.0.0-rc0
119 changes: 112 additions & 7 deletions packages/neutron-std/src/types/cosmwasm/wasm/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ pub struct MsgStoreAndInstantiateContract {
/// Admin is an optional address that can execute migrations
#[prost(string, tag = "6")]
pub admin: ::prost::alloc::string::String,
/// Label is optional metadata to be stored with a constract instance.
/// Label is optional metadata to be stored with a contract instance.
#[prost(string, tag = "7")]
pub label: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract on instantiation
Expand Down Expand Up @@ -1805,7 +1805,7 @@ pub struct InstantiateContractProposal {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Label is optional metadata to be stored with a constract instance.
/// Label is optional metadata to be stored with a contract instance.
#[prost(string, tag = "6")]
pub label: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract on instantiation
Expand Down Expand Up @@ -1843,7 +1843,7 @@ pub struct InstantiateContract2Proposal {
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// RunAs is the address that is passed to the contract's enviroment as sender
/// RunAs is the address that is passed to the contract's environment as sender
#[prost(string, tag = "3")]
pub run_as: ::prost::alloc::string::String,
/// Admin is an optional address that can execute migrations
Expand All @@ -1857,7 +1857,7 @@ pub struct InstantiateContract2Proposal {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Label is optional metadata to be stored with a constract instance.
/// Label is optional metadata to be stored with a contract instance.
#[prost(string, tag = "6")]
pub label: ::prost::alloc::string::String,
/// Msg json encode message to be passed to the contract on instantiation
Expand Down Expand Up @@ -2227,7 +2227,7 @@ pub struct StoreAndInstantiateContractProposal {
/// Admin is an optional address that can execute migrations
#[prost(string, tag = "7")]
pub admin: ::prost::alloc::string::String,
/// Label is optional metadata to be stored with a constract instance.
/// Label is optional metadata to be stored with a contract instance.
#[prost(string, tag = "8")]
pub label: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract on instantiation
Expand Down Expand Up @@ -2368,7 +2368,7 @@ pub struct QueryContractHistoryResponse {
response_type = QueryContractsByCodeResponse
)]
pub struct QueryContractsByCodeRequest {
/// grpc-gateway_out does not support Go style CodID
/// grpc-gateway_out does not support Go style CodeID
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
Expand Down Expand Up @@ -2573,14 +2573,73 @@ pub struct QuerySmartContractStateResponse {
#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeRequest")]
#[proto_query(path = "/cosmwasm.wasm.v1.Query/Code", response_type = QueryCodeResponse)]
pub struct QueryCodeRequest {
/// grpc-gateway_out does not support Go style CodID
/// grpc-gateway_out does not support Go style CodeID
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
}
/// QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeInfoRequest")]
#[proto_query(
path = "/cosmwasm.wasm.v1.Query/CodeInfo",
response_type = QueryCodeInfoResponse
)]
pub struct QueryCodeInfoRequest {
/// grpc-gateway_out does not support Go style CodeID
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
}
/// QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeInfoResponse")]
pub struct QueryCodeInfoResponse {
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
#[prost(string, tag = "2")]
pub creator: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
#[serde(
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
)]
pub checksum: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "4")]
pub instantiate_permission: ::core::option::Option<AccessConfig>,
}
/// CodeInfoResponse contains code meta data from CodeInfo
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -2819,6 +2878,44 @@ pub struct QueryContractsByCreatorResponse {
pub pagination:
::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
}
/// QueryWasmLimitsConfigRequest is the request type for the
/// Query/WasmLimitsConfig RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest")]
#[proto_query(
path = "/cosmwasm.wasm.v1.Query/WasmLimitsConfig",
response_type = QueryWasmLimitsConfigResponse
)]
pub struct QueryWasmLimitsConfigRequest {}
/// QueryWasmLimitsConfigResponse is the response type for the
/// Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for
/// static validation of Wasm files.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse")]
pub struct QueryWasmLimitsConfigResponse {
#[prost(string, tag = "1")]
pub config: ::prost::alloc::string::String,
}
/// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC
/// method.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -2960,6 +3057,9 @@ impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> {
) -> Result<QueryCodesResponse, cosmwasm_std::StdError> {
QueryCodesRequest { pagination }.query(self.querier)
}
pub fn code_info(&self, code_id: u64) -> Result<QueryCodeInfoResponse, cosmwasm_std::StdError> {
QueryCodeInfoRequest { code_id }.query(self.querier)
}
pub fn pinned_codes(
&self,
pagination: ::core::option::Option<
Expand All @@ -2984,6 +3084,11 @@ impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> {
}
.query(self.querier)
}
pub fn wasm_limits_config(
&self,
) -> Result<QueryWasmLimitsConfigResponse, cosmwasm_std::StdError> {
QueryWasmLimitsConfigRequest {}.query(self.querier)
}
pub fn build_address(
&self,
code_hash: ::prost::alloc::string::String,
Expand Down

This file was deleted.

Loading