aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-17 06:10:26 +0800
committerobscuren <geffobscura@gmail.com>2015-03-17 06:10:26 +0800
commit843db4978e876674ca111706880a58c84202880d (patch)
tree6d565f14ae8ed2524c73e478e301891c4d86436e /vm
parent4e181c5764b78193705f91d3220710bb63b8962f (diff)
downloaddexon-843db4978e876674ca111706880a58c84202880d.tar
dexon-843db4978e876674ca111706880a58c84202880d.tar.gz
dexon-843db4978e876674ca111706880a58c84202880d.tar.bz2
dexon-843db4978e876674ca111706880a58c84202880d.tar.lz
dexon-843db4978e876674ca111706880a58c84202880d.tar.xz
dexon-843db4978e876674ca111706880a58c84202880d.tar.zst
dexon-843db4978e876674ca111706880a58c84202880d.zip
updated blockpool
Diffstat (limited to 'vm')
-rw-r--r--vm/environment.go12
-rw-r--r--vm/vm.go4
2 files changed, 12 insertions, 4 deletions
diff --git a/vm/environment.go b/vm/environment.go
index a53411b23..9de2fd80a 100644
--- a/vm/environment.go
+++ b/vm/environment.go
@@ -3,9 +3,11 @@ package vm
import (
"errors"
"fmt"
+ "io"
"math/big"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/state"
)
@@ -54,7 +56,7 @@ func Transfer(from, to Account, amount *big.Int) error {
type Log struct {
address common.Address
- topics [][]byte
+ topics []common.Hash
data []byte
log uint64
}
@@ -63,7 +65,7 @@ func (self *Log) Address() common.Address {
return self.address
}
-func (self *Log) Topics() [][]byte {
+func (self *Log) Topics() []common.Hash {
return self.topics
}
@@ -75,9 +77,15 @@ func (self *Log) Number() uint64 {
return self.log
}
+func (self *Log) EncodeRLP(w io.Writer) error {
+ return rlp.Encode(w, []interface{}{self.address, self.topics, self.data})
+}
+
+/*
func (self *Log) RlpData() interface{} {
return []interface{}{self.address, common.ByteSliceToInterface(self.topics), self.data}
}
+*/
func (self *Log) String() string {
return fmt.Sprintf("[A=%x T=%x D=%x]", self.address, self.topics, self.data)
diff --git a/vm/vm.go b/vm/vm.go
index 4ef888e36..796a55ad3 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -560,10 +560,10 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
self.Printf(" => [%d]", n)
case LOG0, LOG1, LOG2, LOG3, LOG4:
n := int(op - LOG0)
- topics := make([][]byte, n)
+ topics := make([]common.Hash, n)
mStart, mSize := stack.pop(), stack.pop()
for i := 0; i < n; i++ {
- topics[i] = common.LeftPadBytes(stack.pop().Bytes(), 32)
+ topics[i] = common.BigToHash(stack.pop()) //common.LeftPadBytes(stack.pop().Bytes(), 32)
}
data := mem.Get(mStart.Int64(), mSize.Int64())