From 9af5c6c5cba32e239db504e8184be03cf25cc067 Mon Sep 17 00:00:00 2001 From: Lukas Lukac Date: Thu, 9 Sep 2021 18:20:51 +0200 Subject: [PATCH] Fixes tests to support legacy TXs. --- node/node_integration_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/node_integration_test.go b/node/node_integration_test.go index c3e7f41..c506a08 100644 --- a/node/node_integration_test.go +++ b/node/node_integration_test.go @@ -420,6 +420,13 @@ func TestNode_MiningStopsOnNewSyncedBlock(t *testing.T) { tx1 := database.NewBaseTx(andrej, babaYaga, 1, 1, "") tx2 := database.NewBaseTx(andrej, babaYaga, 2, 2, "") + if tc.name == "Legacy" { + tx1.Gas = 0 + tx1.GasPrice = 0 + tx2.Gas = 0 + tx2.GasPrice = 0 + } + signedTx1, err := wallet.SignTxWithKeystoreAccount(tx1, andrej, testKsAccountsPwd, wallet.GetKeystoreDirPath(dataDir)) if err != nil { t.Error(err) @@ -615,6 +622,11 @@ func TestNode_MiningSpamTransactions(t *testing.T) { // Ensure every TX has a unique timestamp and the nonce 0 has oldest timestamp, nonce 1 younger timestamp etc tx.Time = now - uint64(txCount-i*100) + if tc.name == "Legacy" { + tx.Gas = 0 + tx.GasPrice = 0 + } + signedTx, err := wallet.SignTxWithKeystoreAccount(tx, andrej, testKsAccountsPwd, wallet.GetKeystoreDirPath(dataDir)) if err != nil { t.Fatal(err)