Skip to content

Commit

Permalink
e2e: set abi of custom errors to relayer config
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
  • Loading branch information
bluele committed May 13, 2024
1 parent 56e9465 commit 82b70d2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.env.sh
/abis

artifacts/
cache/
Expand Down
1 change: 1 addition & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ network-down:

.PHONY: init
init:
./relayer/scripts/extract-abi.sh
RLY_BIN=$(RLY_BIN) ./relayer/scripts/init-rly

.PHONY: handshake
Expand Down
1 change: 1 addition & 0 deletions e2e/relayer/configs/templates/ibc0.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"max_gas_limit": 10000000,
"tx_type": "legacy",
"abi_paths": ["./abis"],
"allow_lc_functions": {
"lc_address": "$IBFT2_CLIENT_ADDRESS",
"allow_all": false,
Expand Down
19 changes: 19 additions & 0 deletions e2e/relayer/scripts/extract-abi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# cd "`dirname $0`"/..
ARTIFACTS=artifacts
ABIS=abis

mkdir -p $ABIS

for f in `find $ARTIFACTS -type d -name '*.sol'`
do
contract=`basename $f | sed s/\.sol$//`
jsonfile=$f/$contract.json
if [ -e $jsonfile ]
then
abifile=`echo $f | sed "s#^$ARTIFACTS#$ABIS#" | sed s/\.sol$/.json/`
mkdir -p `dirname $abifile`
jq .abi $jsonfile > $abifile
fi
done

0 comments on commit 82b70d2

Please sign in to comment.