debugging code
This commit is contained in:
19
state/log.go
19
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, ", ") + " ]"
|
||||
}
|
||||
|
Reference in New Issue
Block a user