diff --git a/Cargo.lock b/Cargo.lock index ec8fb742..78cd0b5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ dependencies = [ "cw-storage-plus 1.2.0", "cw-utils 0.16.0", "cw2 0.16.0", - "injective-cosmwasm 0.2.18", + "injective-cosmwasm 0.2.20", "injective-math 0.2.4", "injective-protobuf", "protobuf", @@ -774,7 +774,7 @@ dependencies = [ "cosmwasm-std", "cw-storage-plus 1.2.0", "cw2 0.16.0", - "injective-cosmwasm 0.2.18", + "injective-cosmwasm 0.2.20", "schemars", "serde 1.0.194", "thiserror", @@ -1519,36 +1519,36 @@ dependencies = [ [[package]] name = "injective-cosmwasm" version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b6f08b14a23696948d51ba6a050382cbc6e23522efec3ca607a5b1a317de0c" dependencies = [ - "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus 1.2.0", "ethereum-types", "hex", - "injective-math 0.2.4", + "injective-math 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "schemars", "serde 1.0.194", - "serde-json-wasm 1.0.0", "serde_repr", - "serde_test", "subtle-encoding", "tiny-keccak", ] [[package]] name = "injective-cosmwasm" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b6f08b14a23696948d51ba6a050382cbc6e23522efec3ca607a5b1a317de0c" +version = "0.2.20" dependencies = [ + "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus 1.2.0", "ethereum-types", "hex", - "injective-math 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "injective-math 0.2.4", "schemars", "serde 1.0.194", + "serde-json-wasm 1.0.0", "serde_repr", + "serde_test", "subtle-encoding", "tiny-keccak", ] @@ -1560,7 +1560,7 @@ dependencies = [ "cosmwasm-std", "cw-storage-plus 1.2.0", "cw2 0.16.0", - "injective-cosmwasm 0.2.18", + "injective-cosmwasm 0.2.20", "injective-math 0.2.4", "injective-std 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "injective-test-tube", @@ -1652,7 +1652,7 @@ dependencies = [ "cosmrs", "cosmwasm-std", "hex", - "injective-cosmwasm 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "injective-cosmwasm 0.2.18", "injective-std 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "prost 0.11.9", "serde 1.0.194", @@ -1669,7 +1669,7 @@ dependencies = [ "base64 0.13.1", "cosmwasm-std", "cw-multi-test", - "injective-cosmwasm 0.2.18", + "injective-cosmwasm 0.2.20", "injective-math 0.2.4", "rand 0.4.6", "secp256k1", diff --git a/contracts/atomic-order-example/Cargo.toml b/contracts/atomic-order-example/Cargo.toml index 8a75b928..5cc76ba4 100644 --- a/contracts/atomic-order-example/Cargo.toml +++ b/contracts/atomic-order-example/Cargo.toml @@ -34,7 +34,7 @@ cosmwasm-storage = { version = "1.5.0", features = [ "iterator" ] } cw-storage-plus = { version = "1.2.0" } cw-utils = { version = "0.16.0" } cw2 = { version = "0.16.0" } -injective-cosmwasm = { version = "0.2.18", path = "../../packages/injective-cosmwasm" } +injective-cosmwasm = { version = "0.2.20", path = "../../packages/injective-cosmwasm" } injective-math = { version = "0.2.4", path = "../../packages/injective-math" } injective-protobuf = { version = "0.2.2", path = "../../packages/injective-protobuf" } protobuf = { version = "2.28.0", features = [ "with-bytes" ] } diff --git a/contracts/dummy/Cargo.toml b/contracts/dummy/Cargo.toml index d5586880..b3c0f25a 100644 --- a/contracts/dummy/Cargo.toml +++ b/contracts/dummy/Cargo.toml @@ -32,7 +32,7 @@ optimize = """docker run --rm -v "$(pwd)":/code \ cosmwasm-std = { version = "1.5.0", features = [ "abort", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "iterator", "stargate" ] } cw-storage-plus = { version = "1.2.0" } cw2 = { version = "0.16.0" } -injective-cosmwasm = { version = "0.2.18", path = "../../packages/injective-cosmwasm" } +injective-cosmwasm = { version = "0.2.20", path = "../../packages/injective-cosmwasm" } schemars = "0.8.8" serde = { version = "1.0.136", default-features = false, features = [ "derive" ] } thiserror = { version = "1.0.30" } diff --git a/packages/injective-cosmwasm/Cargo.toml b/packages/injective-cosmwasm/Cargo.toml index 4ba81d20..a452602d 100644 --- a/packages/injective-cosmwasm/Cargo.toml +++ b/packages/injective-cosmwasm/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "injective-cosmwasm" readme = "README.md" repository = "https://github.com/InjectiveLabs/cw-injective/tree/dev/packages/injective-cosmwasm" -version = "0.2.18" +version = "0.2.20" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/injective-cosmwasm/src/exchange_mock_querier.rs b/packages/injective-cosmwasm/src/exchange_mock_querier.rs index 42081c72..bcfd1ed4 100644 --- a/packages/injective-cosmwasm/src/exchange_mock_querier.rs +++ b/packages/injective-cosmwasm/src/exchange_mock_querier.rs @@ -247,7 +247,7 @@ fn default_pyth_price_response_handler() -> QuerierResult { SystemResult::Ok(ContractResult::from(to_json_binary(&response))) } -fn default_token_factory_denom_total_supply_handler() -> QuerierResult { +fn default_total_supply_handler() -> QuerierResult { let response = TokenFactoryDenomSupplyResponse { total_supply: Uint128::from(1000u128), }; @@ -495,6 +495,7 @@ pub struct WasmMockQuerier { pub token_factory_denom_creation_fee_handler: Option>, pub balance_query_handler: Option>, pub all_balances_query_handler: Option>, + pub total_supply_handler: Option>, pub registered_contract_info_query_handler: Option>, pub spot_market_orderbook_response_handler: Option>, pub derivative_market_orderbook_response_handler: Option>, @@ -533,6 +534,10 @@ impl WasmMockQuerier { Some(handler) => handler.handle(address.to_string()), None => default_all_balances_bank_query_handler(), }, + BankQuery::Supply { denom } => match &self.total_supply_handler { + Some(handler) => handler.handle(denom.to_string()), + None => default_total_supply_handler(), + }, _ => panic!("unsupported"), }, QueryRequest::Custom(query) => match query.query_data.clone() { @@ -679,7 +684,7 @@ impl WasmMockQuerier { }, InjectiveQuery::TokenFactoryDenomTotalSupply { denom } => match &self.token_factory_denom_total_supply_handler { Some(handler) => handler.handle(denom), - None => default_token_factory_denom_total_supply_handler(), + None => default_total_supply_handler(), }, InjectiveQuery::TokenFactoryDenomCreationFee {} => match &self.token_factory_denom_creation_fee_handler { Some(handler) => handler.handle(), @@ -753,6 +758,7 @@ impl WasmMockQuerier { spot_market_orderbook_response_handler: None, derivative_market_orderbook_response_handler: None, market_atomic_execution_fee_multiplier_response_handler: None, + total_supply_handler: None, } } } diff --git a/packages/injective-cosmwasm/src/query.rs b/packages/injective-cosmwasm/src/query.rs index 5b8378c3..3a4b8066 100644 --- a/packages/injective-cosmwasm/src/query.rs +++ b/packages/injective-cosmwasm/src/query.rs @@ -101,6 +101,7 @@ pub enum InjectiveQuery { PerpetualMarketFunding { market_id: MarketId, }, + // Make sure you are aware of the potential to run out of gas when using this query MarketVolatility { market_id: MarketId, trade_history_options: TradeHistoryOptions, diff --git a/packages/injective-testing/Cargo.toml b/packages/injective-testing/Cargo.toml index ef6d1d6f..5c5c2aa8 100644 --- a/packages/injective-testing/Cargo.toml +++ b/packages/injective-testing/Cargo.toml @@ -12,7 +12,7 @@ anyhow = { version = "1.0.66" } base64 = { version = "0.13.1" } cosmwasm-std = { version = "1.5.0", features = [ "abort", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "iterator", "stargate" ] } cw-multi-test = { version = "0.16.2" } -injective-cosmwasm = { version = "0.2.18", path = "../injective-cosmwasm" } +injective-cosmwasm = { version = "0.2.20", path = "../injective-cosmwasm" } injective-math = { version = "0.2.4", path = "../injective-math" } rand = { version = "0.4.6" } secp256k1 = { version = "0.6.2" }