-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generate go bindings in one package per contract/library #270
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,10 +62,11 @@ bindings-gen-go: build-contracts | |
continue; \ | ||
fi; \ | ||
type=$$(basename $$abi_file .abi.json); \ | ||
pkg=$$(basename $$abi_base .sol | tr "[:upper:]" "[:lower:]"); \ | ||
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; \ | ||
done; \ | ||
go build ./... || exit 1; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: you need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit2: maybe add a message saying "running check sanity on bindings" or similar? |
||
echo "Done." | ||
|
||
bindings-gen-ts: build-contracts | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct package name derivation
In the
bindings-gen-go
target, the package name is derived using a transformation that may not handle all cases correctly.Update the package name derivation to handle contract names with uppercase letters correctly.
Apply this diff to fix the issue:
This change converts CamelCase names to snake_case, which is more appropriate for Go package names.
📝 Committable suggestion