Explorar o código

bridge: add erc20 abi for use in tests

Leo %!s(int64=5) %!d(string=hai) anos
pai
achega
30278397f7
Modificáronse 3 ficheiros con 43 adicións e 5 borrados
  1. 29 0
      bridge/pkg/ethereum/erc20/abi.go
  2. 13 4
      generate-abi.sh
  3. 1 1
      third_party/abigen/Dockerfile

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 29 - 0
bridge/pkg/ethereum/erc20/abi.go


+ 13 - 4
generate-abi.sh

@@ -1,13 +1,22 @@
 #!/bin/bash
 # Regenerate bridge/pkg/ethereum/abi using a running eth-devnet's state.
+set -euo pipefail
 
 (
   cd third_party/abigen
   docker build -t localhost/certusone/wormhole-abigen:latest .
 )
 
-kubectl exec -c tests eth-devnet-0 -- npx truffle run abigen Wormhole
+function gen() {
+  local name=$1
+  local pkg=$2
 
-kubectl exec -c tests eth-devnet-0 -- cat abigenBindings/abi/Wormhole.abi | \
-  docker run --rm -i localhost/certusone/wormhole-abigen:latest /bin/abigen --abi - --pkg abi > \
-  bridge/pkg/ethereum/abi/abi.go
+  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} > \
+    bridge/pkg/ethereum/${pkg}/abi.go
+}
+
+gen Wormhole abi
+gen ERC20 erc20

+ 1 - 1
third_party/abigen/Dockerfile

@@ -1,4 +1,4 @@
-FROM golang:1.15.3-alpine
+FROM golang:1.15.5-alpine
 
 RUN apk add curl git gcc libc-dev linux-headers
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio