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
6cf61039
Commit
6cf61039
authored
Jan 02, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for valid transactions
parent
48d2a8b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
transaction_pool_test.go
core/transaction_pool_test.go
+10
-11
No files found.
core/transaction_pool_test.go
View file @
6cf61039
...
@@ -18,15 +18,6 @@ func (self stateQuery) GetAccount(addr []byte) *state.StateObject {
...
@@ -18,15 +18,6 @@ func (self stateQuery) GetAccount(addr []byte) *state.StateObject {
return
state
.
NewStateObject
(
addr
)
return
state
.
NewStateObject
(
addr
)
}
}
// State query interface
type
invalidStateQuery
struct
{}
func
(
self
invalidStateQuery
)
GetAccount
(
addr
[]
byte
)
*
state
.
StateObject
{
o
:=
state
.
NewStateObject
(
addr
)
o
.
Nonce
++
return
o
}
func
transaction
()
*
types
.
Transaction
{
func
transaction
()
*
types
.
Transaction
{
return
types
.
NewTransactionMessage
(
make
([]
byte
,
20
),
ethutil
.
Big0
,
ethutil
.
Big0
,
ethutil
.
Big0
,
nil
)
return
types
.
NewTransactionMessage
(
make
([]
byte
,
20
),
ethutil
.
Big0
,
ethutil
.
Big0
,
ethutil
.
Big0
,
nil
)
}
}
...
@@ -72,11 +63,19 @@ func TestRemoveSet(t *testing.T) {
...
@@ -72,11 +63,19 @@ func TestRemoveSet(t *testing.T) {
}
}
func
TestRemoveInvalid
(
t
*
testing
.
T
)
{
func
TestRemoveInvalid
(
t
*
testing
.
T
)
{
pool
,
_
:=
setup
()
pool
,
key
:=
setup
()
tx1
:=
transaction
()
tx1
:=
transaction
()
pool
.
pool
.
Add
(
tx1
)
pool
.
pool
.
Add
(
tx1
)
pool
.
RemoveInvalid
(
invalidS
tateQuery
{})
pool
.
RemoveInvalid
(
s
tateQuery
{})
if
pool
.
Size
()
>
0
{
if
pool
.
Size
()
>
0
{
t
.
Error
(
"expected pool size to be 0"
)
t
.
Error
(
"expected pool size to be 0"
)
}
}
tx1
.
SetNonce
(
1
)
tx1
.
SignECDSA
(
key
)
pool
.
pool
.
Add
(
tx1
)
pool
.
RemoveInvalid
(
stateQuery
{})
if
pool
.
Size
()
!=
1
{
t
.
Error
(
"expected pool size to be 1, is"
,
pool
.
Size
())
}
}
}
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