Skip to content

Commit

Permalink
use libevm: params, core/vm, eth/tracers/* + some of core/types (#1380)
Browse files Browse the repository at this point in the history
* format: as coreth

* use libevm: params, core/vm, eth/tracers/* + some of core/types (#662)

Co-authored-by: Arran Schlosberg <[email protected]>

* format: as subnet-evm

* fix coreth formatting

* fix mocks

* fix contract deployer allowlist

* nits

* nits

* nit

* fix test import loop

* fix imports

* nits

* fix

* add TODO

---------

Co-authored-by: Arran Schlosberg <[email protected]>
  • Loading branch information
darioush and ARR4N authored Dec 12, 2024
1 parent b5836b0 commit 8e744a9
Show file tree
Hide file tree
Showing 339 changed files with 1,754 additions and 39,818 deletions.
6 changes: 3 additions & 3 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import (
"io"
"math/big"

"github.com/ava-labs/subnet-evm/accounts"
"github.com/ava-labs/subnet-evm/accounts/external"
"github.com/ava-labs/subnet-evm/accounts/keystore"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
Expand Down
5 changes: 5 additions & 0 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,11 @@ func golangBindings(t *testing.T, overload bool) {
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ethereum/[email protected]", "-replace", "github.com/ethereum/go-ethereum=github.com/ava-labs/[email protected]")
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
Expand Down
9 changes: 7 additions & 2 deletions accounts/abi/bind/precompilebind/precompile_bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ var bindTests = []struct {
`"github.com/stretchr/testify/require"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/extstate"
"github.com/ava-labs/subnet-evm/precompile/allowlist"
`,
`
Expand All @@ -466,7 +466,7 @@ var bindTests = []struct {
require.Equal(t, testGreeting, unpackedGreeting)
// test that the allow list is generated correctly
stateDB := state.NewTestStateDB(t)
stateDB := extstate.NewTestStateDB(t)
address := common.BigToAddress(big.NewInt(1))
SetHelloWorldAllowListStatus(stateDB, address, allowlist.EnabledRole)
role := GetHelloWorldAllowListStatus(stateDB, address)
Expand Down Expand Up @@ -695,6 +695,11 @@ func TestPrecompileBind(t *testing.T) {
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ethereum/[email protected]", "-replace", "github.com/ethereum/go-ethereum=github.com/ava-labs/[email protected]")
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"testing"
"math/big"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/extstate"
{{- if .Contract.AllowList}}
"github.com/ava-labs/subnet-evm/precompile/allowlist"
{{- end}}
Expand Down Expand Up @@ -187,12 +187,12 @@ func Test{{.Contract.Type}}Run(t *testing.T) {
// and runs them all together.
// Even if you don't add any custom tests, keep this. This will still
// run the default allowlist tests.
allowlist.RunPrecompileWithAllowListTests(t, Module, state.NewTestStateDB, tests)
allowlist.RunPrecompileWithAllowListTests(t, Module, extstate.NewTestStateDB, tests)
{{- else}}
// Run tests.
for name, test := range tests {
t.Run(name, func(t *testing.T) {
test.Run(t, Module, state.NewTestStateDB(t))
test.Run(t, Module, extstate.NewTestStateDB(t))
})
}
{{- end}}
Expand Down Expand Up @@ -247,12 +247,12 @@ func Benchmark{{.Contract.Type}}(b *testing.B) {
// and benchmarks them all together.
// Even if you don't add any custom tests, keep this. This will still
// run the default allowlist tests.
allowlist.BenchPrecompileWithAllowList(b, Module, state.NewTestStateDB, tests)
allowlist.BenchPrecompileWithAllowList(b, Module, extstate.NewTestStateDB, tests)
{{- else}}
// Benchmark tests.
for name, test := range tests {
b.Run(name, func(b *testing.B) {
test.Bench(b, Module, state.NewTestStateDB(b))
test.Bench(b, Module, extstate.NewTestStateDB(b))
})
}
{{- end}}
Expand Down
236 changes: 0 additions & 236 deletions accounts/accounts.go

This file was deleted.

43 changes: 0 additions & 43 deletions accounts/accounts_test.go

This file was deleted.

Loading

0 comments on commit 8e744a9

Please sign in to comment.