diff options
author | Determinant <[email protected]> | 2020-06-28 14:47:41 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-06-28 14:47:41 -0400 |
commit | d235e2c6a5788ec4a6cff15a16f56b38a3876a0d (patch) | |
tree | 5f2727f7a50ee5840f889c82776d3a30a88dd59b /core/state_transition.go | |
parent | 13ebd8bd9468e9d769d598b0ca2afb72ba78cb97 (diff) |
...
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 13 |
1 files changed, 10 insertions, 3 deletions
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) |