From 48470e5f42502084a186b80728efdbdd5a75b9ac Mon Sep 17 00:00:00 2001 From: Mason Fischer Date: Thu, 14 May 2020 14:36:10 -0400 Subject: [PATCH] Add stateTransition to test with --- tests/ovm_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/ovm_test.go b/tests/ovm_test.go index 19ed65876a..da69a140ba 100644 --- a/tests/ovm_test.go +++ b/tests/ovm_test.go @@ -11,6 +11,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "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/state" "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) { rawStateManagerAbi, _ := ioutil.ReadFile("./StateManagerABI.json") stateManagerAbi, _ := abi.JSON(strings.NewReader(string(rawStateManagerAbi)))