Skip to content

Commit

Permalink
fix ics20 testing
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Oct 15, 2024
1 parent f646f26 commit 70cb772
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
31 changes: 14 additions & 17 deletions tests/cases/tm2eth/scripts/test-ics20-packet-relay
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ BOB_INDEX=2

ADDRESSES_DIR_B="${FIXTURES_DIR}/ethereum/ibc1/addresses"
ERC20_TOKEN_CONTRACT_B=`cat ${ADDRESSES_DIR_B}/ERC20Token`
ICS20_BANK_CONTRACT_B=`cat ${ADDRESSES_DIR_B}/ICS20Bank`
ICS20_TRANSFER_BANK_CONTRACT_B=`cat ${ADDRESSES_DIR_B}/ICS20TransferBank`
ICS20_TRANSFER_CONTRACT_B=`cat ${ADDRESSES_DIR_B}/ICS20Transfer`

MNEMONIC_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.signer.mnemonic')
RPC_ADDRESS_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.rpc_addr')
Expand Down Expand Up @@ -46,14 +45,13 @@ cast send \
--rpc-url $RPC_ADDRESS_B \
--mnemonic "$MNEMONIC_B" \
--mnemonic-index ${BOB_INDEX} \
$ICS20_TRANSFER_BANK_CONTRACT_B \
'sendTransfer(string,uint256,string,string,string,uint64)' \
$ICS20_TRANSFER_CONTRACT_B \
'sendTransfer(string,string,uint256,string,((uint64,uint64),uint64))' \
$CHANNEL_B \
$PORT_B/$CHANNEL_B/$DENOM_A \
100 \
$TM_ADDRESS \
$PORT_B \
$CHANNEL_B \
100000
'((0,100000),0)'
sleep ${TX_INTERVAL}
${RLY} tx relay $PATH_NAME --dst-seqs 1
sleep ${TX_INTERVAL}
Expand All @@ -74,29 +72,28 @@ cast send \
--mnemonic-index ${BOB_INDEX} \
$ERC20_TOKEN_CONTRACT_B \
'approve(address,uint256)' \
$ICS20_BANK_CONTRACT_B \
$ICS20_TRANSFER_CONTRACT_B \
500
cast send \
--rpc-url $RPC_ADDRESS_B \
--mnemonic "$MNEMONIC_B" \
--mnemonic-index ${BOB_INDEX} \
$ICS20_BANK_CONTRACT_B \
'deposit(address,uint256,address)' \
$ICS20_TRANSFER_CONTRACT_B \
'deposit(address,address,uint256)' \
$BOB_ADDRESS \
$ERC20_TOKEN_CONTRACT_B \
500 \
$BOB_ADDRESS
500
cast send \
--rpc-url $RPC_ADDRESS_B \
--mnemonic "$MNEMONIC_B" \
--mnemonic-index ${BOB_INDEX} \
$ICS20_TRANSFER_BANK_CONTRACT_B \
'sendTransfer(string,uint256,string,string,string,uint64)' \
$ICS20_TRANSFER_CONTRACT_B \
'sendTransfer(string,string,uint256,string,((uint64,uint64),uint64))' \
$CHANNEL_B \
$DENOM_B \
500 \
$TM_ADDRESS \
$PORT_B \
$CHANNEL_B \
100000
'((0,100000),0)'
sleep ${TX_INTERVAL}
${RLY} tx relay $PATH_NAME --dst-seqs 2
sleep ${TX_INTERVAL}
Expand Down
3 changes: 1 addition & 2 deletions tests/chains/ethereum/contracts/contracts/Dependencies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import {OwnableIBCHandler} from "@hyperledger-labs/yui-ibc-solidity/contracts/co
import {MockClient} from "@hyperledger-labs/yui-ibc-solidity/contracts/clients/mock/MockClient.sol";

import {ERC20Token} from "@hyperledger-labs/yui-ibc-solidity/contracts/apps/20-transfer/ERC20Token.sol";
import {ICS20Bank} from "@hyperledger-labs/yui-ibc-solidity/contracts/apps/20-transfer/ICS20Bank.sol";
import {ICS20TransferBank} from "@hyperledger-labs/yui-ibc-solidity/contracts/apps/20-transfer/ICS20TransferBank.sol";
import {ICS20Transfer} from "@hyperledger-labs/yui-ibc-solidity/contracts/apps/20-transfer/ICS20Transfer.sol";

import {IBCContractUpgradableUUPSMockApp} from "@datachainlab/ethereum-ibc-relay-chain/contracts/IBCContractUpgradableUUPSMockApp.sol";

Expand Down
11 changes: 3 additions & 8 deletions tests/chains/ethereum/contracts/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,8 @@ async function main() {
const erc20token = await deploy(deployer, "ERC20Token", ["simple", "simple", 1000000]);
saveAddress("ERC20Token", erc20token);

const ics20bank = await deploy(deployer, "ICS20Bank");
saveAddress("ICS20Bank", ics20bank);

const ics20transferbank = await deploy(deployer, "ICS20TransferBank", [ibcHandler.target, ics20bank.target]);
saveAddress("ICS20TransferBank", ics20transferbank);
const ics20transfer = await deploy(deployer, "ICS20Transfer", [ibcHandler.target, "transfer"]);
saveAddress("ICS20Transfer", ics20transfer);

const app = await deployApp(deployer, ibcHandler);

Expand All @@ -134,11 +131,9 @@ async function main() {
const multicall3 = await deploy(deployer, "Multicall3", []);
saveAddress("Multicall3", multicall3);

await ibcHandler.bindPort("transfer", ics20transferbank.target);
await ibcHandler.bindPort("transfer", ics20transfer.target);
await ibcHandler.bindPort("mockapp", app.target);
await ibcHandler.registerClient("mock-client", mockClient.target);
await ics20bank.setOperator(ics20transferbank.target);

}

if (require.main === module) {
Expand Down

0 comments on commit 70cb772

Please sign in to comment.