Skip to content

Commit

Permalink
Sets decorator in main tests.
Browse files Browse the repository at this point in the history
Commiting for testing CI.
  • Loading branch information
dcorral committed Jan 27, 2023
1 parent 2b650e7 commit ba8b4b6
Show file tree
Hide file tree
Showing 231 changed files with 231 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/create_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def set_test_params(self):
def setup_network(self):
pass

@DefiTestFramework.rollback
def run_test(self):
pass

Expand Down
1 change: 1 addition & 0 deletions test/functional/example_block_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]

Expand Down
1 change: 1 addition & 0 deletions test/functional/example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def custom_method(self):

self.log.info("Running custom_method")

@DefiTestFramework.rollback
def run_test(self):
"""Main test logic"""

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_abortnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def setup_network(self):
self.setup_nodes()
# We'll connect the nodes later

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(3)
datadir = get_datadir_path(self.options.tmpdir, 0)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_account_mining.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=50']]

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]
node.generate(120)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_accounts_n_utxos.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=50'], ['-txnotokens=0', '-amkheight=50'], ['-txnotokens=0', '-amkheight=50']]

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listtokens()), 1) # only one token == DFI

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_accounts_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-eunosheight=101'],
]

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]
node1 = self.nodes[1]
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_anchor_rewards.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def authsquorum(self, height, node=None):
return True
return False

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listmasternodes()), 8)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_anchorauths_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def genmocktime(self, time, intervals):
self.nodes[0].set_mocktime(time + (i * 60 * 60))
self.nodes[0].generate(5)

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listmasternodes()), 8)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_any_accounts_to_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-bayfrontgardensheight=50', '-datacarriersize=1000']
]

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listtokens()), 1) # only one token == DFI

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_assumevalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def assert_blockchain_height(self, node, height):
elif current_height == height:
break

@DefiTestFramework.rollback
def run_test(self):
p2p0 = self.nodes[0].add_p2p_connection(BaseNode())

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_asymmetric_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-dakotaheight=1', '-fortcanningheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-fortcanningspringheight=150', '-jellyfish_regtest=1']]

@DefiTestFramework.rollback
def run_test(self):

# Set up test tokens
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_auth_return_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def check_auto_auth_txs(self, tx, owner, outputs = 2):
assert_equal(len(final_rawtx['vout']), outputs)
assert_equal(len(final_rawtx['vin']), 1)

@DefiTestFramework.rollback
def run_test(self):
coinbase = self.nodes[0].getnewaddress("", "legacy")
self.nodes[0].generate(101, 1000000, coinbase)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_autoauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def clear_auth_utxos(self):
self.nodes[0].sendtoaddress(non_auth_address, balance - Decimal("0.1")) # 0.1 to cover fee
self.nodes[0].generate(1, 1000000, non_auth_address)

@DefiTestFramework.rollback
def run_test(self):
n0 = self.nodes[0]

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def set_test_params(self):
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

@DefiTestFramework.rollback
def run_test(self):
self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"]

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_bitcoin_htlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
]
self.setup_clean_chain = True

@DefiTestFramework.rollback
def run_test(self):
# Set up wallet
address = self.nodes[0].spv_getnewaddress()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_bitcoin_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
]
self.setup_clean_chain = True

@DefiTestFramework.rollback
def run_test(self):
# Set up wallet
self.nodes[0].spv_setlastheight(1)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-acceptnonstdtxn=1']] # This is a consensus block test, we don't care about tx policy

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0] # convenience reference to the node

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_block_reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=50', '-eunosheight=100', '-eunosheight=100', '-fortcanningheight=110', '-subsidytest=1']]

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]
node.generate(120)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_blocksdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1

@DefiTestFramework.rollback
def run_test(self):
self.stop_node(0)
assert os.path.isdir(os.path.join(self.nodes[0].datadir, self.chain, "blocks"))
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_burn_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-eunosheight=1', '-dakotaheight=1']]

@DefiTestFramework.rollback
def run_test(self):

self.nodes[0].generate(101)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50']
]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(100)
self.sync_blocks()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_cltv.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def set_test_params(self):
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].add_p2p_connection(P2PInterface())

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_commission_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
self.extra_args = [
['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanningmuseumheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-fortcanningcrunchheight=1', f'-grandcentralheight={self.grand_central}', '-subsidytest=1']]

@DefiTestFramework.rollback
def run_test(self):
# Set up test tokens
self.setup_test_tokens()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_community_development_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def set_test_params(self):
['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=60', '-eunosheight=70', '-fortcanningheight=80', '-fortcanninghillheight=90', '-fortcanningroadheight=100', '-fortcanningcrunchheight=110', '-fortcanningspringheight=120', '-fortcanninggreatworldheight=130', '-grandcentralheight=201', '-subsidytest=1'],
]

@DefiTestFramework.rollback
def run_test(self):
node0 = self.nodes[0]
node1 = self.nodes[1]
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_communitybalance_reorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=0'], ['-txnotokens=0', '-amkheight=0']]

@DefiTestFramework.rollback
def run_test(self):
# Generate across nodes
self.nodes[0].generate(10)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_log_buffer(self):
self.start_node(0, extra_args=['-noconnect=0'])
self.stop_node(0)

@DefiTestFramework.rollback
def run_test(self):
self.stop_node(0)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_consortium.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=1', '-fortcanningheight=50', '-eunosheight=50', '-fortcanninghillheight=50', '-fortcanningparkheight=50', '-fortcanningroadheight=50', '-fortcanningcrunchheight=50', '-fortcanningspringheight=50', '-fortcanninggreatworldheight=250', '-grandcentralheight=254', '-grandcentralepilogueheight=350', '-regtest-minttoken-simulate-mainnet=1', '-txindex=1'],
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=1', '-fortcanningheight=50', '-eunosheight=50', '-fortcanninghillheight=50', '-fortcanningparkheight=50', '-fortcanningroadheight=50', '-fortcanningcrunchheight=50', '-fortcanningspringheight=50', '-fortcanninggreatworldheight=250', '-grandcentralheight=254', '-grandcentralepilogueheight=350', '-regtest-minttoken-simulate-mainnet=1', '-txindex=1']]

