Files
atomic-swap/ethereum/block/testdata/generate-bindings.sh
Janaka-Steph d13521daef Modify scripts to run on MacOS (#233)
Updates scripts/docs to support macOS as well as Linux/aarch64 (arm64)
2023-01-16 14:05:35 -06:00

21 lines
697 B
Bash
Executable File

#!/usr/bin/env bash
# Generate the UTContract.sol Go bindings into a file named ut_contract_test.go of the
# parent directory for use by unit tests.
# Use the contract's directory (where this script is) as the current working directory:
cd "$(dirname "$(realpath "$0")")"
ABIGEN="$(go env GOPATH)/bin/abigen"
if [[ -z "${SOLC_BIN}" ]]; then
SOLC_BIN=solc
fi
"${SOLC_BIN}" --abi UTContract.sol -o . --overwrite
"${SOLC_BIN}" --bin UTContract.sol -o . --overwrite
# Use abigen 1.10.17-stable to match how we compile the SwapFactory contract
"${ABIGEN}" --abi UTContract.abi --bin UTContract.bin --pkg block --type UTContract --out ../ut_contract_test.go
rm -f UTContract.abi UTContract.bin