diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-30 20:32:50 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-30 20:32:50 +0800 |
commit | df5603de0a34e80a1af6ad03e37ce43728baad35 (patch) | |
tree | 5d9a71ad887c243b781b1c2d6077336bed82057b /ethchain/transaction.go | |
parent | fa890c8c0140dac1e02038a6134db0d83bb85af9 (diff) | |
download | dexon-df5603de0a34e80a1af6ad03e37ce43728baad35.tar.gz dexon-df5603de0a34e80a1af6ad03e37ce43728baad35.tar.zst dexon-df5603de0a34e80a1af6ad03e37ce43728baad35.zip |
Moved logging to state, proper structured block
* Moved logs to state so it's subject to snapshotting
* Split up block header
* Removed logs from transactions and made them receipts only
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r-- | ethchain/transaction.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index 10bf5bc8e..331f44b55 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/ethcrypto" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" - "github.com/ethereum/go-ethereum/vm" "github.com/obscuren/secp256k1-go" ) @@ -29,8 +28,6 @@ type Transaction struct { v byte r, s []byte - logs []vm.Log - // Indicates whether this tx is a contract creation transaction contractCreation bool } @@ -57,10 +54,6 @@ func NewTransactionFromValue(val *ethutil.Value) *Transaction { return tx } -func (self *Transaction) addLog(log vm.Log) { - self.logs = append(self.logs, log) -} - func (self *Transaction) GasValue() *big.Int { return new(big.Int).Mul(self.Gas, self.GasPrice) } @@ -212,7 +205,7 @@ type Receipt struct { PostState []byte CumulativeGasUsed *big.Int Bloom []byte - Logs vm.Logs + logs ethstate.Logs } func NewRecieptFromValue(val *ethutil.Value) *Receipt { @@ -229,12 +222,12 @@ func (self *Receipt) RlpValueDecode(decoder *ethutil.Value) { it := decoder.Get(3).NewIterator() for it.Next() { - self.Logs = append(self.Logs, vm.NewLogFromValue(it.Value())) + self.logs = append(self.logs, ethstate.NewLogFromValue(it.Value())) } } func (self *Receipt) RlpData() interface{} { - return []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.Logs.RlpData()} + return []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.logs.RlpData()} } func (self *Receipt) RlpEncode() []byte { |