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 d49d52e commit 0f8d8e3
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 @@ -37,7 +37,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 @@ -53,7 +58,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 @@ -64,7 +69,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; \
go build ./... || exit 1; \
echo "Done."
Expand Down

0 comments on commit 0f8d8e3

Please sign in to comment.