Skip to content

Commit 0ea280b

Browse files
committed
fix: tests
1 parent bbf1478 commit 0ea280b

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

contracts/atomic-order-example/src/contract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fn handle_atomic_order_reply(
181181
let purchased_coins = Coin::new(u128::from(quantity), config.base_denom.clone());
182182
let paid = quantity * price + fee;
183183
let leftover = cache.deposited_amount.amount - Uint256::from(u128::from(paid));
184-
let leftover_coins = Coin::new(Uint256::from(leftover), config.quote_denom);
184+
let leftover_coins = Coin::new(leftover, config.quote_denom);
185185

186186
let send_message = BankMsg::Send {
187187
to_address: cache.sender_address,

contracts/atomic-order-example/src/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::str::FromStr;
33
use cosmwasm_std::testing::{message_info, MockApi, MockStorage};
44
use cosmwasm_std::{
55
coins, to_json_binary, Addr, BankMsg, Binary, ContractResult, CosmosMsg, MsgResponse,
6-
OwnedDeps, QuerierResult, Reply, SubMsgResponse, SubMsgResult, SystemResult, Uint128,
6+
OwnedDeps, QuerierResult, Reply, SubMsgResponse, SubMsgResult, SystemResult, Uint256,
77
};
88

99
use injective_cosmwasm::InjectiveMsg::CreateSpotMarketOrder;
@@ -120,9 +120,9 @@ fn test_swap() {
120120
assert_eq!(to_address, sender_addr);
121121
assert_eq!(2, amount.len());
122122
assert_eq!(amount[0].denom, "INJ");
123-
assert_eq!(amount[0].amount, Uint128::from(8u128));
123+
assert_eq!(amount[0].amount, Uint256::from(8u128));
124124
assert_eq!(amount[1].denom, "USDT");
125-
assert_eq!(amount[1].amount, Uint128::from(9000u128 - 8036u128));
125+
assert_eq!(amount[1].amount, Uint256::from(9000u128 - 8036u128));
126126
} else {
127127
panic!("Wrong message type!");
128128
}

contracts/injective-cosmwasm-stargate-example/src/testing/test_bank.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
testing::type_helpers::{BankParams, ParamResponse, QueryBalanceResponse, QueryDenomMetadataResponse, QuerySupplyOffResponse},
55
utils::{ExchangeType, Setup},
66
};
7-
use cosmwasm_std::{Coin, Uint128};
7+
use cosmwasm_std::{Coin, Uint256};
88
use injective_test_tube::{
99
injective_std::types::{
1010
cosmos::bank::v1beta1::{QueryBalanceRequest, QueryDenomMetadataRequest, QuerySupplyOfRequest},
@@ -92,7 +92,7 @@ fn test_query_bank_balance() {
9292
response.balance,
9393
Coin {
9494
denom: "inj".to_string(),
95-
amount: Uint128::new(1_000_000_000_000_000_000_000_000),
95+
amount: Uint256::new(1_000_000_000_000_000_000_000_000),
9696
}
9797
);
9898
}
@@ -114,7 +114,7 @@ fn test_query_supply_of() {
114114
response.amount,
115115
Coin {
116116
denom: "inj".to_string(),
117-
amount: Uint128::new(12000004078367203674350010),
117+
amount: Uint256::new(12000004078367203674350010),
118118
}
119119
);
120120
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl AddressGenerator for InjectiveAddressGenerator {
3434
salt: &[u8],
3535
) -> Result<Addr, cosmwasm_std::StdError> {
3636
let canonical_addr = cosmwasm_std::instantiate2_address(checksum, creator, salt)?;
37-
Ok(api.addr_humanize(&canonical_addr)?)
37+
api.addr_humanize(&canonical_addr)
3838
}
3939
}
4040

0 commit comments

Comments
 (0)