Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to use injective-core v1.12.1 and the matching cosmos-sdk #218

Merged
merged 6 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/injective-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
name = "injective-std"
readme = "README.md"
repository = "https://github.com/InjectiveLabs/cw-injective/tree/dev/packages/injective-std"
version = "0.1.6"
version = "0.1.7"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 4 additions & 2 deletions packages/injective-std/src/types/cosmos/auth/module/v1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use osmosis_std_derive::CosmwasmExt;
/// Module is the config object for the auth module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.auth.module.v1.Module")]
pub struct Module {
/// bech32_prefix is the bech32 account prefix for the app.
Expand All @@ -16,7 +17,8 @@ pub struct Module {
}
/// ModuleAccountPermission represents permissions for a module account.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.auth.module.v1.ModuleAccountPermission")]
pub struct ModuleAccountPermission {
/// account is the name of the module.
Expand Down
141 changes: 101 additions & 40 deletions packages/injective-std/src/types/cosmos/auth/v1beta1.rs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/injective-std/src/types/cosmos/authz/module/v1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use osmosis_std_derive::CosmwasmExt;
/// Module is the config object of the authz module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.module.v1.Module")]
pub struct Module {}
107 changes: 76 additions & 31 deletions packages/injective-std/src/types/cosmos/authz/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use osmosis_std_derive::CosmwasmExt;
/// GenericAuthorization gives the grantee unrestricted permissions to execute
/// the provided method on behalf of the granter's account.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.GenericAuthorization")]
pub struct GenericAuthorization {
/// Msg, identified by it's type URL, to grant unrestricted permissions to execute
Expand All @@ -12,7 +13,8 @@ pub struct GenericAuthorization {
/// Grant gives permissions to execute
/// the provide method with expiration time.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.Grant")]
pub struct Grant {
#[prost(message, optional, tag = "1")]
Expand All @@ -26,7 +28,8 @@ pub struct Grant {
/// GrantAuthorization extends a grant with both the addresses of the grantee and granter.
/// It is used in genesis.proto and query.proto
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.GrantAuthorization")]
pub struct GrantAuthorization {
#[prost(string, tag = "1")]
Expand All @@ -40,7 +43,8 @@ pub struct GrantAuthorization {
}
/// GrantQueueItem contains the list of TypeURL of a sdk.Msg.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.GrantQueueItem")]
pub struct GrantQueueItem {
/// msg_type_urls contains the list of TypeURL of a sdk.Msg.
Expand All @@ -49,7 +53,8 @@ pub struct GrantQueueItem {
}
/// EventGrant is emitted on Msg/Grant
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.EventGrant")]
pub struct EventGrant {
/// Msg type URL for which an autorization is granted
Expand All @@ -64,7 +69,8 @@ pub struct EventGrant {
}
/// EventRevoke is emitted on Msg/Revoke
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.EventRevoke")]
pub struct EventRevoke {
/// Msg type URL for which an autorization is revoked
Expand All @@ -79,15 +85,17 @@ pub struct EventRevoke {
}
/// GenesisState defines the authz module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.GenesisState")]
pub struct GenesisState {
#[prost(message, repeated, tag = "1")]
pub authorization: ::prost::alloc::vec::Vec<GrantAuthorization>,
}
/// QueryGrantsRequest is the request type for the Query/Grants RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGrantsRequest")]
#[proto_query(
path = "/cosmos.authz.v1beta1.Query/Grants",
Expand All @@ -103,23 +111,29 @@ pub struct QueryGrantsRequest {
pub msg_type_url: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "4")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
/// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGrantsResponse")]
pub struct QueryGrantsResponse {
/// authorizations is a list of grants granted for grantee by granter.
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<Grant>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
/// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranterGrantsRequest")]
#[proto_query(
path = "/cosmos.authz.v1beta1.Query/GranterGrants",
Expand All @@ -130,23 +144,29 @@ pub struct QueryGranterGrantsRequest {
pub granter: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
/// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranterGrantsResponse")]
pub struct QueryGranterGrantsResponse {
/// grants is a list of grants granted by the granter.
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<GrantAuthorization>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
/// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest")]
#[proto_query(
path = "/cosmos.authz.v1beta1.Query/GranteeGrants",
Expand All @@ -157,24 +177,30 @@ pub struct QueryGranteeGrantsRequest {
pub grantee: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
/// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse")]
pub struct QueryGranteeGrantsResponse {
/// grants is a list of grants granted to the grantee.
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<GrantAuthorization>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
/// MsgGrant is a request type for Grant method. It declares authorization to the grantee
/// on behalf of the granter with the provided expiration time.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrant")]
pub struct MsgGrant {
#[prost(string, tag = "1")]
Expand All @@ -186,7 +212,8 @@ pub struct MsgGrant {
}
/// MsgExecResponse defines the Msg/MsgExecResponse response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExecResponse")]
pub struct MsgExecResponse {
#[prost(bytes = "vec", repeated, tag = "1")]
Expand All @@ -196,7 +223,8 @@ pub struct MsgExecResponse {
/// authorizations granted to the grantee. Each message should have only
/// one signer corresponding to the granter of the authorization.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExec")]
pub struct MsgExec {
#[prost(string, tag = "1")]
Expand All @@ -209,13 +237,15 @@ pub struct MsgExec {
}
/// MsgGrantResponse defines the Msg/MsgGrant response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrantResponse")]
pub struct MsgGrantResponse {}
/// MsgRevoke revokes any authorization with the provided sdk.Msg type on the
/// granter's account with that has been granted to the grantee.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgRevoke")]
pub struct MsgRevoke {
#[prost(string, tag = "1")]
Expand All @@ -227,7 +257,8 @@ pub struct MsgRevoke {
}
/// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgRevokeResponse")]
pub struct MsgRevokeResponse {}
pub struct AuthzQuerier<'a, Q: cosmwasm_std::CustomQuery> {
Expand All @@ -242,28 +273,42 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AuthzQuerier<'a, Q> {
granter: ::prost::alloc::string::String,
grantee: ::prost::alloc::string::String,
msg_type_url: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
) -> Result<QueryGrantsResponse, cosmwasm_std::StdError> {
QueryGrantsRequest {
granter,
grantee,
msg_type_url,
pagination,
}
.query(self.querier)
.query(self.querier)
}
pub fn granter_grants(
&self,
granter: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
) -> Result<QueryGranterGrantsResponse, cosmwasm_std::StdError> {
QueryGranterGrantsRequest { granter, pagination }.query(self.querier)
QueryGranterGrantsRequest {
granter,
pagination,
}
.query(self.querier)
}
pub fn grantee_grants(
&self,
grantee: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
) -> Result<QueryGranteeGrantsResponse, cosmwasm_std::StdError> {
QueryGranteeGrantsRequest { grantee, pagination }.query(self.querier)
QueryGranteeGrantsRequest {
grantee,
pagination,
}
.query(self.querier)
}
}
7 changes: 5 additions & 2 deletions packages/injective-std/src/types/cosmos/bank/module/v1.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
use osmosis_std_derive::CosmwasmExt;
/// Module is the config object of the bank module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.bank.module.v1.Module")]
pub struct Module {
/// blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds.
/// If left empty it defaults to the list of account names supplied in the auth module configuration as
/// module_account_permissions
#[prost(string, repeated, tag = "1")]
pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
/// authority defines the custom module authority. If not set, defaults to the governance module.
#[prost(string, tag = "2")]
pub authority: ::prost::alloc::string::String,
Expand Down
Loading
Loading