wormhole/generate-abi.sh

23 lines
575 B
Bash
Raw 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
docker build -t localhost/certusone/wormhole-abigen:latest .
)
2020-11-28 13:11:48 -08:00
function gen() {
local name=$1
local pkg=$2
2020-08-17 14:01:59 -07:00
2020-11-28 13:11:48 -08:00
kubectl exec -c tests eth-devnet-0 -- npx truffle run abigen $name
kubectl exec -c tests eth-devnet-0 -- cat abigenBindings/abi/${name}.abi | \
docker run --rm -i localhost/certusone/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