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 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
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.

4 changes: 2 additions & 2 deletions packages/injective-protobuf/src/proto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @generated

pub mod account;
pub mod auth;
pub mod coin;
pub mod distribution;
pub mod exchange;
pub mod tx;
pub mod oracle;
pub mod account;
pub mod tx;
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
36 changes: 33 additions & 3 deletions packages/injective-std/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# injective-std

**BETA VERSION:**
**BETA VERSION:**

The bindings are currently tracking an unofficial release of Injective.

Injective's proto-generated types and helpers built using [Buf](https://github.com/bufbuild/buf). Enables interaction with both custom and standard modules.

## Supported Version

* Injective-Core@e38d508c746a9b90d6e8a261ec2b03f99cc49351
- Injective-Core@e38d508c746a9b90d6e8a261ec2b03f99cc49351

## Build Instructions

Expand All @@ -22,6 +22,12 @@ In order to generate an individual proto file run:
buf generate [/path/to/injective-core] --template [/path/to/buf.gen.yaml] --output [output-path] --path [/path/to/module/proto]
```

Follow by:

```shell
buf build [/path/to/injective-core] --as-file-descriptor-set -o [/tmp/path/injective/descriptor_injective.bin] --path [/path/to/module/proto]
```

Example `buf.gen.yaml` file:

```yaml
Expand All @@ -32,4 +38,28 @@ plugins:
- extern_path=.google.protobuf.Timestamp=crate::shim::Timestamp
- extern_path=.google.protobuf.Duration=crate::shim::Duration
- extern_path=.google.protobuf.Any=crate::shim::Any
```
```

### Examples
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct grammatical error for clarity.

- Lets try to create the bindings for
+ Let's try to create the bindings for

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change


Lets try to create the bindings for

First create a directory with the dependencies as below:

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the language for the fenced code block to improve readability.

- ```
+ ```plaintext

```
├── README.md
└── dependencies
   ├── cosmos-sdk
   ├── injective-core
   └── wasmd
```

Next generate the proto:

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the language for the fenced code block to improve readability.

- ```
+ ```shell

```
buf generate /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto --template /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/buf.gen.yaml --output ./tmp/tmp-protobuf/injective --path /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto/injective/auction
```

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the language for the fenced code block to improve readability.

- ```
+ ```shell

```
buf build /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto --path /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto/injective/auction
```
1 change: 1 addition & 0 deletions packages/injective-std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![allow(unused_imports, deprecated)]

mod serde;
pub mod shim;
Expand Down
6 changes: 3 additions & 3 deletions packages/injective-std/src/types/cosmos/auth/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AuthQuerier<'a, Q> {
pub fn account(&self, address: ::prost::alloc::string::String) -> Result<QueryAccountResponse, cosmwasm_std::StdError> {
QueryAccountRequest { address }.query(self.querier)
}
// pub fn account_address_by_id(&self, id: i64, account_id: u64) -> Result<QueryAccountAddressByIdResponse, cosmwasm_std::StdError> {
// QueryAccountAddressByIdRequest { id, account_id }.query(self.querier)
// }
pub fn account_address_by_id(&self, id: i64, account_id: u64) -> Result<QueryAccountAddressByIdResponse, cosmwasm_std::StdError> {
QueryAccountAddressByIdRequest { id, account_id }.query(self.querier)
maxrobot marked this conversation as resolved.
Show resolved Hide resolved
}
pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
QueryParamsRequest {}.query(self.querier)
}
Expand Down
16 changes: 8 additions & 8 deletions packages/injective-std/src/types/cosmos/bank/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ pub struct Output {
/// Supply represents a struct that passively keeps track of the total supply
/// amounts in the network.
/// This message is deprecated now that supply is indexed by denom.
// #[allow(clippy::derive_partial_eq_without_eq)]
// #[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
// #[proto_message(type_url = "/cosmos.bank.v1beta1.SupplySupply")]
// #[deprecated]
// pub struct Supply {
// #[prost(message, repeated, tag = "1")]
// pub total: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.bank.v1beta1.SupplySupply")]
#[deprecated]
pub struct Supply {
maxrobot marked this conversation as resolved.
Show resolved Hide resolved
#[prost(message, repeated, tag = "1")]
pub total: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
/// DenomUnit represents a struct that describes a given
/// denomination unit of the basic token.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
28 changes: 14 additions & 14 deletions packages/injective-std/src/types/cosmos/distribution/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,20 @@ pub struct FeePool {
/// longer a need for an explicit CommunityPoolSpendProposal. To spend community
/// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov
/// module via a v1 governance proposal.
// #[allow(clippy::derive_partial_eq_without_eq)]
// #[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
// #[proto_message(type_url = "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalCommunityPoolSpendProposal")]
// #[deprecated]
// pub struct CommunityPoolSpendProposal {
// #[prost(string, tag = "1")]
// pub title: ::prost::alloc::string::String,
// #[prost(string, tag = "2")]
// pub description: ::prost::alloc::string::String,
// #[prost(string, tag = "3")]
// pub recipient: ::prost::alloc::string::String,
// #[prost(message, repeated, tag = "4")]
// pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalCommunityPoolSpendProposal")]
#[deprecated]
pub struct CommunityPoolSpendProposal {
maxrobot marked this conversation as resolved.
Show resolved Hide resolved
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub recipient: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
/// DelegatorStartingInfo represents the starting info for a delegator reward
/// period. It tracks the previous validator period, the delegation's amount of
/// staking token, and the creation height (to check later on if any slashes have
Expand Down
1 change: 1 addition & 0 deletions packages/injective-std/src/types/cosmwasm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod wasm;
1 change: 1 addition & 0 deletions packages/injective-std/src/types/cosmwasm/wasm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1;
Loading
Loading