Skip to content

Commit

Permalink
Fixes tests to support legacy TXs.
Browse files Browse the repository at this point in the history
  • Loading branch information
web3coach committed Sep 9, 2021
1 parent 939340d commit 9af5c6c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions node/node_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9af5c6c

Please sign in to comment.