Add stateTransition to test with

This commit is contained in:
Mason Fischer 2020-05-14 14:36:10 -04:00
parent 3bd9915d82
commit 48470e5f42

View file

@ -11,6 +11,8 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/core/vm"
@ -35,6 +37,26 @@ func init() {
} }
} }
func TestSetExecutionContext(t *testing.T) {
to := common.HexToAddress("999999999999999999999999999999999999 9999")
from := common.HexToAddress("8888888888888888888888888888888888888888")
state := newState()
evm := vm.NewEVM(vm.Context{}, state, &chainConfig, vm.Config{})
gasPool := core.GasPool(9999999)
message := types.NewMessage(
from,
&to,
0,
big.NewInt(0),
100000000,
big.NewInt(0),
common.FromHex(""),
true,
)
stateTransition := core.NewStateTransition(evm, &message, &gasPool)
stateTransition.TransitionDb()
}
func TestSloadAndStore(t *testing.T) { func TestSloadAndStore(t *testing.T) {
rawStateManagerAbi, _ := ioutil.ReadFile("./StateManagerABI.json") rawStateManagerAbi, _ := ioutil.ReadFile("./StateManagerABI.json")
stateManagerAbi, _ := abi.JSON(strings.NewReader(string(rawStateManagerAbi))) stateManagerAbi, _ := abi.JSON(strings.NewReader(string(rawStateManagerAbi)))