mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Add stateTransition to test with
This commit is contained in:
parent
3bd9915d82
commit
48470e5f42
1 changed files with 22 additions and 0 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue