diff options
author | obscuren <geffobscura@gmail.com> | 2014-03-21 07:04:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-03-21 07:04:31 +0800 |
commit | 9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8 (patch) | |
tree | 4816383a97b754199430184e6b245e51ea529bd7 /ethchain/state_manager.go | |
parent | f567f89b994bf28f908410223084a6702d05d156 (diff) | |
download | dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar.gz dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar.bz2 dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar.lz dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar.xz dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.tar.zst dexon-9cf8ce9ef82bfb37fea92bbea6a8d326af00adc8.zip |
New tx methods and added new vm to state manager
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r-- | ethchain/state_manager.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index 14686b217..50c777349 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -305,19 +305,17 @@ func (sm *StateManager) ProcessContract(contract *Contract, tx *Transaction, blo } }() */ - - /*TODO to be fixed and replaced by the new vm - vm := &Vm{} - vm.Process(contract, sm.procState, RuntimeVars{ - address: tx.Hash()[12:], + caller := sm.procState.GetAccount(tx.Sender()) + closure := NewClosure(caller, contract, sm.procState, tx.Gas, tx.Value) + vm := NewVm(sm.procState, RuntimeVars{ + origin: caller.Address, blockNumber: block.BlockInfo().Number, - sender: tx.Sender(), prevHash: block.PrevHash, coinbase: block.Coinbase, time: block.Time, diff: block.Difficulty, - txValue: tx.Value, - txData: tx.Data, + // XXX Tx data? Could be just an argument to the closure instead + txData: nil, }) - */ + closure.Call(vm, nil) } |