Skip to content

Commit

Permalink
modify go bindings generation to fail if abi gen isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
RnkSngh committed Dec 9, 2024
1 parent 0ad85c2 commit ea44446
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ CONTRACT_JSON_FILES = $(filter-out $(CONTRACT_ABI_FILES),$(CONTRACT_BOTH_FILES))

.PHONY: build-contracts bindings-gen-go bindings-gen-ts

build-contracts:
version-check:
forge --version; \
abigen --version; \
go version;

build-contracts: version-check
echo "Building contracts"; \
rm -frd ./out; \
forge install; \
Expand All @@ -54,7 +59,7 @@ build-contracts:
# as they are not publicly exposed, but rather used within the contract itself.
#
# ABIGen issue ref: https://github.com/ethereum/solidity/issues/9278
bindings-gen-go: build-contracts
bindings-gen-go: build-contracts
echo "Generating Go vIBC bindings..."; \
rm -rfd ./bindings/go/* ; \
for abi_file in $(CONTRACT_ABI_FILES); do \
Expand All @@ -65,7 +70,7 @@ bindings-gen-go: build-contracts
type=$$(basename $$abi_file .abi.json); \
pkg=$$(basename $$type .sol | tr "[:upper:]" "[:lower:]"); \
mkdir -p ./bindings/go/$$pkg; \
abigen --abi $$abi_file --pkg $$pkg --type $$type --out ./bindings/go/$$pkg/$$type.go; \
abigen --abi $$abi_file --pkg $$pkg --type $$type --out ./bindings/go/$$pkg/$$type.go || exit 1; \
done; \
echo Running sanity check on go bindings ; \
go build ./... || exit 1; \
Expand Down

0 comments on commit ea44446

Please sign in to comment.