Skip to content

Commit

Permalink
set abi_paths in ChainConfig for Ethereum
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed May 8, 2024
1 parent a4ea101 commit 7aebc8c
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 13 deletions.
1 change: 1 addition & 0 deletions tests/cases/eth2eth/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
demo/.urelayer
fixtures/
1 change: 1 addition & 0 deletions tests/cases/eth2eth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ network:

.PHONY: test
test:
./scripts/fixture
./scripts/init-rly
./scripts/handshake
./scripts/test-tx
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/eth2eth/configs/chains/ibc-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
"blocks_per_event_query": 1000,
"abi_paths": ["fixtures/ethereum/ibc0/abis"]
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/eth2eth/configs/chains/ibc-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
"blocks_per_event_query": 1000,
"abi_paths": ["fixtures/ethereum/ibc1/abis"]
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
18 changes: 18 additions & 0 deletions tests/cases/eth2eth/scripts/fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eux

DOCKER=docker
SCRIPT_DIR=$(cd $(dirname $0); pwd)
FIXTURES_DIR=${SCRIPT_DIR}/../fixtures

# Setup test fixtures

set +x
rm -rf ${FIXTURES_DIR}
mkdir -p ${FIXTURES_DIR}/ethereum/ibc0
mkdir -p ${FIXTURES_DIR}/ethereum/ibc1
set -x

# retrieve the abi from the container to the local
${DOCKER} cp ethereum-geth0:/root/abis ${FIXTURES_DIR}/ethereum/ibc0/abis
${DOCKER} cp ethereum-geth1:/root/abis ${FIXTURES_DIR}/ethereum/ibc1/abis
8 changes: 3 additions & 5 deletions tests/cases/eth2eth/scripts/test-tx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ source ${SCRIPT_DIR}/util/relayer-util

ICS20_CLI="ethereum-ics20-cli"

TMP_DIR=/tmp
if ! which ${ICS20_CLI} > /dev/null 2>&1; then
if [ ! -d "${TMP_DIR}" ]; then
mkdir -p ${TMP_DIR}
fi
TMP_DIR=`mktemp -d`
git clone https://github.com/datachainlab/ethereum-ics20-cli.git ${TMP_DIR}/ethereum-ics20-cli
cd ${TMP_DIR}/ethereum-ics20-cli
pushd ${TMP_DIR}/ethereum-ics20-cli
git checkout v0.0.5
go install
export PATH=$PATH:$(go env GOPATH)/bin
popd
fi

ERC20_TOKEN_ADDRESS="0xff77D90D6aA12db33d3Ba50A34fB25401f6e4c4F"
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/tm2eth/configs/demo/ibc-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
"blocks_per_event_query": 1000,
"abi_paths": ["fixtures/ethereum/ibc1/abis"]
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
4 changes: 4 additions & 0 deletions tests/cases/tm2eth/scripts/fixture
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ FIXTURES_DIR=${SCRIPT_DIR}/../fixtures
set +x
rm -rf ${FIXTURES_DIR}
mkdir -p ${FIXTURES_DIR}/tendermint/ibc0
mkdir -p ${FIXTURES_DIR}/ethereum/ibc1
set -x

# retrieve the mnemonic from the container to the local
${DOCKER} cp tendermint-chain0-mock:/root/data/ibc0/key_seed.json ${FIXTURES_DIR}/tendermint/ibc0/key_seed.json

# retrieve the abi from the container to the local
${DOCKER} cp ethereum-geth0:/root/abis ${FIXTURES_DIR}/ethereum/ibc1/abis
8 changes: 3 additions & 5 deletions tests/cases/tm2eth/scripts/test-tx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ RLY="${RLY_BINARY} --debug"

# ics20-cli
ICS20_CLI="ethereum-ics20-cli"
TMP_DIR=/tmp
if ! which ${ICS20_CLI} > /dev/null 2>&1; then
if [ ! -d "${TMP_DIR}" ]; then
mkdir -p ${TMP_DIR}
fi
TMP_DIR=`mktemp -d`
git clone https://github.com/datachainlab/ethereum-ics20-cli.git ${TMP_DIR}/ethereum-ics20-cli
cd ${TMP_DIR}/ethereum-ics20-cli
pushd ${TMP_DIR}/ethereum-ics20-cli
git checkout v0.0.4
go install
export PATH=$PATH:$(go env GOPATH)/bin
popd
fi

TX_INTERVAL=3
Expand Down

0 comments on commit 7aebc8c

Please sign in to comment.