From d235e2c6a5788ec4a6cff15a16f56b38a3876a0d Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 28 Jun 2020 14:47:41 -0400 Subject: ... --- core/state_transition.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'core/state_transition.go') diff --git a/core/state_transition.go b/core/state_transition.go index f648bce..139289f 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -21,10 +21,10 @@ import ( "math" "math/big" + "github.com/ava-labs/coreth/core/vm" + "github.com/ava-labs/coreth/params" "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/core/vm" "github.com/ava-labs/go-ethereum/log" - "github.com/ava-labs/go-ethereum/params" ) var ( @@ -55,6 +55,8 @@ type StateTransition struct { gasPrice *big.Int initialGas uint64 value *big.Int + coinID *common.Hash + value2 *big.Int data []byte state vm.StateDB evm *vm.EVM @@ -69,6 +71,8 @@ type Message interface { GasPrice() *big.Int Gas() uint64 Value() *big.Int + CoinID() *common.Hash + Value2() *big.Int Nonce() uint64 CheckNonce() bool @@ -120,6 +124,8 @@ func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition msg: msg, gasPrice: msg.GasPrice(), value: msg.Value(), + coinID: msg.CoinID(), + value2: msg.Value2(), data: msg.Data(), state: evm.StateDB, } @@ -213,9 +219,10 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo if contractCreation { ret, _, st.gas, vmerr = evm.Create(sender, st.data, st.gas, st.value) } else { + log.Debug("here2") // Increment the nonce for the next transaction st.state.SetNonce(msg.From(), st.state.GetNonce(sender.Address())+1) - ret, st.gas, vmerr = evm.Call(sender, st.to(), st.data, st.gas, st.value) + ret, st.gas, vmerr = evm.CallExpert(sender, st.to(), st.data, st.gas, st.value, st.coinID, st.value2) } if vmerr != nil { log.Debug("VM returned with error", "err", vmerr) -- cgit v1.2.3-70-g09d2