diff options
author | obscuren <geffobscura@gmail.com> | 2014-11-18 23:58:22 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-11-18 23:58:22 +0800 |
commit | a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b (patch) | |
tree | aee891c8f02591e16377a6bf047c13f12d6d5123 /chain/state_transition.go | |
parent | 62cd9946ee16758a4e368cd0b5a0ba9fa4d94705 (diff) | |
download | go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.gz go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.bz2 go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.lz go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.xz go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.zst go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.zip |
Begin of moving objects to types package
* Block(s)
* Transaction(s)
Diffstat (limited to 'chain/state_transition.go')
-rw-r--r-- | chain/state_transition.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chain/state_transition.go b/chain/state_transition.go index afe044299..789698675 100644 --- a/chain/state_transition.go +++ b/chain/state_transition.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/chain/types" "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/vm" ) @@ -26,17 +27,17 @@ import ( */ type StateTransition struct { coinbase, receiver []byte - tx *Transaction + tx *types.Transaction gas, gasPrice *big.Int value *big.Int data []byte state *state.State - block *Block + block *types.Block cb, rec, sen *state.StateObject } -func NewStateTransition(coinbase *state.StateObject, tx *Transaction, state *state.State, block *Block) *StateTransition { +func NewStateTransition(coinbase *state.StateObject, tx *types.Transaction, state *state.State, block *types.Block) *StateTransition { return &StateTransition{coinbase.Address(), tx.Recipient, tx, new(big.Int), new(big.Int).Set(tx.GasPrice), tx.Value, tx.Data, state, block, coinbase, nil, nil} } @@ -203,7 +204,7 @@ func (self *StateTransition) TransitionState() (err error) { }) // Process the init code and create 'valid' contract - if IsContractAddr(self.receiver) { + if types.IsContractAddr(self.receiver) { // Evaluate the initialization script // and use the return value as the // script section for the state object. @@ -280,7 +281,7 @@ func (self *StateTransition) Eval(msg *state.Message, script []byte, context *st } // Converts an transaction in to a state object -func MakeContract(tx *Transaction, state *state.State) *state.StateObject { +func MakeContract(tx *types.Transaction, state *state.State) *state.StateObject { addr := tx.CreationAddress(state) contract := state.GetOrNewStateObject(addr) |