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
a977f3c0
Commit
a977f3c0
authored
Jun 17, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xeth, tests: fixed api
parent
30b27336
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
block_test_util.go
tests/block_test_util.go
+1
-1
types.go
xeth/types.go
+4
-4
xeth.go
xeth/xeth.go
+1
-1
No files found.
tests/block_test_util.go
View file @
a977f3c0
...
...
@@ -124,7 +124,7 @@ func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, erro
obj
.
SetBalance
(
balance
)
obj
.
SetNonce
(
nonce
)
for
k
,
v
:=
range
acct
.
Storage
{
statedb
.
SetState
(
common
.
HexToAddress
(
addrString
),
common
.
HexToHash
(
k
),
common
.
FromHex
(
v
))
statedb
.
SetState
(
common
.
HexToAddress
(
addrString
),
common
.
HexToHash
(
k
),
common
.
HexToHash
(
v
))
}
}
// sync objects to trie
...
...
xeth/types.go
View file @
a977f3c0
...
...
@@ -22,7 +22,7 @@ func NewObject(state *state.StateObject) *Object {
return
&
Object
{
state
}
}
func
(
self
*
Object
)
StorageString
(
str
string
)
*
common
.
Valu
e
{
func
(
self
*
Object
)
StorageString
(
str
string
)
[]
byt
e
{
if
common
.
IsHex
(
str
)
{
return
self
.
storage
(
common
.
Hex2Bytes
(
str
[
2
:
]))
}
else
{
...
...
@@ -30,12 +30,12 @@ func (self *Object) StorageString(str string) *common.Value {
}
}
func
(
self
*
Object
)
StorageValue
(
addr
*
common
.
Value
)
*
common
.
Valu
e
{
func
(
self
*
Object
)
StorageValue
(
addr
*
common
.
Value
)
[]
byt
e
{
return
self
.
storage
(
addr
.
Bytes
())
}
func
(
self
*
Object
)
storage
(
addr
[]
byte
)
*
common
.
Valu
e
{
return
self
.
StateObject
.
GetSt
orage
(
common
.
BigD
(
addr
)
)
func
(
self
*
Object
)
storage
(
addr
[]
byte
)
[]
byt
e
{
return
self
.
StateObject
.
GetSt
ate
(
common
.
BytesToHash
(
addr
))
.
Bytes
(
)
}
func
(
self
*
Object
)
Storage
()
(
storage
map
[
string
]
string
)
{
...
...
xeth/xeth.go
View file @
a977f3c0
...
...
@@ -488,7 +488,7 @@ func (self *XEth) NumberToHuman(balance string) string {
}
func
(
self
*
XEth
)
StorageAt
(
addr
,
storageAddr
string
)
string
{
return
common
.
ToHex
(
self
.
State
()
.
state
.
GetState
(
common
.
HexToAddress
(
addr
),
common
.
HexToHash
(
storageAddr
))
)
return
self
.
State
()
.
state
.
GetState
(
common
.
HexToAddress
(
addr
),
common
.
HexToHash
(
storageAddr
))
.
Hex
(
)
}
func
(
self
*
XEth
)
BalanceAt
(
addr
string
)
string
{
...
...
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