aboutsummaryrefslogtreecommitdiffstats
path: root/tests/transaction_test.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-10 17:55:31 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-04-10 17:55:31 +0800
commit9ac5671c18ae3c36370981cd42a99639f9799042 (patch)
tree8957bac6f83e33209686d2dc221783bc5b42cce7 /tests/transaction_test.go
parent1e18f4544b7e85619c8902a5e2fb408984f277b6 (diff)
downloadgo-tangerine-9ac5671c18ae3c36370981cd42a99639f9799042.tar.gz
go-tangerine-9ac5671c18ae3c36370981cd42a99639f9799042.tar.zst
go-tangerine-9ac5671c18ae3c36370981cd42a99639f9799042.zip
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
Diffstat (limited to 'tests/transaction_test.go')
-rw-r--r--tests/transaction_test.go58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/transaction_test.go b/tests/transaction_test.go
new file mode 100644
index 000000000..5e903e4b4
--- /dev/null
+++ b/tests/transaction_test.go
@@ -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)
+ }
+}