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
4300f2a0
Commit
4300f2a0
authored
Mar 21, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed state tests
parent
c28116cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
state_test.go
state/state_test.go
+5
-8
No files found.
state/state_test.go
View file @
4300f2a0
package
state
package
state
import
(
import
(
"fmt"
"math/big"
"math/big"
"testing"
"testing"
...
@@ -61,23 +60,21 @@ func (s *StateSuite) TestDump(c *checker.C) {
...
@@ -61,23 +60,21 @@ func (s *StateSuite) TestDump(c *checker.C) {
func
(
s
*
StateSuite
)
SetUpTest
(
c
*
checker
.
C
)
{
func
(
s
*
StateSuite
)
SetUpTest
(
c
*
checker
.
C
)
{
db
,
_
:=
ethdb
.
NewMemDatabase
()
db
,
_
:=
ethdb
.
NewMemDatabase
()
s
.
state
=
New
(
nil
,
db
)
s
.
state
=
New
(
common
.
Hash
{}
,
db
)
}
}
func
TestNull
(
t
*
testing
.
T
)
{
func
TestNull
(
t
*
testing
.
T
)
{
db
,
_
:=
ethdb
.
NewMemDatabase
()
db
,
_
:=
ethdb
.
NewMemDatabase
()
state
:=
New
(
nil
,
db
)
state
:=
New
(
common
.
Hash
{}
,
db
)
address
:=
common
.
FromHex
(
"0x823140710bf13990e4500136726d8b55"
)
address
:=
common
.
HexToAddress
(
"0x823140710bf13990e4500136726d8b55"
)
state
.
NewStateObject
(
address
)
state
.
NewStateObject
(
address
)
//value := common.FromHex("0x823140710bf13990e4500136726d8b55")
//value := common.FromHex("0x823140710bf13990e4500136726d8b55")
value
:=
make
([]
byte
,
16
)
value
:=
make
([]
byte
,
16
)
fmt
.
Println
(
"test it here"
,
common
.
NewValue
(
value
))
state
.
SetState
(
address
,
common
.
Hash
{},
value
)
state
.
SetState
(
address
,
[]
byte
{
0
},
value
)
state
.
Update
(
nil
)
state
.
Update
(
nil
)
state
.
Sync
()
state
.
Sync
()
value
=
state
.
GetState
(
address
,
[]
byte
{
0
})
value
=
state
.
GetState
(
address
,
common
.
Hash
{})
fmt
.
Printf
(
"res: %x
\n
"
,
value
)
}
}
func
(
s
*
StateSuite
)
TestSnapshot
(
c
*
checker
.
C
)
{
func
(
s
*
StateSuite
)
TestSnapshot
(
c
*
checker
.
C
)
{
...
...
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