Skip to content

Commit

Permalink
Merge pull request #38 from siburu/channel-upgrade-aftercare
Browse files Browse the repository at this point in the history
Channel Upgrade Aftercare
  • Loading branch information
siburu authored Oct 16, 2024
2 parents 6a0aa33 + aa51b35 commit 44ea546
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 47 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ replace (
)

require (
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.11
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.12
github.com/datachainlab/ibc-hd-signer v0.1.0
github.com/hyperledger-labs/yui-relayer v0.5.8
github.com/hyperledger-labs/yui-relayer v0.5.9
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.11 h1:3ROddDQLw4Tfa9QrC5ts+FvwW8ZibYozU0dEeWVoON4=
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.11/go.mod h1:7goF50HLpKyL6bmisyY7t9QV338WC+68GqGpaZ9Te24=
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.12 h1:0yiog+Pdek45yeOUyDJ7j4vkM7AR1Jt93K3yNoRpwiY=
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.12/go.mod h1:7goF50HLpKyL6bmisyY7t9QV338WC+68GqGpaZ9Te24=
github.com/datachainlab/ibc-hd-signer v0.1.0 h1:dmnFTAwFpl0m7Lx6+b+N/rrNpHQnXpyJAYnM25GhDi0=
github.com/datachainlab/ibc-hd-signer v0.1.0/go.mod h1:wUbLb2EryMCY+GfEsziU0T032Gch04jmrN0D4XGAfOI=
github.com/datachainlab/ibc-mock-client v0.4.1 h1:FQfyFOodgnchCIicpS7Vzji3yxXDe4Jl5hmE5Vz7M1s=
Expand Down Expand Up @@ -776,8 +776,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/hyperledger-labs/yui-relayer v0.5.8 h1:rIgWXSyKIVg/xjbfYjQ2biQaoL7jAoGIjJFgqLWWanY=
github.com/hyperledger-labs/yui-relayer v0.5.8/go.mod h1:GeCb1dtZjtQdkBNw1L9+LAUHzNQQhQK+kkoOnZYffw0=
github.com/hyperledger-labs/yui-relayer v0.5.9 h1:OgjdIJspyfkGnKtKZUk1ANx5nCMITQ9h7PmsIE2JDYg=
github.com/hyperledger-labs/yui-relayer v0.5.9/go.mod h1:GeCb1dtZjtQdkBNw1L9+LAUHzNQQhQK+kkoOnZYffw0=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
Expand Down
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
16 changes: 9 additions & 7 deletions tests/chains/ethereum/contracts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/chains/ethereum/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"license": "Apache-2.0",
"devDependencies": {
"@datachainlab/ethereum-ibc-relay-chain": "git+https://github.com/datachainlab/ethereum-ibc-relay-chain.git#semver:v0.3.10",
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.35",
"@datachainlab/ethereum-ibc-relay-chain": "git+https://github.com/datachainlab/ethereum-ibc-relay-chain.git#semver:v0.3.12",
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.39",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/hardhat-upgrades": "^3.2.1",
"hardhat": "^2.19.1"
Expand Down
21 changes: 8 additions & 13 deletions tests/chains/ethereum/contracts/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ async function deployApp(deployer, ibcHandler) {
const impl = await prepareImplementation(deployer, proxyV1, contractName, [ibcHandler.target], unsafeAllow);
saveAddress(contractName, impl);

await proxyV1.proposeAppVersion(`mockapp-${i}`, {
implementation: impl.target,
initialCalldata: impl.interface.encodeFunctionData(`__${contractName}_init(string)`, [contractName]),
consumed: false,
}).then(tx => tx.wait());
await proxyV1.proposeAppVersion(
`mockapp-${i}`,
impl.target,
impl.interface.encodeFunctionData(`__${contractName}_init(string)`, [contractName]),
).then(tx => tx.wait());
}

return proxyV1;
Expand Down 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 44ea546

Please sign in to comment.