Skip to content

Commit

Permalink
Fix cw20-ics20 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Oct 3, 2022
1 parent 51daa15 commit f220666
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion contracts/cw20-ics20/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ clippy:
cargo clippy

.PHONY: build
build: contract.wasm src Cargo.toml Cargo.lock
build: src/*.rs Cargo.toml Cargo.lock
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked
@# The following line is not necessary, may work only on linux (extra size optimization)
wasm-opt -Oz ./target/wasm32-unknown-unknown/release/cw20_ics20.wasm -o ./contract.wasm
Expand Down
6 changes: 1 addition & 5 deletions contracts/cw20-ics20/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ fn do_ibc_packet_receive(

let to_send = Amount::from_parts(denom.to_string(), msg.amount);
let allow_info = check_allow_list(deps.as_ref(), &to_send)?;
let send = send_amount(
to_send,
allow_info.code_hash.to_string(),
msg.receiver.clone(),
);
let send = send_amount(to_send, allow_info.code_hash, msg.receiver.clone());
let mut submsg = SubMsg::reply_on_error(send, RECEIVE_ID);
submsg.gas_limit = allow_info.gas_limit;

Expand Down
4 changes: 2 additions & 2 deletions contracts/cw20-ics20/test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
localsecret-1:
image: "ghcr.io/scrtlabs/localsecret:v1.4.0"
image: "ghcr.io/scrtlabs/localsecret:v1.5.0-beta.1"
# ports are only here in case interaction
# between localhost and container is desired
ports:
Expand All @@ -15,7 +15,7 @@ services:
environment:
LOG_LEVEL: "TRACE"
localsecret-2:
image: "ghcr.io/scrtlabs/localsecret:v1.4.0"
image: "ghcr.io/scrtlabs/localsecret:v1.5.0-beta.1"
# ports are only here in case interaction
# between localhost and container is desired
ports:
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw20-ics20/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "18.7.9",
"jest": "28.1.3",
"prettier": "2.7.1",
"secretjs": "1.4.0-alpha.10",
"secretjs": "1.4.3",
"ts-jest": "28.0.8",
"ts-node": "10.9.1",
"typescript": "4.7.4"
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw20-ics20/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ test(
denom: expectedIbcDenom,
amount: "1",
},
receiver: accounts2[1].address,
receiver: accounts1[0].address,
timeoutTimestampSec: String(Math.floor(Date.now() / 1000) + 10 * 60) /* 10 minutes */,
});

Expand Down
8 changes: 4 additions & 4 deletions contracts/cw20-ics20/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function waitForIBCChannel(chainId: string, grpcWebUrl: string, cha

export async function createIbcConnection(): Promise<Link> {
// Create signers as LocalSecret account d
// (Both localsecret so same account can be used on both sides)
// (Both sides are localsecret so same account can be used on both sides)
const signerA = new Wallet(
"word twist toast cloth movie predict advance crumble escape whale sail such angry muffin balcony keen move employ cook valve hurt glimpse breeze brick"
);
Expand Down Expand Up @@ -154,9 +154,9 @@ export async function loopRelayer(link: Link) {
while (true) {
try {
nextRelay = await link.relayAll();
console.group("Next relay:");
console.log(nextRelay);
console.groupEnd();
// console.group("Next relay:");
// console.log(nextRelay);
// console.groupEnd();

await Promise.all([link.updateClient("A"), link.updateClient("B")]);
} catch (e) {
Expand Down
8 changes: 4 additions & 4 deletions contracts/cw20-ics20/test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2872,10 +2872,10 @@ safe-stable-stringify@^2.3.1:
resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.0.tgz#95fadb1bcf8057a1363e11052122f5da36a69215"
integrity sha512-eehKHKpab6E741ud7ZIMcXhKcP6TSIezPkNZhy5U8xC6+VvrRdUA2tMgxGxaGl4cz7c2Ew5+mg5+wNB16KQqrA==

[email protected].0-alpha.10:
version "1.4.0-alpha.10"
resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-1.4.0-alpha.10.tgz#abf890db82aff3780ed1c9d8cf2eb60cfa17b458"
integrity sha512-0C50gGM04NxDLJpXVtj5532fpheocQtSP7fGA74WPzGgD3Qx3v3/zo8BPBraZtCy3JdPHh+tAt9LkLtLJcU0aw==
[email protected].3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-1.4.3.tgz#393fc381fa2924e9b339e52d1ba5ce9b3bc68241"
integrity sha512-IDhoPWg1Nra7ji3FU07ZHbxkp1S5uQnbLsDNj/t6Q9M9wysxv/BZafHnoEkAcB7FYYwOkxs5RxnSAZ2oiJORPw==
dependencies:
"@cosmjs/encoding" "0.27.1"
"@cosmjs/math" "0.27.1"
Expand Down

0 comments on commit f220666

Please sign in to comment.