Skip to content

Commit

Permalink
test: Prevent wallet resubmitting TX after rollback (#1239)
Browse files Browse the repository at this point in the history
* Fix rare failure in test

* lint: remove unused import
  • Loading branch information
Bushstar authored May 17, 2022
1 parent 8e3a402 commit 8cf7857
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions test/functional/feature_loan_payback_dfi_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""Test Loan - payback loan dfi."""

from test_framework.test_framework import DefiTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes
from test_framework.util import assert_equal, assert_raises_rpc_error
from test_framework.authproxy import JSONRPCException

import calendar
Expand All @@ -17,12 +17,11 @@
class PaybackDFILoanTest (DefiTestFramework):
def set_test_params(self):
self.FCR_HEIGHT = 800
self.num_nodes = 2
self.num_nodes = 1
self.FINISHED_SETUP_BLOCK = 0
self.setup_clean_chain = True
self.extra_args = [
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=1', '-eunosheight=50','-fortcanningheight=50', '-fortcanninghillheight=50', f'-fortcanningroadheight={self.FCR_HEIGHT}', '-simulatemainnet', '-txindex=1', '-jellyfish_regtest=1' ],
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=1', '-eunosheight=50','-fortcanningheight=50', '-fortcanninghillheight=50', f'-fortcanningroadheight={self.FCR_HEIGHT}', '-simulatemainnet', '-txindex=1', '-jellyfish_regtest=1' ]
['-walletbroadcast=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=1', '-eunosheight=50','-fortcanningheight=50', '-fortcanninghillheight=50', f'-fortcanningroadheight={self.FCR_HEIGHT}', '-simulatemainnet', '-txindex=1', '-jellyfish_regtest=1' ],
]
self.symbolDFI = "DFI"
self.symbolBTC = "BTC"
Expand All @@ -33,14 +32,7 @@ def go_post_FCR(self):
self.nodes[0].generate(self.FCR_HEIGHT+1)

def reset_chain(self):
# REVERTING
# mine blocks at node 1
self.nodes[1].generate(20)

connect_nodes(self.nodes[0], 1)
self.sync_blocks()
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(1))
self.nodes[0].generate(1)

def create_tokens(self):
self.nodes[0].createtoken({
Expand Down

0 comments on commit 8cf7857

Please sign in to comment.