Add TransactionTests wrapped as Go tests
* Add initial go wrapping for TransactionTests with some tests disabled in lieu of consistent HEX encodings and a few other pending bugfixes * TODO: Consider better way of perhaps modelling each test in the JSON files as a single Go test, instead of one Go test per JSON file
This commit is contained in:
58
tests/transaction_test.go
Normal file
58
tests/transaction_test.go
Normal file
@ -0,0 +1,58 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTransactions(t *testing.T) {
|
||||
notWorking := make(map[string]bool, 100)
|
||||
// TODO: all commented out tests should work!
|
||||
|
||||
snafus := []string{
|
||||
"AddressLessThan20Prefixed0",
|
||||
"DataTest",
|
||||
"EmptyTransaction",
|
||||
"RightVRSTest",
|
||||
"SenderTest",
|
||||
"TransactionWithGasLimitxPriceOverflow",
|
||||
"TransactionWithHihghGas",
|
||||
"TransactionWithHihghGasPrice",
|
||||
"TransactionWithHihghNonce",
|
||||
"TransactionWithHihghValue",
|
||||
"TransactionWithRvalueWrongSize",
|
||||
"TransactionWithSvalueHigh",
|
||||
"TransactionWithSvalueTooHigh",
|
||||
"TransactionWithSvalueWrongSize",
|
||||
"ValuesAsDec",
|
||||
"ValuesAsHex",
|
||||
"libsecp256k1test",
|
||||
"unpadedRValue"}
|
||||
|
||||
for _, name := range snafus {
|
||||
notWorking[name] = true
|
||||
}
|
||||
|
||||
var err error
|
||||
err = RunTransactionTests("./files/TransactionTests/ttTransactionTest.json",
|
||||
notWorking)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWrongRLPTransactions(t *testing.T) {
|
||||
notWorking := make(map[string]bool, 100)
|
||||
// TODO: all commented out tests should work!
|
||||
notWorking[""] = true
|
||||
notWorking[""] = true
|
||||
notWorking[""] = true
|
||||
notWorking[""] = true
|
||||
notWorking[""] = true
|
||||
|
||||
var err error
|
||||
err = RunTransactionTests("./files/TransactionTests/ttWrongRLPTransaction.json",
|
||||
notWorking)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user