From 8fa9925fa0900586dc2572957b6d1265d7e41459 Mon Sep 17 00:00:00 2001 From: Daisuke Kanda Date: Mon, 17 Jun 2024 06:12:58 +0000 Subject: [PATCH] use multicall Signed-off-by: Daisuke Kanda --- go.mod | 3 ++- go.sum | 8 ++++---- tests/cases/eth2eth/Makefile | 14 +++++++++++++- tests/cases/eth2eth/scripts/fixture | 17 +++++++++++++---- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 17a2fb6..cf6cb07 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,13 @@ go 1.21 replace ( // https://github.com/cosmos/cosmos-sdk/blob/v0.47.3/go.mod#L171-L182 github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + github.com/datachainlab/ethereum-ibc-relay-chain => github.com/dai1975/ethereum-ibc-relay-chain v0.0.0-20240613015231-637855f1529f github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) require ( github.com/datachainlab/ethereum-ibc-relay-chain v0.3.2 - github.com/hyperledger-labs/yui-relayer v0.5.3 + github.com/hyperledger-labs/yui-relayer v0.5.4 ) require ( diff --git a/go.sum b/go.sum index 9d79cff..2f29195 100644 --- a/go.sum +++ b/go.sum @@ -413,10 +413,10 @@ github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBS github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/dai1975/ethereum-ibc-relay-chain v0.0.0-20240613015231-637855f1529f h1:tq+6iFeilJQN2xCt2oqZDafqxxtKFdnDgNwFUDnIN20= +github.com/dai1975/ethereum-ibc-relay-chain v0.0.0-20240613015231-637855f1529f/go.mod h1:9rJTxXmEFVw8VrHYbKSK7bIQk1PVJm8pzyAYknMNNqc= 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.2 h1:obAxG44znqLUY0wpsTeRrWlQ/A6ls0uYLL1USEM5nko= -github.com/datachainlab/ethereum-ibc-relay-chain v0.3.2/go.mod h1:PdSsegkRJiMWVGq+afDtXKRKg4p8hnmR1Yj5BgXkit0= github.com/datachainlab/ibc-mock-client v0.4.1 h1:FQfyFOodgnchCIicpS7Vzji3yxXDe4Jl5hmE5Vz7M1s= github.com/datachainlab/ibc-mock-client v0.4.1/go.mod h1:2wGddiF2uHFhiMBpSskzKT/wA8naXi5DLoXt1KEZA1o= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -774,8 +774,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.3 h1:K7lcqkaqsGtpXImcz/cuClZsTtWCobLC9zh76KGzhP8= -github.com/hyperledger-labs/yui-relayer v0.5.3/go.mod h1:GeCb1dtZjtQdkBNw1L9+LAUHzNQQhQK+kkoOnZYffw0= +github.com/hyperledger-labs/yui-relayer v0.5.4 h1:yhvWI28Rcel55UsdmYWX0QE0W3P9aBSRetQh1k8VpZA= +github.com/hyperledger-labs/yui-relayer v0.5.4/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= diff --git a/tests/cases/eth2eth/Makefile b/tests/cases/eth2eth/Makefile index a2d2f9f..6e3c37f 100644 --- a/tests/cases/eth2eth/Makefile +++ b/tests/cases/eth2eth/Makefile @@ -9,7 +9,19 @@ network: .PHONY: test test: - ./scripts/fixture + $(MAKE) test-single + $(MAKE) test-multi + +.PHONY: test-multi +test-multi: + ./scripts/fixture multi + ./scripts/init-rly + ./scripts/handshake + ./scripts/test-tx + +.PHONY: test-single +test-single: + ./scripts/fixture single ./scripts/init-rly ./scripts/handshake ./scripts/test-tx diff --git a/tests/cases/eth2eth/scripts/fixture b/tests/cases/eth2eth/scripts/fixture index dd2e5b1..57b3255 100755 --- a/tests/cases/eth2eth/scripts/fixture +++ b/tests/cases/eth2eth/scripts/fixture @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -eux +ARG1=$1 + DOCKER=docker SCRIPT_DIR=$(cd $(dirname $0); pwd) FIXTURES_DIR=${SCRIPT_DIR}/../fixtures @@ -26,8 +28,15 @@ mkdir -p "$CONF_DIR/chains" for id in 0 1; do IBC_HANDLER_ADDRESS=`cat ${FIXTURES_DIR}/ethereum/ibc${id}/addresses/IBCHandler` MULTICALL3_ADDRESS=`cat ${FIXTURES_DIR}/ethereum/ibc${id}/addresses/Multicall3` - cat "$CONF_DIR/template/ibc-${id}.template.json" \ - | jq ".chain.ibc_address |= \"$IBC_HANDLER_ADDRESS\"" \ - | jq ".chain.multicall3_address |= \"$MULTICALL3_ADDRESS\"" \ - > "$CONF_DIR/chains/ibc-${id}.json" + if [ "$ARG1" = "multi" ]; then + cat "$CONF_DIR/template/ibc-${id}.template.json" \ + | jq ".chain.ibc_address |= \"$IBC_HANDLER_ADDRESS\"" \ + | jq ".chain.multicall3_address |= \"$MULTICALL3_ADDRESS\"" \ + > "$CONF_DIR/chains/ibc-${id}.json" + else + cat "$CONF_DIR/template/ibc-${id}.template.json" \ + | jq ".chain.ibc_address |= \"$IBC_HANDLER_ADDRESS\"" \ + | jq ".chain.multicall3_address |= null" \ + > "$CONF_DIR/chains/ibc-${id}.json" + fi done