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

[WIP] Use libevm instead of go-ethereum #777

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"io"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abi_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
"github.com/ava-labs/libevm/crypto"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
"github.com/ava-labs/coreth/accounts/external"
"github.com/ava-labs/coreth/accounts/keystore"
"github.com/ava-labs/coreth/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/log"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/ethclient/simulated"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

// Verify that SimulatedBackend implements required interfaces
var (
_ bind.AcceptedContractCaller = (*SimulatedBackend)(nil)

Check failure on line 41 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as bind.AcceptedContractCaller value in variable declaration: *SimulatedBackend does not implement bind.AcceptedContractCaller (missing method AcceptedCallContract) (typecheck)
_ bind.ContractBackend = (*SimulatedBackend)(nil)

Check failure on line 42 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as bind.ContractBackend value in variable declaration: *SimulatedBackend does not implement bind.ContractBackend (missing method AcceptedCodeAt) (typecheck)
_ bind.DeployBackend = (*SimulatedBackend)(nil)

Check failure on line 43 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as bind.DeployBackend value in variable declaration: *SimulatedBackend does not implement bind.DeployBackend (missing method CodeAt) (typecheck)

_ interfaces.ChainReader = (*SimulatedBackend)(nil)

Check failure on line 45 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.ChainReader value in variable declaration: *SimulatedBackend does not implement interfaces.ChainReader (missing method BlockByHash) (typecheck)
_ interfaces.ChainStateReader = (*SimulatedBackend)(nil)

Check failure on line 46 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.ChainStateReader value in variable declaration: *SimulatedBackend does not implement interfaces.ChainStateReader (missing method BalanceAt) (typecheck)
_ interfaces.TransactionReader = (*SimulatedBackend)(nil)

Check failure on line 47 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.TransactionReader value in variable declaration: *SimulatedBackend does not implement interfaces.TransactionReader (missing method TransactionByHash) (typecheck)
_ interfaces.TransactionSender = (*SimulatedBackend)(nil)

Check failure on line 48 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.TransactionSender value in variable declaration: *SimulatedBackend does not implement interfaces.TransactionSender (missing method SendTransaction) (typecheck)
_ interfaces.ContractCaller = (*SimulatedBackend)(nil)

Check failure on line 49 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.ContractCaller value in variable declaration: *SimulatedBackend does not implement interfaces.ContractCaller (missing method CallContract) (typecheck)
_ interfaces.GasEstimator = (*SimulatedBackend)(nil)

Check failure on line 50 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.GasEstimator value in variable declaration: *SimulatedBackend does not implement interfaces.GasEstimator (missing method EstimateGas) (typecheck)
_ interfaces.GasPricer = (*SimulatedBackend)(nil)

Check failure on line 51 in accounts/abi/bind/backends/simulated.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use (*SimulatedBackend)(nil) (value of type *SimulatedBackend) as interfaces.GasPricer value in variable declaration: *SimulatedBackend does not implement interfaces.GasPricer (missing method SuggestGasPrice) (typecheck)
_ interfaces.LogFilterer = (*SimulatedBackend)(nil)
_ interfaces.AcceptedStateReader = (*SimulatedBackend)(nil)
_ interfaces.AcceptedContractCaller = (*SimulatedBackend)(nil)
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import (
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/interfaces"
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/event"
)

const basefeeWiggleMultiplier = 2
Expand Down
8 changes: 4 additions & 4 deletions accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import (
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/hexutil"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/rlp"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"unicode"

"github.com/ava-labs/coreth/accounts/abi"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/log"
)

// Lang is a target programming language selector to generate bindings for.
Expand Down
74 changes: 37 additions & 37 deletions accounts/abi/bind/bind_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions accounts/abi/bind/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ import (
"github.com/ava-labs/coreth/accounts/abi/bind"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/event"
)

// Reference imports to suppress errors if they are not otherwise used.
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/bind/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/log"
)

// WaitMined waits for tx to be mined on the blockchain.
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/bind/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/ethclient/simulated"
"github.com/ava-labs/coreth/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"fmt"
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

type Error struct {
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"fmt"
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

// Event is an event potentially triggered by the EVM's LOG mechanism. The Event
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"fmt"
"strings"

"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/crypto"
)

// FunctionType represents different types of functions a contract might have.
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"math/big"
"reflect"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
)

// packBytesSlice packs the given bytes as [L, V] as the canonical representation
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/pack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

// TestPack tests the general pack/unpack tests in packing_test.go
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/packing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package abi
import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

type packUnpackTest struct {
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"math/big"
"reflect"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
"github.com/ava-labs/libevm/crypto"
)

// packTopic packs rule into the corresponding hash value for a log's topic
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/topics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"reflect"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

func TestMakeTopics(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"unicode"
"unicode/utf8"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

// Type enumerator
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"reflect"
"testing"

"github.com/ava-labs/libevm/common"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common"
)

// typeWithoutStringer is a alias for the Type type which simply doesn't implement
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"math/big"
"reflect"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/unpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/event"
"golang.org/x/crypto/sha3"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"bytes"
"testing"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ava-labs/libevm/common/hexutil"
)

func TestTextHash(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions accounts/external/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import (
"github.com/ava-labs/coreth/interfaces"
"github.com/ava-labs/coreth/rpc"
"github.com/ava-labs/coreth/signer/core/apitypes"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/hexutil"
"github.com/ava-labs/libevm/event"
"github.com/ava-labs/libevm/log"
)

type ExternalBackend struct {
Expand Down
4 changes: 2 additions & 2 deletions accounts/keystore/account_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import (
"time"

"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/log"
mapset "github.com/deckarep/golang-set/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"golang.org/x/exp/slices"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/account_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
"time"

"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/libevm/common"
"github.com/cespare/cp"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common"
"golang.org/x/exp/slices"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"sync"
"time"

"github.com/ava-labs/libevm/log"
mapset "github.com/deckarep/golang-set/v2"
"github.com/ethereum/go-ethereum/log"
)

// fileCache is a cache of files seen during scan of keystore.
Expand Down
4 changes: 2 additions & 2 deletions accounts/keystore/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"time"

"github.com/ava-labs/coreth/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/google/uuid"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ import (

"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/event"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
"time"

"github.com/ava-labs/coreth/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/event"
"golang.org/x/exp/slices"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/keystore/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import (
"path/filepath"

"github.com/ava-labs/coreth/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
"github.com/ava-labs/libevm/crypto"
"github.com/google/uuid"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/passphrase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"os"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
)

const (
Expand Down
Loading
Loading