Refactored state transitioning to its own model

This commit is contained in:
obscuren
2014-06-13 12:57:52 +02:00
parent d078e9b8c9
commit 5e2bf12a31
2 changed files with 13 additions and 200 deletions

View File

@ -7,6 +7,17 @@ import (
"math/big"
)
func (sm *StateManager) MakeStateObject(state *State, tx *Transaction) *StateObject {
contract := MakeContract(tx, state)
if contract != nil {
state.states[string(tx.CreationAddress())] = contract.state
return contract
}
return nil
}
func (sm *StateManager) EvalScript(state *State, script []byte, object *StateObject, tx *Transaction, block *Block) (ret []byte, gas *big.Int, err error) {
account := state.GetAccount(tx.Sender())