Merge tag 'v1.10.5' into plugeth

This commit is contained in:
Austin Roberts
2021-07-14 08:46:10 -05:00
97 changed files with 2055 additions and 791 deletions
-12
View File
@@ -18,7 +18,6 @@ package tests
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
@@ -34,17 +33,6 @@ import (
"github.com/ethereum/go-ethereum/params"
)
// Command line flags to configure the interpreters.
var (
testEVM = flag.String("vm.evm", "", "EVM configuration")
testEWASM = flag.String("vm.ewasm", "", "EWASM configuration")
)
func TestMain(m *testing.M) {
flag.Parse()
os.Exit(m.Run())
}
var (
baseDir = filepath.Join(".", "testdata")
blockTestDir = filepath.Join(baseDir, "BlockchainTests")
+5 -3
View File
@@ -74,8 +74,10 @@ func TestState(t *testing.T) {
t.Run(key+"/snap", func(t *testing.T) {
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
snaps, statedb, err := test.Run(subtest, vmconfig, true)
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
return err
if snaps != nil && statedb != nil {
if _, err := snaps.Journal(statedb.IntermediateRoot(false)); err != nil {
return err
}
}
return st.checkFailure(t, err)
})
@@ -90,7 +92,7 @@ const traceErrorLimit = 400000
func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) {
// Use config from command line arguments.
config := vm.Config{EVMInterpreter: *testEVM, EWASMInterpreter: *testEWASM}
config := vm.Config{}
err := test(config)
if err == nil {
return
+3
View File
@@ -328,6 +328,9 @@ func (tx *stTransaction) toMessage(ps stPostState, baseFee *big.Int) (core.Messa
gasPrice = math.BigMin(new(big.Int).Add(tx.MaxPriorityFeePerGas, baseFee),
tx.MaxFeePerGas)
}
if gasPrice == nil {
return nil, fmt.Errorf("no gas price provided")
}
msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, gasPrice,
tx.MaxFeePerGas, tx.MaxPriorityFeePerGas, data, accessList, true)