diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-01 04:02:59 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-01 04:02:59 +0800 |
commit | 616066a598933df7ef126186eb9c647094f665ca (patch) | |
tree | 23840481607b40cb2840b60f4d07e12598e6376f /vm/environment.go | |
parent | 1bce02eff70db43b98d68fcd094fd2e15745b021 (diff) | |
download | go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar.gz go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar.bz2 go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar.lz go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar.xz go-tangerine-616066a598933df7ef126186eb9c647094f665ca.tar.zst go-tangerine-616066a598933df7ef126186eb9c647094f665ca.zip |
rework vm
Diffstat (limited to 'vm/environment.go')
-rw-r--r-- | vm/environment.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vm/environment.go b/vm/environment.go index 5604989e1..bf773b5d6 100644 --- a/vm/environment.go +++ b/vm/environment.go @@ -5,11 +5,10 @@ import ( "math/big" "github.com/ethereum/go-ethereum/ethutil" - "github.com/ethereum/go-ethereum/state" ) type Environment interface { - State() *state.State + //State() *state.State Origin() []byte BlockNumber() *big.Int @@ -19,8 +18,16 @@ type Environment interface { Difficulty() *big.Int BlockHash() []byte GasLimit() *big.Int + Transfer(from, to Account, amount *big.Int) error - AddLog(*state.Log) + AddLog(addr []byte, topics [][]byte, data []byte) + DeleteAccount(addr []byte) + SetState(addr, key, value []byte) + GetState(addr, key []byte) []byte + Balance(addr []byte) *big.Int + AddBalance(addr []byte, balance *big.Int) + GetCode(addr []byte) []byte + Refund(addr []byte, gas, price *big.Int) } 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 } |