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
6d20d634
Commit
6d20d634
authored
Apr 10, 2015
by
Gustav Simonsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable more tx tests by expecting most common encoding of values
parent
6dc2146e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
transaction_test.go
tests/transaction_test.go
+2
-9
transaction_test_util.go
tests/transaction_test_util.go
+6
-6
No files found.
tests/transaction_test.go
View file @
6d20d634
...
...
@@ -9,16 +9,8 @@ func TestTransactions(t *testing.T) {
// TODO: all commented out tests should work!
snafus
:=
[]
string
{
"AddressLessThan20Prefixed0"
,
"DataTest"
,
"EmptyTransaction"
,
"RightVRSTest"
,
"SenderTest"
,
"TransactionWithGasLimitxPriceOverflow"
,
"TransactionWithHihghGas"
,
"TransactionWithHihghGasPrice"
,
"TransactionWithHihghNonce"
,
"TransactionWithHihghValue"
,
"TransactionWithRvalueWrongSize"
,
"TransactionWithSvalueHigh"
,
"TransactionWithSvalueTooHigh"
,
...
...
@@ -26,7 +18,8 @@ func TestTransactions(t *testing.T) {
"ValuesAsDec"
,
"ValuesAsHex"
,
"libsecp256k1test"
,
"unpadedRValue"
}
"unpadedRValue"
,
}
for
_
,
name
:=
range
snafus
{
notWorking
[
name
]
=
true
...
...
tests/transaction_test_util.go
View file @
6d20d634
...
...
@@ -30,7 +30,7 @@ type TransactionTest struct {
Transaction
TtTransaction
}
func
RunTransactionTests
(
file
string
,
notWorking
map
[
string
]
bool
)
error
{
func
RunTransactionTests
(
file
string
,
notWorking
map
[
string
]
bool
)
error
{
bt
:=
make
(
map
[
string
]
TransactionTest
)
if
err
:=
LoadJSON
(
file
,
&
bt
);
err
!=
nil
{
return
err
...
...
@@ -60,7 +60,7 @@ func runTest(txTest TransactionTest) (err error) {
}
tx
:=
new
(
types
.
Transaction
)
rlp
.
DecodeBytes
(
rlpBytes
,
tx
)
//fmt.Println("HURR tx: %v", tx)
sender
,
err
:=
tx
.
From
()
if
err
!=
nil
{
return
err
...
...
@@ -120,15 +120,15 @@ func convertTestTypes(txTest TransactionTest) (sender, to common.Address,
txInputData
=
mustConvertBytes
(
txTest
.
Transaction
.
Data
)
rlpBytes
=
mustConvertBytes
(
txTest
.
Rlp
)
gasLimit
=
mustConvertBigInt
Hex
(
txTest
.
Transaction
.
GasLimit
)
gasPrice
=
mustConvertBigInt
Hex
(
txTest
.
Transaction
.
GasPrice
)
value
=
mustConvertBigInt
Hex
(
txTest
.
Transaction
.
Value
)
gasLimit
=
mustConvertBigInt
10
(
txTest
.
Transaction
.
GasLimit
)
gasPrice
=
mustConvertBigInt
10
(
txTest
.
Transaction
.
GasPrice
)
value
=
mustConvertBigInt
10
(
txTest
.
Transaction
.
Value
)
r
=
common
.
Bytes2Big
(
mustConvertBytes
(
txTest
.
Transaction
.
R
))
s
=
common
.
Bytes2Big
(
mustConvertBytes
(
txTest
.
Transaction
.
S
))
nonce
=
mustConvertUintHex
(
txTest
.
Transaction
.
Nonce
)
v
=
mustConvertUint
Hex
(
txTest
.
Transaction
.
V
)
v
=
mustConvertUint
(
txTest
.
Transaction
.
V
)
return
sender
,
to
,
txInputData
,
rlpBytes
,
gasLimit
,
gasPrice
,
value
,
r
,
s
,
nonce
,
v
,
nil
}
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