good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
bf879ef2
Commit
bf879ef2
authored
9 years ago
by
Gustav Simonsson
Browse files
Options
Downloads
Patches
Plain Diff
core/state: test formatting adhering to Go convention
parent
004ed786
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/state/state_test.go
+17
-17
17 additions, 17 deletions
core/state/state_test.go
with
17 additions
and
17 deletions
core/state/state_test.go
+
17
−
17
View file @
bf879ef2
...
...
@@ -170,7 +170,7 @@ func TestSnapshot2(t *testing.T) {
so0Restored
:=
state
.
GetStateObject
(
stateobjaddr0
)
so1Restored
:=
state
.
GetStateObject
(
stateobjaddr1
)
// non-deleted is equal (restored)
compareStateObjects
(
so0
,
so0Restored
,
t
)
compareStateObjects
(
so0Restored
,
so0
,
t
)
// deleted should be nil, both before and after restore of state copy
if
so1Restored
!=
nil
{
t
.
Fatalf
(
"deleted object not nil after restoring snapshot"
)
...
...
@@ -179,45 +179,45 @@ func TestSnapshot2(t *testing.T) {
func
compareStateObjects
(
so0
,
so1
*
StateObject
,
t
*
testing
.
T
)
{
if
so0
.
address
!=
so1
.
address
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
address
,
so1
.
address
)
t
.
Fatalf
(
"
Address mismatch: have %v, wan
t %v"
,
so0
.
address
,
so1
.
address
)
}
if
so0
.
balance
.
Cmp
(
so1
.
balance
)
!=
0
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
balance
,
so1
.
balance
)
t
.
Fatalf
(
"
Balance mismatch: have %v, wan
t %v"
,
so0
.
balance
,
so1
.
balance
)
}
if
so0
.
nonce
!=
so1
.
nonce
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
nonce
,
so1
.
nonce
)
t
.
Fatalf
(
"
Nonce mismatch: have %v, wan
t %v"
,
so0
.
nonce
,
so1
.
nonce
)
}
if
!
bytes
.
Equal
(
so0
.
codeHash
,
so1
.
codeHash
)
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
codeHash
,
so1
.
codeHash
)
t
.
Fatalf
(
"
CodeHash mismatch: have %v, wan
t %v"
,
so0
.
codeHash
,
so1
.
codeHash
)
}
if
!
bytes
.
Equal
(
so0
.
code
,
so1
.
code
)
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
code
,
so1
.
code
)
t
.
Fatalf
(
"
Code mismatch: have %v, wan
t %v"
,
so0
.
code
,
so1
.
code
)
}
if
!
bytes
.
Equal
(
so0
.
initCode
,
so1
.
initCode
)
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
initCode
,
so1
.
initCode
)
t
.
Fatalf
(
"
InitCode mismatch: have %v, wan
t %v"
,
so0
.
initCode
,
so1
.
initCode
)
}
for
k
,
v
:=
range
so0
.
storage
{
if
so1
.
storage
[
k
]
!=
v
{
t
.
Fatalf
(
"
\n
storage key %s:
\n
expected %v
\n
got %v"
,
k
,
v
,
so1
.
storage
[
k
])
}
}
for
k
,
v
:=
range
so1
.
storage
{
if
so0
.
storage
[
k
]
!=
v
{
t
.
Fatalf
(
"
\n
unexpected k,v : %v, %v"
,
k
,
v
)
t
.
Fatalf
(
"Storage key %s mismatch: have %v, want %v"
,
k
,
so0
.
storage
[
k
],
v
)
}
}
for
k
,
v
:=
range
so0
.
storage
{
if
so1
.
storage
[
k
]
!=
v
{
t
.
Fatalf
(
"Storage key %s mismatch: have %v, want none."
,
k
,
v
)
}
}
if
so0
.
gasPool
.
Cmp
(
so1
.
gasPool
)
!=
0
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
gasPool
,
so1
.
gasPool
)
t
.
Fatalf
(
"
GasPool mismatch: have %v, wan
t %v"
,
so0
.
gasPool
,
so1
.
gasPool
)
}
if
so0
.
remove
!=
so1
.
remove
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
remove
,
so1
.
remove
)
t
.
Fatalf
(
"
Remove mismatch: have %v, wan
t %v"
,
so0
.
remove
,
so1
.
remove
)
}
if
so0
.
deleted
!=
so1
.
deleted
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
deleted
,
so1
.
deleted
)
t
.
Fatalf
(
"
Deleted mismatch: have %v, wan
t %v"
,
so0
.
deleted
,
so1
.
deleted
)
}
if
so0
.
dirty
!=
so1
.
dirty
{
t
.
Fatalf
(
"
\n
expected %v
\n
go
t %v"
,
so0
.
dirty
,
so1
.
dirty
)
t
.
Fatalf
(
"
Dirty mismatch: have %v, wan
t %v"
,
so0
.
dirty
,
so1
.
dirty
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment