Skip to content
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

Create TeleporterMessenger ABI Go binding #41

Merged
merged 29 commits into from
Oct 4, 2023
Merged

Create TeleporterMessenger ABI Go binding #41

merged 29 commits into from
Oct 4, 2023

Conversation

gwen917
Copy link
Contributor

@gwen917 gwen917 commented Sep 26, 2023

Why this should be merged

  • Generate TeleporterMessenger ABI Go bindings.
    • ./scripts/abi_go_bindings.sh
    • The script build the contracts to generate ABI files, and then generate TeleporterMessenger ABI Go bindings using abigen.
  • The abi_go_bindings_checker github action checks if the generated Go bindings are from the latest contracts

How this was tested

  • CI

@gwen917 gwen917 linked an issue Sep 26, 2023 that may be closed by this pull request
@gwen917 gwen917 marked this pull request as ready for review September 26, 2023 22:06
@geoff-vball
Copy link
Contributor

Can we make abi_go_bindings.sh generic, so it takes in a file with a list of .abi.json files, (and maybe also the desired package name), and then iterates and produces the .go abi files for all of them?

@gwen917
Copy link
Contributor Author

gwen917 commented Sep 29, 2023

Can we make abi_go_bindings.sh generic, so it takes in a file with a list of .abi.json files, (and maybe also the desired package name), and then iterates and produces the .go abi files for all of them?

I want to build the contract first, then use the generated files in the out dir. In this way, if the contract is changed, we just need one step to generate the go files instead of build and then run the script. What if we give a list of contract name, then generate the go files of these contracts?

@geoff-vball
Copy link
Contributor

Yeah, that'll work!

abis/TeleporterMessenger/TeleporterMessenger.abi.json Outdated Show resolved Hide resolved
.github/workflows/check_clean_branch.sh Outdated Show resolved Hide resolved
.github/workflows/check_clean_branch.sh Outdated Show resolved Hide resolved
.github/workflows/abi_go_bindings_checker.yml Outdated Show resolved Hide resolved
Comment on lines 4 to 6
push:
branches:
- main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may only want to do this on pull requests, since the CI job works by (potentially) modifying the branch. I'm sure it's highly unlikely to cause issues, but I'd prefer if we didn't do that on main in any automated fashion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that every workflow should be run in it's own environment. I don't think this test is really only important in PRs though, so I'm fine with this either way.

.github/workflows/abi_go_bindings_checker.yml Outdated Show resolved Hide resolved
cd .. && pwd
)

DEFAULT_CONTRACT_LIST="TeleporterMessenger"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the cross-chain apps to this list, and add the resulting Go bindings to this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the cross-chain apps. Could you check if I missed anything?

on:
pull_request:
branches:
- "*"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need need to add on push to main?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on Cam's comments, we may not want to run this on main in automated fashion

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment here. Otherwise everything looks great.

scripts/abi_go_bindings.sh Outdated Show resolved Hide resolved
Comment on lines 4 to 6
push:
branches:
- main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that every workflow should be run in it's own environment. I don't think this test is really only important in PRs though, so I'm fine with this either way.

geoff-vball
geoff-vball previously approved these changes Oct 4, 2023
Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's include bindings for BridgeToken.sol. Otherwise LGTM

scripts/abi_go_bindings.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gwen917 gwen917 merged commit 8e8f16b into main Oct 4, 2023
10 of 11 checks passed
@gwen917 gwen917 deleted the abi-go-binding branch October 4, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TeleporterMessenger Go binding
4 participants