aboutsummaryrefslogtreecommitdiffstats
path: root/state/log.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-11 19:16:36 +0800
committerobscuren <geffobscura@gmail.com>2014-11-11 19:16:36 +0800
commit75ee3b3f089e703b728bb301cc6b2abe4c111c41 (patch)
tree9087d865e296cbb93c590fe15cd9942353b70058 /state/log.go
parent9509322ecd8e709ce8a17442836b6ff15ba2edff (diff)
downloaddexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.tar.gz
dexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.tar.zst
dexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.zip
debugging code
Diffstat (limited to 'state/log.go')
-rw-r--r--state/log.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/state/log.go b/state/log.go
index 73039d7ce..e61a4186e 100644
--- a/state/log.go
+++ b/state/log.go
@@ -1,6 +1,11 @@
package state
-import "github.com/ethereum/go-ethereum/ethutil"
+import (
+ "fmt"
+ "strings"
+
+ "github.com/ethereum/go-ethereum/ethutil"
+)
type Log struct {
Address []byte
@@ -26,6 +31,10 @@ func (self Log) RlpData() interface{} {
return []interface{}{self.Address, ethutil.ByteSliceToInterface(self.Topics), self.Data}
}
+func (self Log) String() string {
+ return fmt.Sprintf(`log: %x %x %x`, self.Address, self.Topics, self.Data)
+}
+
type Logs []Log
func (self Logs) RlpData() interface{} {
@@ -36,3 +45,11 @@ func (self Logs) RlpData() interface{} {
return data
}
+
+func (self Logs) String() string {
+ var logs []string
+ for _, log := range self {
+ logs = append(logs, log.String())
+ }
+ return "[ " + strings.Join(logs, ", ") + " ]"
+}