Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
bba85a20
Commit
bba85a20
authored
Feb 22, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Number to logs
parent
483d96a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
util.go
rpc/util.go
+2
-0
log.go
state/log.go
+9
-2
environment.go
vm/environment.go
+5
-0
vm.go
vm/vm.go
+1
-1
No files found.
rpc/util.go
View file @
bba85a20
...
...
@@ -84,6 +84,7 @@ type Log struct {
Address
string
`json:"address"`
Topic
[]
string
`json:"topics"`
Data
string
`json:"data"`
Number
uint64
`json:"number"`
}
func
toLogs
(
logs
state
.
Logs
)
(
ls
[]
Log
)
{
...
...
@@ -94,6 +95,7 @@ func toLogs(logs state.Logs) (ls []Log) {
l
.
Topic
=
make
([]
string
,
len
(
log
.
Topics
()))
l
.
Address
=
toHex
(
log
.
Address
())
l
.
Data
=
toHex
(
log
.
Data
())
l
.
Number
=
log
.
Number
()
for
j
,
topic
:=
range
log
.
Topics
()
{
l
.
Topic
[
j
]
=
toHex
(
topic
)
}
...
...
state/log.go
View file @
bba85a20
...
...
@@ -12,16 +12,19 @@ type Log interface {
Address
()
[]
byte
Topics
()
[][]
byte
Data
()
[]
byte
Number
()
uint64
}
type
StateLog
struct
{
address
[]
byte
topics
[][]
byte
data
[]
byte
number
uint64
}
func
NewLog
(
address
[]
byte
,
topics
[][]
byte
,
data
[]
byte
)
*
StateLog
{
return
&
StateLog
{
address
,
topics
,
data
}
func
NewLog
(
address
[]
byte
,
topics
[][]
byte
,
data
[]
byte
,
number
uint64
)
*
StateLog
{
return
&
StateLog
{
address
,
topics
,
data
,
number
}
}
func
(
self
*
StateLog
)
Address
()
[]
byte
{
...
...
@@ -36,6 +39,10 @@ func (self *StateLog) Data() []byte {
return
self
.
data
}
func
(
self
*
StateLog
)
Number
()
uint64
{
return
self
.
number
}
func
NewLogFromValue
(
decoder
*
ethutil
.
Value
)
*
StateLog
{
log
:=
&
StateLog
{
address
:
decoder
.
Get
(
0
)
.
Bytes
(),
...
...
vm/environment.go
View file @
bba85a20
...
...
@@ -54,6 +54,7 @@ type Log struct {
address
[]
byte
topics
[][]
byte
data
[]
byte
log
uint64
}
func
(
self
*
Log
)
Address
()
[]
byte
{
...
...
@@ -68,6 +69,10 @@ func (self *Log) Data() []byte {
return
self
.
data
}
func
(
self
*
Log
)
Number
()
uint64
{
return
self
.
log
}
func
(
self
*
Log
)
RlpData
()
interface
{}
{
return
[]
interface
{}{
self
.
address
,
ethutil
.
ByteSliceToInterface
(
self
.
topics
),
self
.
data
}
}
...
...
vm/vm.go
View file @
bba85a20
...
...
@@ -578,7 +578,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
}
data
:=
mem
.
Get
(
mStart
.
Int64
(),
mSize
.
Int64
())
log
:=
&
Log
{
context
.
Address
(),
topics
,
data
}
log
:=
&
Log
{
context
.
Address
(),
topics
,
data
,
self
.
env
.
BlockNumber
()
.
Uint64
()
}
self
.
env
.
AddLog
(
log
)
self
.
Printf
(
" => %v"
,
log
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment