-
Notifications
You must be signed in to change notification settings - Fork 278
feat: convert native minter npm test to go test #1872
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
base: master
Are you sure you want to change the base?
feat: convert native minter npm test to go test #1872
Conversation
a93e2b6 to
b7eec85
Compare
4131d69 to
ef32f2f
Compare
| @@ -0,0 +1,13 @@ | |||
| // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | |||
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.
This whole package seems like a mess. Is the correct structure? It's not like the deployerallowlist package, because the minter is not tested seperately like allowlist is.
| @@ -1,7 +1,7 @@ | |||
| // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | |||
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.
I moved these in to match what you did for the deployerallowlist. I think all of these folders need to be cleaned up / reorganized, but I would appreciate your guidance @ceyonur
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: |
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.
I would like a way to avoid this, but we regenerate the bindings in the lint step to ensure that they didn't change.
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.
Some of them need the open zeppelin submodule
| @@ -0,0 +1,42 @@ | |||
| // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | |||
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.
We can share some of these generic functions.
| test func(t *testing.T, backend *sim.Backend, nativeMinterIntf *INativeMinter) | ||
| } | ||
|
|
||
| testCases := []testCase{ |
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.
all of these tests are 1:1 copies of the tests in https://github.com/ava-labs/subnet-evm/blob/c65752b631b07206d506111cd52e5d686a9f02b0/contracts/contracts/test/ERC20NativeMinterTest.sol
Why this should be merged
Replaces native minter e2e hardhat tests with golang bindings and a simulated backend test.
Part of #1228
How this works
Generates relevant golang bindings from sol files for the testing. Mirrors the hardhat test to a golang test using simulated backend.
How this was tested
CI
Need to be documented?
No
Need to update RELEASES.md?
No