diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-04 00:06:54 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-04 00:06:54 +0800 |
commit | 99853ac3ce57807deb4822dd324186e1d2ee0821 (patch) | |
tree | 4c7dc0c8fa1f83d1081f429fa3175b03c9011101 /vm/environment.go | |
parent | 82405501872385b240012070bad2f0eda643d423 (diff) | |
download | go-tangerine-99853ac3ce57807deb4822dd324186e1d2ee0821.tar.gz go-tangerine-99853ac3ce57807deb4822dd324186e1d2ee0821.tar.zst go-tangerine-99853ac3ce57807deb4822dd324186e1d2ee0821.zip |
Moved execution from vm to chain.
This moves call and create to the specified environments. Vms are no
longer re-used. Vm uses environment's Call(Code) and Create in order to
execute new contracts or transfer value between accounts.
State transition now uses the same mechanism described above.
Diffstat (limited to 'vm/environment.go')
-rw-r--r-- | vm/environment.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vm/environment.go b/vm/environment.go index 5604989e1..3d75d05b9 100644 --- a/vm/environment.go +++ b/vm/environment.go @@ -21,6 +21,13 @@ type Environment interface { GasLimit() *big.Int Transfer(from, to Account, amount *big.Int) error AddLog(*state.Log) + + Depth() int + SetDepth(i int) + + Call(me ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) + CallCode(me ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) + Create(me ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error, ClosureRef) } type Object interface { @@ -43,9 +50,5 @@ func Transfer(from, to Account, amount *big.Int) error { from.SubBalance(amount) to.AddBalance(amount) - // Add default LOG. Default = big(sender.addr) + 1 - //addr := ethutil.BigD(receiver.Address()) - //tx.addLog(vm.Log{sender.Address(), [][]byte{ethutil.U256(addr.Add(addr, ethutil.Big1)).Bytes()}, nil}) - return nil } |