Skip to content

Commit ef32f2f

Browse files
restore name
1 parent 5a0ccbb commit ef32f2f

File tree

7 files changed

+333
-332
lines changed

7 files changed

+333
-332
lines changed

precompile/contracts/nativeminter/nativemintertest/compile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
package nativemintertest
55

66
// Step 1: Compile Solidity contracts to generate ABI and bin files
7-
//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. @openzeppelin/contracts/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinterTest.sol solidity/Minter.sol
7+
//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path ../../../.. @openzeppelin/contracts/=contracts/lib/openzeppelin-contracts/contracts/ precompile/=precompile/ --evm-version paris solidity/ERC20NativeMinter.sol solidity/Minter.sol
88
// Step 2: Generate Go bindings from the compiled artifacts
99
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type INativeMinter --abi artifacts/INativeMinter.abi --bin artifacts/INativeMinter.bin --out gen_inativeminter_binding.go
10-
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinterTest --abi artifacts/ERC20NativeMinterTest.abi --bin artifacts/ERC20NativeMinterTest.bin --out gen_erc20nativemintertest_binding.go
10+
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type ERC20NativeMinter --abi artifacts/ERC20NativeMinter.abi --bin artifacts/ERC20NativeMinter.bin --out gen_erc20nativeminter_binding.go
1111
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg nativemintertest --type Minter --abi artifacts/Minter.abi --bin artifacts/Minter.bin --out gen_minter_binding.go
1212
// Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm
13-
//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativemintertest_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativemintertest_binding.go.bak gen_minter_binding.go.bak"
13+
//go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_inativeminter_binding.go gen_erc20nativeminter_binding.go gen_minter_binding.go && rm -f gen_inativeminter_binding.go.bak gen_erc20nativeminter_binding.go.bak gen_minter_binding.go.bak"
Lines changed: 316 additions & 316 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

precompile/contracts/nativeminter/nativemintertest/gen_minter_binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

precompile/contracts/nativeminter/nativemintertest/simulated_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ func newBackendWithNativeMinter(t *testing.T) *sim.Backend {
6262

6363
// Helper functions to reduce test boilerplate
6464

65-
func deployERC20NativeMinterTest(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinterTest) {
65+
func deployERC20NativeMinter(t *testing.T, b *sim.Backend, auth *bind.TransactOpts, initSupply *big.Int) (common.Address, *ERC20NativeMinter) {
6666
t.Helper()
67-
addr, tx, contract, err := DeployERC20NativeMinterTest(auth, b.Client(), nativeminter.ContractAddress, initSupply)
67+
addr, tx, contract, err := DeployERC20NativeMinter(auth, b.Client(), nativeminter.ContractAddress, initSupply)
6868
require.NoError(t, err)
6969
testutils.WaitReceiptSuccessful(t, b, tx)
7070
return addr, contract
@@ -108,7 +108,7 @@ func TestNativeMinter(t *testing.T) {
108108
{
109109
name: "contract should not be able to mintdraw",
110110
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
111-
tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply)
111+
tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply)
112112

113113
verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole)
114114

@@ -120,7 +120,7 @@ func TestNativeMinter(t *testing.T) {
120120
{
121121
name: "should be added to minter list",
122122
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
123-
tokenAddr, _ := deployERC20NativeMinterTest(t, backend, admin, initSupply)
123+
tokenAddr, _ := deployERC20NativeMinter(t, backend, admin, initSupply)
124124

125125
verifyRole(t, nativeMinter, tokenAddr, allowlist.NoRole)
126126

@@ -132,7 +132,7 @@ func TestNativeMinter(t *testing.T) {
132132
{
133133
name: "admin should mintdraw",
134134
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
135-
tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply)
135+
tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply)
136136

137137
setAsEnabled(t, backend, nativeMinter, admin, tokenAddr)
138138

@@ -155,7 +155,7 @@ func TestNativeMinter(t *testing.T) {
155155
{
156156
name: "minter should not mintdraw without tokens",
157157
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
158-
tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply)
158+
tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply)
159159
minterAddr, minter := deployMinter(t, backend, admin, tokenAddr)
160160

161161
setAsEnabled(t, backend, nativeMinter, admin, tokenAddr)
@@ -173,7 +173,7 @@ func TestNativeMinter(t *testing.T) {
173173
{
174174
name: "should deposit for minter",
175175
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
176-
tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply)
176+
tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply)
177177
minterAddr, minter := deployMinter(t, backend, admin, tokenAddr)
178178

179179
setAsEnabled(t, backend, nativeMinter, admin, tokenAddr)
@@ -209,7 +209,7 @@ func TestNativeMinter(t *testing.T) {
209209
{
210210
name: "minter should mintdraw",
211211
test: func(t *testing.T, backend *sim.Backend, nativeMinter *INativeMinter) {
212-
tokenAddr, token := deployERC20NativeMinterTest(t, backend, admin, initSupply)
212+
tokenAddr, token := deployERC20NativeMinter(t, backend, admin, initSupply)
213213
minterAddr, minter := deployMinter(t, backend, admin, tokenAddr)
214214

215215
setAsEnabled(t, backend, nativeMinter, admin, tokenAddr)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "./INativeMinter.sol";
99
// Designated Blackhole Address
1010
address constant BLACKHOLE_ADDRESS = 0x0100000000000000000000000000000000000000;
1111

12-
contract ERC20NativeMinterTest is ERC20, Ownable, AllowList {
12+
contract ERC20NativeMinter is ERC20, Ownable, AllowList {
1313
string private constant TOKEN_NAME = "ERC20NativeMinterToken";
1414
string private constant TOKEN_SYMBOL = "XMPL";
1515

precompile/contracts/nativeminter/nativemintertest/solidity/Minter.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.24;
33

4-
import "./ERC20NativeMinterTest.sol";
4+
import "./ERC20NativeMinter.sol";
55

66
// Helper contract to test minting from another contract
77
contract Minter {
8-
ERC20NativeMinterTest token;
8+
ERC20NativeMinter token;
99

1010
constructor(address tokenAddress) {
11-
token = ERC20NativeMinterTest(tokenAddress);
11+
token = ERC20NativeMinter(tokenAddress);
1212
}
1313

1414
function mintdraw(uint amount) external {

precompile/contracts/testutils/simulated_helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/stretchr/testify/require"
1313

1414
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
15+
1516
sim "github.com/ava-labs/subnet-evm/ethclient/simulated"
1617
)
1718

0 commit comments

Comments
 (0)