wormhole/generate-abi.sh

23 lines
601 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Regenerate node/pkg/ethereum/abi using a running eth-devnet's state.
2020-11-28 13:11:48 -08:00
set -euo pipefail
2020-08-17 14:01:59 -07:00
(
cd third_party/abigen
2022-08-26 09:35:22 -07:00
docker build -t localhost/wormhole-foundation/wormhole-abigen:latest .
2020-08-17 14:01:59 -07:00
)
2020-11-28 13:11:48 -08:00
function gen() {
local name=$1
local pkg=$2
2020-08-17 14:01:59 -07:00
kubectl exec -c tests eth-devnet-0 -- npx truffle@5.4.1 run abigen $name
2020-11-28 13:11:48 -08:00
kubectl exec -c tests eth-devnet-0 -- cat abigenBindings/abi/${name}.abi | \
2022-08-26 09:35:22 -07:00
docker run --rm -i localhost/wormhole-foundation/wormhole-abigen:latest /bin/abigen --abi - --pkg ${pkg} > \
node/pkg/ethereum/${pkg}/abi.go
2020-11-28 13:11:48 -08:00
}
gen Wormhole abi
gen ERC20 erc20