Skip to content

Commit 5bd8dd5

Browse files
Restructure Precompile Test Packages and Folders (#1878)
2 parents e33233f + 83fa482 commit 5bd8dd5

19 files changed

+92
-89
lines changed

precompile/allowlist/allowlisttest/allowlist_test.go renamed to precompile/allowlist/allowlist_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

4-
package allowlisttest
4+
package allowlist_test
55

66
import (
77
"testing"
88

99
"github.com/ava-labs/libevm/common"
1010

1111
"github.com/ava-labs/subnet-evm/precompile/allowlist"
12+
"github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest"
1213
"github.com/ava-labs/subnet-evm/precompile/contract"
1314
"github.com/ava-labs/subnet-evm/precompile/modules"
1415
"github.com/ava-labs/subnet-evm/precompile/precompileconfig"
@@ -63,5 +64,5 @@ func TestAllowListRun(t *testing.T) {
6364
Configurator: &dummyConfigurator{},
6465
ConfigKey: "dummy",
6566
}
66-
RunPrecompileWithAllowListTests(t, dummyModule, nil)
67+
allowlisttest.RunPrecompileWithAllowListTests(t, dummyModule, nil)
6768
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

4-
package allowlisttest
4+
package bindings
55

66
// Step 1: Compile Solidity contracts to generate ABI and bin files
77
//go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --base-path . precompile/=../../ --evm-version paris AllowListTest.sol
88
// Step 2: Generate Go bindings from the compiled artifacts
9-
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go
10-
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg allowlisttest --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go
9+
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type IAllowList --abi artifacts/IAllowList.abi --bin artifacts/IAllowList.bin --out gen_allowlist_binding.go
10+
//go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg bindings --type AllowListTest --abi artifacts/AllowListTest.abi --bin artifacts/AllowListTest.bin --out gen_allowlisttest_binding.go
1111
// Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm
1212
//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_allowlist_binding.go gen_allowlisttest_binding.go && rm -f gen_allowlist_binding.go.bak gen_allowlisttest_binding.go.bak"

precompile/allowlist/allowlisttest/gen_allowlist_binding.go renamed to precompile/allowlist/allowlisttest/bindings/gen_allowlist_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/allowlist/allowlisttest/gen_allowlisttest_binding.go renamed to precompile/allowlist/allowlisttest/bindings/gen_allowlisttest_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/allowlist/allowlisttest/config_test.go renamed to precompile/allowlist/config_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

4-
package allowlisttest
4+
package allowlist_test
55

66
import (
77
"testing"
88

99
"github.com/ava-labs/subnet-evm/precompile/allowlist"
10+
"github.com/ava-labs/subnet-evm/precompile/allowlist/allowlisttest"
1011
"github.com/ava-labs/subnet-evm/precompile/modules"
1112
)
1213

@@ -18,9 +19,9 @@ var testModule = modules.Module{
1819
}
1920

2021
func TestVerifyAllowlist(t *testing.T) {
21-
RunPrecompileWithAllowListTests(t, testModule, nil)
22+
allowlisttest.RunPrecompileWithAllowListTests(t, testModule, nil)
2223
}
2324

2425
func TestEqualAllowList(t *testing.T) {
25-
EqualPrecompileWithAllowListTests(t, testModule, nil)
26+
allowlisttest.EqualPrecompileWithAllowListTests(t, testModule, nil)
2627
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

4-
package deployerallowlisttest
4+
package deployerallowlist_test
55

66
import (
77
"testing"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

4-
package deployerallowlisttest
4+
package deployerallowlist_test
55

66
import (
77
"testing"

0 commit comments

Comments
 (0)