Skip to content

Commit 96dccc0

Browse files
committed
feat: injective testing v1.1.13-1
1 parent 717366e commit 96dccc0

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

packages/injective-testing/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[package]
2-
authors = [ "Markus Waas <markus@injectivelabs.org>" ]
2+
authors = ["Markus Waas <markus@injectivelabs.org>", "Jose Luis Bernal Castillo <joseluis@injectivelabs.org>" ]
33
description = "Testing utils for Injective Cosmwasm and core modules"
44
edition = "2021"
55
license = "Apache-2.0"
66
name = "injective-testing"
77
repository = "https://github.com/InjectiveLabs/cw-injective/tree/dev/packages/injective-testing"
8-
version = "1.1.12-1"
8+
version = "1.1.13-1"
99

1010
[dependencies]
1111
anyhow = { version = "1.0.66" }
12-
cosmwasm-std = { version = "2.2.2", features = [ "abort", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0", "iterator", "stargate" ] }
13-
cw-multi-test = { version = "2.2.1" }
14-
injective-test-tube = { version = "1.16.3-1"}
15-
injective-cosmwasm = { version = "0.3.4-1" }
16-
injective-math = { version = "0.3.4-1" }
17-
injective-std = { version = "1.16.3-1" }
12+
cosmwasm-std = { version = "3.0.2", features = ["cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0", "iterator", "stargate" ] }
13+
cw-multi-test = { version = "3.0.1" }
14+
injective-test-tube = { version = "1.16.4-1"}
15+
injective-cosmwasm = { version = "0.3.5-1"}
16+
injective-math = { version = "0.3.5-1"}
17+
injective-std = { version = "1.16.4-1"}
1818
prost = { version = "0.13.5", features = [ "prost-derive" ] }
1919
rand = { version = "0.4.6" }
2020
regex = { version = "1.11.1" }

packages/injective-testing/src/multi_test/address_generator.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ const ADDRESS_BYTE_INDEX: usize = KECCAK_OUTPUT_BYTES - ADDRESS_BYTES;
1313
pub struct InjectiveAddressGenerator();
1414

1515
impl AddressGenerator for InjectiveAddressGenerator {
16-
fn contract_address(&self, _api: &dyn cosmwasm_std::Api, _storage: &mut dyn Storage, _code_id: u64, _instance_id: u64) -> Result<Addr, cosmwasm_std::StdError> {
16+
fn contract_address(
17+
&self,
18+
_api: &dyn cosmwasm_std::Api,
19+
_storage: &mut dyn Storage,
20+
_code_id: u64,
21+
_instance_id: u64,
22+
) -> Result<Addr, cosmwasm_std::StdError> {
1723
Ok(generate_inj_address())
1824
}
1925

@@ -45,7 +51,13 @@ impl Default for StorageAwareInjectiveAddressGenerator {
4551
}
4652

4753
impl AddressGenerator for StorageAwareInjectiveAddressGenerator {
48-
fn contract_address(&self, _api: &dyn cosmwasm_std::Api, storage: &mut dyn Storage, _code_id: u64, _instance_id: u64) -> Result<Addr, cosmwasm_std::StdError>{
54+
fn contract_address(
55+
&self,
56+
_api: &dyn cosmwasm_std::Api,
57+
storage: &mut dyn Storage,
58+
_code_id: u64,
59+
_instance_id: u64,
60+
) -> Result<Addr, cosmwasm_std::StdError> {
4961
let generated_address = generate_inj_address();
5062
let key = self.key.as_bytes();
5163
let stored = storage.get(key);

packages/injective-testing/src/multi_test/chain_mock.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use crate::multi_test::address_generator::InjectiveAddressGenerator;
2-
use cosmwasm_std::{testing::{MockApi, MockStorage}, Addr, Api, Binary, BlockInfo, Coin, CustomQuery, Empty, Querier, Storage, to_json_binary, StdError};
2+
use cosmwasm_std::{
3+
testing::{MockApi, MockStorage},
4+
to_json_binary, Addr, Api, Binary, BlockInfo, Coin, CustomQuery, Empty, Querier, StdError, Storage,
5+
};
36
use cw_multi_test::{
47
no_init, AddressGenerator, App, AppResponse, BankKeeper, BasicAppBuilder, CosmosRouter, Module, StargateAccepting, StargateFailing, WasmKeeper,
58
};
@@ -231,7 +234,14 @@ impl Module for CustomInjectiveHandler {
231234
}
232235
}
233236

234-
fn query(&self, _api: &dyn Api, _storage: &dyn Storage, _querier: &dyn Querier, _block: &BlockInfo, request: Self::QueryT) -> Result<Binary, StdError> {
237+
fn query(
238+
&self,
239+
_api: &dyn Api,
240+
_storage: &dyn Storage,
241+
_querier: &dyn Querier,
242+
_block: &BlockInfo,
243+
request: Self::QueryT,
244+
) -> Result<Binary, StdError> {
235245
let mut query_calls_count = self.state.queries.borrow().len();
236246

237247
if !self.assertions.queries.is_empty()

0 commit comments

Comments
 (0)