@DefiTestFramework.rollback
def run_test(self):

print("Generating initial chain...")
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_csv_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def send_blocks(self, blocks, success=True):
Call with success = False if the tip shouldn't advance to the most recent block."""
self.nodes[0].p2p.send_blocks_and_test(blocks, self.nodes[0], success=success)

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].add_p2p_connection(P2PDataStore())

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_custom_poolreward.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.extra_args = [['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=50', '-clarkequayheight=50'],
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-bayfrontgardensheight=50', '-clarkequayheight=50']]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(102)
self.sync_blocks()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dbcrash.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def generate_small_transactions(self, node, count, utxo_list):
node.sendrawtransaction(tx_signed_hex)
num_transactions += 1

@DefiTestFramework.rollback
def run_test(self):
# Track test coverage statistics
self.restart_counts = [0, 0, 0] # Track the restarts for nodes 0-2
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dersig.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def set_test_params(self):
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].add_p2p_connection(P2PInterface())

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dfip8_communitybalances.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-eunosheight=1', '-subsidytest=1']]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(1)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dip1.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=2'], ['-txnotokens=0']]

@DefiTestFramework.rollback
def run_test(self):
assert_equal(self.nodes[0].getblockchaininfo()['softforks']['amk']['active'], False)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dusd_loans.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ def post_FCE_DFI_minimum_check_takeloan(self):



@DefiTestFramework.rollback
def run_test(self):
# Initial set up
self.setup()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_eunos_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-eunosheight=200', '-dakotaheight=1']]

@DefiTestFramework.rollback
def run_test(self):

# Burn address
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_fee_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def transact_and_mine(self, numblocks, mining_node):
newmem.append(utx)
self.memutxo = newmem

@DefiTestFramework.rollback
def run_test(self):
self.log.info("This test is time consuming, please be patient")
self.log.info("Splitting inputs so we can generate tx's")
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def setup_network(self):
self.nodes[0].start([])
self.nodes[0].wait_for_rpc_connection()

@DefiTestFramework.rollback
def run_test(self):
datadir = os.path.join(self.nodes[0].datadir, 'regtest')
self.log.info("Using datadir {}".format(datadir))
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_foundation_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanningmuseumheight=1', '-fortcanninghillheight=1', '-fortcanningroadheight=1', '-fortcanningcrunchheight=1', f'-grandcentralheight={self.grand_central}', '-subsidytest=1']
]

@DefiTestFramework.rollback
def run_test(self):

# Define node 0 foundation address
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-fortcanningheight=1', '-fortcanninghillheight=1', '-fortcanningcrunchheight=150', '-fortcanningroadheight=150', '-fortcanningspringheight=500', '-subsidytest=1']]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(101)

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def get_node_output(self, *, ret_code_expected):

return out, err

@DefiTestFramework.rollback
def run_test(self):
self.log.info("Start defi with -h for help text")
self.nodes[0].start(extra_args=['-h'])
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_higher_collateral_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1', '-fortcanningroadheight=1', '-fortcanninghillheight=1', '-fortcanningcrunchheight=1', '-fortcanninggreatworldheight=1', '-fortcanningepilogueheight=200', '-jellyfish_regtest=1']]

@DefiTestFramework.rollback
def run_test(self):
# Setup
self.setup()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_icx_orderbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=50', '-eunospayaheight=50', '-txindex=1'],
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=50', '-eunospayaheight=50', '-txindex=1']]

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listtokens()), 1) # only one token == DFI

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_icx_orderbook_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=50', '-eunospayaheight=50', '-txindex=1'],
['-txnotokens=0', '-amkheight=50', '-bayfrontheight=50', '-eunosheight=50', '-eunospayaheight=50', '-txindex=1']]

@DefiTestFramework.rollback
def run_test(self):
assert_equal(len(self.nodes[0].listtokens()), 1) # only one token == DFI

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_includeconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def setup_chain(self):
with open(os.path.join(self.options.tmpdir, "node0", "defi.conf"), "a", encoding='utf8') as f:
f.write("uacomment=main\nincludeconf=relative.conf\n")

@DefiTestFramework.rollback
def run_test(self):
self.log.info("-includeconf works from config file. subversion should end with 'main; relative)/'")

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_initdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def setup_network(self):
connect_nodes_bi(self.nodes, i, i + 1)
self.sync_blocks()

@DefiTestFramework.rollback
def run_test(self):

self.nodes[0].importprivkey(privkey=self.nodes[0].PRIV_KEYS[5].ownerPrivKey, label='initdist')
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_jellyfish_initial_funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def set_test_params(self):
# pass -jellyfish_regtest=1 option to enable regtest params required for jellyfish test containers
self.extra_args = [['-jellyfish_regtest=1']]

@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]
# generate one block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
'-grandcentralheight=51'],
]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(101)
self.sync_blocks()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_listaccounts_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=50', '-eunosheight=101'],
['-txnotokens=0', '-amkheight=50', '-eunosheight=101'],
]
@DefiTestFramework.rollback
def run_test(self):
node = self.nodes[0]
node1 = self.nodes[1]
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def set_test_params(self):
['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-bayfrontgardensheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=1']
]

@DefiTestFramework.rollback
def run_test(self):
self.nodes[0].generate(300)
self.nodes[0].createtoken({
Expand Down
Loading

0 comments on commit ba8b4b6

Please sign in to comment.