diff --git a/src/dfi/mn_rpc.cpp b/src/dfi/mn_rpc.cpp index d7c704ce67b..9c91c36ff87 100644 --- a/src/dfi/mn_rpc.cpp +++ b/src/dfi/mn_rpc.cpp @@ -469,7 +469,7 @@ std::vector GetAuthInputsSmart(CWalletCoinsUnlocker &pwallet, return result; } -void execTestTx(const CTransaction &tx, uint32_t height, CTransactionRef optAuthTx) { +void execTestTx(const CTransaction &tx, const uint32_t height, const CTransactionRef &optAuthTx) { std::vector metadata; auto txType = GuessCustomTxType(tx, metadata); auto txMessage = customTypeToMessage(txType); diff --git a/src/dfi/mn_rpc.h b/src/dfi/mn_rpc.h index 5f50b35b62e..33ca31a936f 100644 --- a/src/dfi/mn_rpc.h +++ b/src/dfi/mn_rpc.h @@ -93,7 +93,7 @@ CAccounts GetAllMineAccounts(CWallet *const pwallet); CAccounts SelectAccountsByTargetBalances(const CAccounts &accounts, const CBalances &targetBalances, AccountSelectionMode selectionMode); -void execTestTx(const CTransaction &tx, uint32_t height, CTransactionRef optAuthTx = {}); +void execTestTx(const CTransaction &tx, const uint32_t height, const CTransactionRef &optAuthTx = {}); CScript CreateScriptForHTLC(const JSONRPCRequest &request, uint32_t &blocks, std::vector &image); CPubKey PublickeyFromString(const std::string &pubkey); std::optional AmIFounder(CWallet *const pwallet); diff --git a/test/functional/feature_address_map.py b/test/functional/feature_address_map.py index 29011294a6e..45fb0a85e06 100755 --- a/test/functional/feature_address_map.py +++ b/test/functional/feature_address_map.py @@ -37,7 +37,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], [ "-dummypos=0", @@ -55,7 +54,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_anchor_rewards.py b/test/functional/feature_anchor_rewards.py index 8ed3664e27f..cedbd6d5fb1 100755 --- a/test/functional/feature_anchor_rewards.py +++ b/test/functional/feature_anchor_rewards.py @@ -518,7 +518,7 @@ def run_test(self): # check confirmations (revoting) after node restart: self.stop_node(0) - self.start_node(0, ["-txindex=1", "-amkheight=0", "-dakotaheight=1"]) + self.start_node(0, ["-amkheight=0", "-dakotaheight=1"]) connect_nodes_bi(self.nodes, 0, 1) self.sync_blocks(self.nodes[0:2]) wait_until( diff --git a/test/functional/feature_auth_return_change.py b/test/functional/feature_auth_return_change.py index a62b06d4ddd..2f297ede0c3 100755 --- a/test/functional/feature_auth_return_change.py +++ b/test/functional/feature_auth_return_change.py @@ -17,7 +17,6 @@ def set_test_params(self): self.setup_clean_chain = True self.extra_args = [ [ - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", @@ -37,12 +36,14 @@ def clear_auth_utxos(self): # Check output/input count and addresses are expected def check_auto_auth_txs(self, tx, owner, outputs=2): # Get auto auth TXs - final_rawtx = self.nodes[0].getrawtransaction(tx, 1) - auth_tx = self.nodes[0].getrawtransaction(final_rawtx["vin"][0]["txid"], 1) + get_tx = self.nodes[0].gettransaction(tx)["hex"] + final_rawtx = self.nodes[0].decoderawtransaction(get_tx) + get_tx = self.nodes[0].gettransaction(final_rawtx["vin"][0]["txid"])["hex"] + auth_tx = self.nodes[0].decoderawtransaction(get_tx) # Auth TX outputs all belong to auth address assert_equal(auth_tx["vout"][1]["scriptPubKey"]["addresses"][0], owner) - decTx = self.nodes[0].getrawtransaction(tx) + decTx = self.nodes[0].gettransaction(tx)["hex"] customTx = self.nodes[0].decodecustomtx(decTx) vouts = 2 if customTx["type"] == "ResignMasternode": @@ -166,7 +167,8 @@ def run_test(self): self.nodes[0].generate(1, 1000000, coinbase) # Change to pool collateral address - final_rawtx = self.nodes[0].getrawtransaction(poolpair_tx, 1) + get_tx = self.nodes[0].gettransaction(poolpair_tx)["hex"] + final_rawtx = self.nodes[0].decoderawtransaction(get_tx) assert_equal( final_rawtx["vout"][1]["scriptPubKey"]["addresses"][0], self.nodes[0].PRIV_KEYS[0].ownerAuthAddress, @@ -299,7 +301,8 @@ def run_test(self): assert_equal(token_c, "2") # Check auto auth TX - final_rawtx = self.nodes[0].getrawtransaction(create_tx, 1) + get_tx = self.nodes[0].gettransaction(create_tx)["hex"] + final_rawtx = self.nodes[0].decoderawtransaction(get_tx) assert_equal( final_rawtx["vout"][2]["scriptPubKey"]["addresses"][0], self.nodes[0].PRIV_KEYS[0].ownerAuthAddress, diff --git a/test/functional/feature_consortium.py b/test/functional/feature_consortium.py index 89b29031878..332d3517e73 100755 --- a/test/functional/feature_consortium.py +++ b/test/functional/feature_consortium.py @@ -32,7 +32,6 @@ def set_test_params(self): "-grandcentralheight=254", "-grandcentralepilogueheight=350", "-regtest-minttoken-simulate-mainnet=1", - "-txindex=1", ], [ "-txnotokens=0", @@ -50,7 +49,6 @@ def set_test_params(self): "-grandcentralheight=254", "-grandcentralepilogueheight=350", "-regtest-minttoken-simulate-mainnet=1", - "-txindex=1", ], [ "-txnotokens=0", @@ -68,7 +66,6 @@ def set_test_params(self): "-grandcentralheight=254", "-grandcentralepilogueheight=350", "-regtest-minttoken-simulate-mainnet=1", - "-txindex=1", ], [ "-txnotokens=0", @@ -86,7 +83,6 @@ def set_test_params(self): "-grandcentralheight=254", "-grandcentralepilogueheight=350", "-regtest-minttoken-simulate-mainnet=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_dusd_loans.py b/test/functional/feature_dusd_loans.py index 0c224d65c07..edbfbfbeb3d 100755 --- a/test/functional/feature_dusd_loans.py +++ b/test/functional/feature_dusd_loans.py @@ -55,7 +55,6 @@ def set_test_params(self): f"-grandcentralepilogueheight={self.grandcentralepilogueheight}", f"-metachainheight={self.metachainheight}", "-jellyfish_regtest=1", - "-txindex=1", "-simulatemainnet=1", ] ] diff --git a/test/functional/feature_evm.py b/test/functional/feature_evm.py index f7f94b17540..14c9d52e1b9 100755 --- a/test/functional/feature_evm.py +++ b/test/functional/feature_evm.py @@ -40,7 +40,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", "-ethdebug=1", ] self.extra_args = [args, args] diff --git a/test/functional/feature_evm_contract_env_vars.py b/test/functional/feature_evm_contract_env_vars.py index 1a3bb6f5d14..52b7251e123 100755 --- a/test/functional/feature_evm_contract_env_vars.py +++ b/test/functional/feature_evm_contract_env_vars.py @@ -33,7 +33,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_contracts.py b/test/functional/feature_evm_contracts.py index 80f50f060be..f4ccaa02c85 100755 --- a/test/functional/feature_evm_contracts.py +++ b/test/functional/feature_evm_contracts.py @@ -35,7 +35,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_dfi_intrinsics.py b/test/functional/feature_evm_dfi_intrinsics.py index ed9c2584a41..5ba8378ce9e 100755 --- a/test/functional/feature_evm_dfi_intrinsics.py +++ b/test/functional/feature_evm_dfi_intrinsics.py @@ -36,7 +36,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_dst20.py b/test/functional/feature_evm_dst20.py index 2750d00ab23..39b713ffca9 100755 --- a/test/functional/feature_evm_dst20.py +++ b/test/functional/feature_evm_dst20.py @@ -43,7 +43,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ] ] diff --git a/test/functional/feature_evm_eip1559_fees.py b/test/functional/feature_evm_eip1559_fees.py index 68fa10480af..2de31e39812 100644 --- a/test/functional/feature_evm_eip1559_fees.py +++ b/test/functional/feature_evm_eip1559_fees.py @@ -38,7 +38,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ] ] diff --git a/test/functional/feature_evm_fee.py b/test/functional/feature_evm_fee.py index 497a5376df1..deef1f06a62 100755 --- a/test/functional/feature_evm_fee.py +++ b/test/functional/feature_evm_fee.py @@ -34,7 +34,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_gas.py b/test/functional/feature_evm_gas.py index a1a710d37b5..38fccd532dc 100644 --- a/test/functional/feature_evm_gas.py +++ b/test/functional/feature_evm_gas.py @@ -36,7 +36,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_genesis.py b/test/functional/feature_evm_genesis.py index 39125403066..3d6eca1f7ac 100755 --- a/test/functional/feature_evm_genesis.py +++ b/test/functional/feature_evm_genesis.py @@ -38,7 +38,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] @@ -141,7 +140,6 @@ def test_start_state_from_json(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] self.stop_nodes() diff --git a/test/functional/feature_evm_logs.py b/test/functional/feature_evm_logs.py index 8b1abfda83b..79495d9b16f 100755 --- a/test/functional/feature_evm_logs.py +++ b/test/functional/feature_evm_logs.py @@ -37,7 +37,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_mempool.py b/test/functional/feature_evm_mempool.py index 208563b1903..375ebe7828e 100755 --- a/test/functional/feature_evm_mempool.py +++ b/test/functional/feature_evm_mempool.py @@ -35,7 +35,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", "-ethdebug=1", ], ] diff --git a/test/functional/feature_evm_miner.py b/test/functional/feature_evm_miner.py index 38578b74469..d33bfbffb38 100755 --- a/test/functional/feature_evm_miner.py +++ b/test/functional/feature_evm_miner.py @@ -38,7 +38,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_proxy.py b/test/functional/feature_evm_proxy.py index 521cb659ef8..2d615871d5f 100755 --- a/test/functional/feature_evm_proxy.py +++ b/test/functional/feature_evm_proxy.py @@ -34,7 +34,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_rollback.py b/test/functional/feature_evm_rollback.py index f02ce7f4c02..b5c2f41b397 100755 --- a/test/functional/feature_evm_rollback.py +++ b/test/functional/feature_evm_rollback.py @@ -31,7 +31,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", "-ethdebug=1", ], ] diff --git a/test/functional/feature_evm_rpc.py b/test/functional/feature_evm_rpc.py index f58e79e2bc6..c6dae3c75bf 100755 --- a/test/functional/feature_evm_rpc.py +++ b/test/functional/feature_evm_rpc.py @@ -40,7 +40,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", "-ethdebug=1", ], ] @@ -358,8 +357,9 @@ def test_block(self): self.nodes[0].generate(1) # Test evm tx RPC - block = self.nodes[0].getblock(self.nodes[0].getbestblockhash()) - res = self.nodes[0].getcustomtx(block["tx"][1]) + block_hash = self.nodes[0].getbestblockhash() + block = self.nodes[0].getblock(block_hash) + res = self.nodes[0].getcustomtx(block["tx"][1], block_hash) assert_equal( res["results"]["hash"], "8c99e9f053e033078e33c2756221f38fd529b914165090a615f27961de687497", diff --git a/test/functional/feature_evm_rpc_fee_history.py b/test/functional/feature_evm_rpc_fee_history.py index fe5603845f4..53444fb448b 100755 --- a/test/functional/feature_evm_rpc_fee_history.py +++ b/test/functional/feature_evm_rpc_fee_history.py @@ -42,7 +42,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_rpc_filters.py b/test/functional/feature_evm_rpc_filters.py index d4462282d93..91804964f23 100755 --- a/test/functional/feature_evm_rpc_filters.py +++ b/test/functional/feature_evm_rpc_filters.py @@ -37,7 +37,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_rpc_transaction.py b/test/functional/feature_evm_rpc_transaction.py index 4ef9d00c9d1..199c92761a2 100755 --- a/test/functional/feature_evm_rpc_transaction.py +++ b/test/functional/feature_evm_rpc_transaction.py @@ -45,7 +45,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", "-ethdebug=1", ], ] diff --git a/test/functional/feature_evm_smart_contract.py b/test/functional/feature_evm_smart_contract.py index 6ddfbc0d875..2cbff869cc4 100755 --- a/test/functional/feature_evm_smart_contract.py +++ b/test/functional/feature_evm_smart_contract.py @@ -33,7 +33,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_transaction_replacement.py b/test/functional/feature_evm_transaction_replacement.py index 22d479a962c..64145d72d74 100755 --- a/test/functional/feature_evm_transaction_replacement.py +++ b/test/functional/feature_evm_transaction_replacement.py @@ -41,7 +41,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/feature_evm_transferdomain.py b/test/functional/feature_evm_transferdomain.py index c74a4265826..0c34d60dbfc 100755 --- a/test/functional/feature_evm_transferdomain.py +++ b/test/functional/feature_evm_transferdomain.py @@ -54,7 +54,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=150", "-subsidytest=1", - "-txindex=1", ] self.extra_args = [node_args, node_args] diff --git a/test/functional/feature_evm_vmmap_rpc.py b/test/functional/feature_evm_vmmap_rpc.py index b6dc3cc88d9..4add8f8d5f0 100755 --- a/test/functional/feature_evm_vmmap_rpc.py +++ b/test/functional/feature_evm_vmmap_rpc.py @@ -40,7 +40,6 @@ def set_test_params(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ] self.extra_args = [extra_args, extra_args] diff --git a/test/functional/feature_higher_collateral_factor.py b/test/functional/feature_higher_collateral_factor.py index 424315a9de8..dff626c9267 100755 --- a/test/functional/feature_higher_collateral_factor.py +++ b/test/functional/feature_higher_collateral_factor.py @@ -23,7 +23,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", "-fortcanningroadheight=1", "-fortcanninghillheight=1", diff --git a/test/functional/feature_icx_orderbook_errors.py b/test/functional/feature_icx_orderbook_errors.py index 0a67f5bd68e..66090bde0eb 100755 --- a/test/functional/feature_icx_orderbook_errors.py +++ b/test/functional/feature_icx_orderbook_errors.py @@ -24,7 +24,6 @@ def set_test_params(self): "-bayfrontheight=50", "-eunosheight=50", "-eunospayaheight=50", - "-txindex=1", ], [ "-txnotokens=0", @@ -32,7 +31,6 @@ def set_test_params(self): "-bayfrontheight=50", "-eunosheight=50", "-eunospayaheight=50", - "-txindex=1", ], ] diff --git a/test/functional/feature_loan.py b/test/functional/feature_loan.py index f47fa1eb8c9..81f70c6a90b 100755 --- a/test/functional/feature_loan.py +++ b/test/functional/feature_loan.py @@ -26,7 +26,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], [ @@ -35,7 +34,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], ] diff --git a/test/functional/feature_loan_auctions.py b/test/functional/feature_loan_auctions.py index ceef11f01a4..cdc24ae54a5 100755 --- a/test/functional/feature_loan_auctions.py +++ b/test/functional/feature_loan_auctions.py @@ -24,7 +24,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ] ] diff --git a/test/functional/feature_loan_basics.py b/test/functional/feature_loan_basics.py index 8e6bd18528b..667813c19ce 100755 --- a/test/functional/feature_loan_basics.py +++ b/test/functional/feature_loan_basics.py @@ -28,7 +28,6 @@ def set_test_params(self): "-fortcanningheight=50", "-eunosheight=50", "-fortcanninghillheight=220", - "-txindex=1", ], [ "-txnotokens=0", @@ -37,7 +36,6 @@ def set_test_params(self): "-bayfrontgardensheight=1", "-fortcanningheight=50", "-eunosheight=50", - "-txindex=1", ], ] diff --git a/test/functional/feature_loan_deposittovault.py b/test/functional/feature_loan_deposittovault.py index 932908e4f8b..4b42dd896b6 100755 --- a/test/functional/feature_loan_deposittovault.py +++ b/test/functional/feature_loan_deposittovault.py @@ -23,7 +23,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], [ @@ -31,7 +30,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], ] diff --git a/test/functional/feature_loan_estimatecollateral.py b/test/functional/feature_loan_estimatecollateral.py index 5aef4273798..803f372e295 100755 --- a/test/functional/feature_loan_estimatecollateral.py +++ b/test/functional/feature_loan_estimatecollateral.py @@ -22,7 +22,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], ] diff --git a/test/functional/feature_loan_estimateloan.py b/test/functional/feature_loan_estimateloan.py index 500ad2fe5a2..b85a53e6d5d 100755 --- a/test/functional/feature_loan_estimateloan.py +++ b/test/functional/feature_loan_estimateloan.py @@ -22,7 +22,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ], ] diff --git a/test/functional/feature_loan_get_interest.py b/test/functional/feature_loan_get_interest.py index 243ac50172d..c278b1ff904 100755 --- a/test/functional/feature_loan_get_interest.py +++ b/test/functional/feature_loan_get_interest.py @@ -32,7 +32,6 @@ def set_test_params(self): "-fortcanningparkheight=270", "-fortcanninghillheight=300", "-eunosheight=50", - "-txindex=1", ] ] diff --git a/test/functional/feature_loan_interest.py b/test/functional/feature_loan_interest.py index 02402dbb5e9..7b78ef6a642 100755 --- a/test/functional/feature_loan_interest.py +++ b/test/functional/feature_loan_interest.py @@ -27,7 +27,6 @@ def set_test_params(self): "-eunosheight=50", "-fortcanningheight=50", "-fortcanningmuseumheight=50", - "-txindex=1", ], [ "-txnotokens=0", @@ -36,7 +35,6 @@ def set_test_params(self): "-eunosheight=50", "-fortcanningheight=50", "-fortcanningmuseumheight=50", - "-txindex=1", ], ] diff --git a/test/functional/feature_loan_listauctions.py b/test/functional/feature_loan_listauctions.py index 621e49f2aff..51a4fd9ca2e 100755 --- a/test/functional/feature_loan_listauctions.py +++ b/test/functional/feature_loan_listauctions.py @@ -23,7 +23,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", ] ] diff --git a/test/functional/feature_loan_low_interest.py b/test/functional/feature_loan_low_interest.py index b3069506ae0..248add00640 100755 --- a/test/functional/feature_loan_low_interest.py +++ b/test/functional/feature_loan_low_interest.py @@ -31,7 +31,6 @@ def set_test_params(self): "-fortcanningparkheight=5", f"-fortcanninghillheight={FCH_HEIGHT}", "-jellyfish_regtest=1", - "-txindex=1", "-simulatemainnet", ] ] diff --git a/test/functional/feature_loan_payback_dfi.py b/test/functional/feature_loan_payback_dfi.py index 3e328f722ed..fc9ca2fac50 100755 --- a/test/functional/feature_loan_payback_dfi.py +++ b/test/functional/feature_loan_payback_dfi.py @@ -29,8 +29,6 @@ def set_test_params(self): "-fortcanninghillheight=50", "-fortcanningroadheight=196", "-fortcanningspringheight=200", - "-debug=loan", - "-txindex=1", ] ] diff --git a/test/functional/feature_loan_payback_dfi_v2.py b/test/functional/feature_loan_payback_dfi_v2.py index d96e68a122c..8eecf2107ca 100755 --- a/test/functional/feature_loan_payback_dfi_v2.py +++ b/test/functional/feature_loan_payback_dfi_v2.py @@ -32,7 +32,6 @@ def set_test_params(self): "-fortcanninghillheight=50", f"-fortcanningroadheight={self.FCR_HEIGHT}", "-simulatemainnet", - "-txindex=1", "-jellyfish_regtest=1", ], ] diff --git a/test/functional/feature_loan_priceupdate.py b/test/functional/feature_loan_priceupdate.py index 9f2221918dc..00eaaefc28d 100755 --- a/test/functional/feature_loan_priceupdate.py +++ b/test/functional/feature_loan_priceupdate.py @@ -26,7 +26,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", f"-fortcanninghillheight={self.FCH}", ] diff --git a/test/functional/feature_loan_scheme.py b/test/functional/feature_loan_scheme.py index 4ab3317a1e2..b15e4066188 100755 --- a/test/functional/feature_loan_scheme.py +++ b/test/functional/feature_loan_scheme.py @@ -22,7 +22,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=110", ], [ @@ -30,7 +29,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=110", ], ] diff --git a/test/functional/feature_loan_setcollateraltoken.py b/test/functional/feature_loan_setcollateraltoken.py index 6f8eb1a9102..bc36b65e288 100755 --- a/test/functional/feature_loan_setcollateraltoken.py +++ b/test/functional/feature_loan_setcollateraltoken.py @@ -28,7 +28,6 @@ def set_test_params(self): "-fortcanningheight=50", "-fortcanninghillheight=50", "-fortcanningcrunchheight=150", - "-txindex=1", ] ] diff --git a/test/functional/feature_loan_setloantoken.py b/test/functional/feature_loan_setloantoken.py index fdbcb0a7e73..a796664808c 100755 --- a/test/functional/feature_loan_setloantoken.py +++ b/test/functional/feature_loan_setloantoken.py @@ -28,7 +28,6 @@ def set_test_params(self): "-fortcanningheight=50", "-fortcanninghillheight=50", "-fortcanningcrunchheight=110", - "-txindex=1", ] ] diff --git a/test/functional/feature_loan_vault.py b/test/functional/feature_loan_vault.py index d7558da4c8f..6603c9e4651 100755 --- a/test/functional/feature_loan_vault.py +++ b/test/functional/feature_loan_vault.py @@ -25,7 +25,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", "-fortcanninghillheight=300", "-fortcanningcrunchheight=1700", @@ -38,7 +37,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", "-fortcanninghillheight=300", "-fortcanningcrunchheight=1700", diff --git a/test/functional/feature_loan_vaultstate.py b/test/functional/feature_loan_vaultstate.py index 8fc231874a8..5a3fa851280 100755 --- a/test/functional/feature_loan_vaultstate.py +++ b/test/functional/feature_loan_vaultstate.py @@ -24,7 +24,6 @@ def set_test_params(self): "-amkheight=1", "-bayfrontheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", "-fortcanninghillheight=1", "-fortcanningcrunchheight=1", diff --git a/test/functional/feature_lock_unspends.py b/test/functional/feature_lock_unspends.py index 09c2c2e3d7a..a38c0e574c9 100755 --- a/test/functional/feature_lock_unspends.py +++ b/test/functional/feature_lock_unspends.py @@ -14,7 +14,6 @@ def set_test_params(self): self.setup_clean_chain = True self.extra_args = [ [ - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", diff --git a/test/functional/feature_negative_interest.py b/test/functional/feature_negative_interest.py index 9dfc840e17f..66fc36ae11c 100755 --- a/test/functional/feature_negative_interest.py +++ b/test/functional/feature_negative_interest.py @@ -35,7 +35,6 @@ def set_test_params(self): "-fortcanninggreatworldheight=1", "-fortcanningepilogueheight=1", "-jellyfish_regtest=1", - "-txindex=1", "-simulatemainnet=1", ] ] diff --git a/test/functional/feature_on_chain_government_voting_period_alignment.py b/test/functional/feature_on_chain_government_voting_period_alignment.py index 469a200f6ab..fd7907d49a9 100755 --- a/test/functional/feature_on_chain_government_voting_period_alignment.py +++ b/test/functional/feature_on_chain_government_voting_period_alignment.py @@ -33,7 +33,6 @@ def set_test_params(self): "-fortcanningepilogueheight=96", "-grandcentralheight=101", "-subsidytest=1", - "-txindex=1", ], [ "-dummypos=0", diff --git a/test/functional/feature_sendutxosfrom.py b/test/functional/feature_sendutxosfrom.py index 53dd707eca7..4b5c49b83de 100755 --- a/test/functional/feature_sendutxosfrom.py +++ b/test/functional/feature_sendutxosfrom.py @@ -16,8 +16,8 @@ def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True self.extra_args = [ - ["-txnotokens=0", "-amkheight=1", "-txindex=1"], - ["-txnotokens=0", "-amkheight=1", "-txindex=1"], + ["-txnotokens=0", "-amkheight=1"], + ["-txnotokens=0", "-amkheight=1"], ] def run_test(self): @@ -80,12 +80,14 @@ def run_test(self): txid = self.nodes[1].sendutxosfrom(address, to, 1.5, change) self.nodes[1].generate(1) - raw_tx = self.nodes[1].getrawtransaction(txid, 1) + get_tx = self.nodes[1].gettransaction(txid)["hex"] + raw_tx = self.nodes[1].decoderawtransaction(get_tx) # Check all inputs are from the from address for vin in raw_tx["vin"]: num = vin["vout"] - input_tx = self.nodes[1].getrawtransaction(vin["txid"], 1) + get_tx = self.nodes[1].gettransaction(vin["txid"])["hex"] + input_tx = self.nodes[1].decoderawtransaction(get_tx) assert_equal(input_tx["vout"][num]["scriptPubKey"]["addresses"][0], address) # Check change address is present @@ -100,12 +102,14 @@ def run_test(self): txid = self.nodes[1].sendutxosfrom(address, to, 1.5) self.nodes[1].generate(1) - raw_tx = self.nodes[1].getrawtransaction(txid, 1) + get_tx = self.nodes[1].gettransaction(txid)["hex"] + raw_tx = self.nodes[1].decoderawtransaction(get_tx) # Check all inputs are from the from address for vin in raw_tx["vin"]: num = vin["vout"] - input_tx = self.nodes[1].getrawtransaction(vin["txid"], 1) + get_tx = self.nodes[1].gettransaction(vin["txid"])["hex"] + input_tx = self.nodes[1].decoderawtransaction(get_tx) assert_equal(input_tx["vout"][num]["scriptPubKey"]["addresses"][0], address) # Check change address is present @@ -121,7 +125,8 @@ def run_test(self): txid = self.nodes[1].sendutxosfrom(address, to, amount) self.nodes[1].generate(2) - raw_tx = self.nodes[1].getrawtransaction(txid, 1) + get_tx = self.nodes[1].gettransaction(txid)["hex"] + raw_tx = self.nodes[1].decoderawtransaction(get_tx) # Check 'to' address is present found = False diff --git a/test/functional/feature_skip_collateral_factor_check.py b/test/functional/feature_skip_collateral_factor_check.py index 335f5661182..29e23de777c 100755 --- a/test/functional/feature_skip_collateral_factor_check.py +++ b/test/functional/feature_skip_collateral_factor_check.py @@ -19,7 +19,6 @@ def set_test_params(self): "-bayfrontheight=1", "-bayfrontgardensheight=1", "-eunosheight=1", - "-txindex=1", "-fortcanningheight=1", "-fortcanningroadheight=1", "-fortcanninghillheight=1", diff --git a/test/functional/feature_vault_pct_check_factor.py b/test/functional/feature_vault_pct_check_factor.py index 056aee4e009..a414dfe500d 100755 --- a/test/functional/feature_vault_pct_check_factor.py +++ b/test/functional/feature_vault_pct_check_factor.py @@ -46,7 +46,6 @@ def set_test_params(self): "-fortcanningepilogueheight=1", f"-grandcentralheight={self.grandcentralheight}", "-jellyfish_regtest=1", - "-txindex=1", "-simulatemainnet=1", ] ] diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 00dc310296e..4e7aea47d54 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -72,7 +72,6 @@ def run_test(self): "-grandcentralheight=101", "-metachainheight=105", "-subsidytest=1", - "-txindex=1", ], ] diff --git a/test/functional/rpc_getstoredinterest.py b/test/functional/rpc_getstoredinterest.py index d3209cfdd83..9fd19066021 100755 --- a/test/functional/rpc_getstoredinterest.py +++ b/test/functional/rpc_getstoredinterest.py @@ -40,7 +40,6 @@ def set_test_params(self): "-fortcanningspringheight=1", f"-fortcanninggreatworldheight={self.fortcanninggreatworldheight}", "-jellyfish_regtest=1", - "-txindex=1", "-simulatemainnet=1", ] ] diff --git a/test/functional/rpc_listaccounthistory.py b/test/functional/rpc_listaccounthistory.py index ad76cdeb14b..3f617ab906d 100755 --- a/test/functional/rpc_listaccounthistory.py +++ b/test/functional/rpc_listaccounthistory.py @@ -53,6 +53,7 @@ def run_test(self): {"symbol": "GOLD", "name": "gold", "collateralAddress": collateral_a} ) self.nodes[0].generate(1) + self.sync_blocks() # Make sure there's an extra token assert_equal(len(self.nodes[0].listtokens()), num_tokens + 1) @@ -69,6 +70,7 @@ def run_test(self): # Mint some tokens self.nodes[0].minttokens(["300@" + token_a]) self.nodes[0].generate(1) + self.sync_blocks(self.nodes[0:2]) # Get node 0 results results = self.nodes[0].listaccounthistory(collateral_a) @@ -81,7 +83,6 @@ def run_test(self): found = False for txs in results: assert_equal(txs["owner"], collateral_a) - self.log.info("test 0: block %d, txn is %d", txs["blockHeight"], txs["txn"]) if txs["type"] == "MintToken": found = True assert_equal(found, True) @@ -97,7 +98,6 @@ def run_test(self): collateral_a, {"maxBlockHeight": 103, "txn": 1} ) for txs in results: - self.log.info("test 1: block %d, txn is %d", txs["blockHeight"], txs["txn"]) assert_equal(txs["owner"], collateral_a) assert_equal(txs["blockHeight"] <= 103, True) if txs["blockHeight"] == 103: @@ -109,7 +109,6 @@ def run_test(self): ) for txs in results: - self.log.info("test 2: block %d, txn is %d", txs["blockHeight"], txs["txn"]) assert_equal(txs["owner"], collateral_a) assert_equal(txs["blockHeight"] <= 103, True) if txs["blockHeight"] == 103: diff --git a/test/functional/rpc_listgovproposals.py b/test/functional/rpc_listgovproposals.py index d162390b938..24ec370c99f 100755 --- a/test/functional/rpc_listgovproposals.py +++ b/test/functional/rpc_listgovproposals.py @@ -31,7 +31,6 @@ def set_test_params(self): "-fortcanningepilogueheight=1", "-grandcentralheight=1", "-subsidytest=1", - "-txindex=1", ], [ "-dummypos=0", @@ -96,16 +95,18 @@ def setup(self): # Generate chain self.nodes[0].generate(150) - self.sync_blocks() self.nodes[0].sendtoaddress(self.address1, Decimal("1.0")) self.nodes[0].sendtoaddress(self.address2, Decimal("1.0")) self.nodes[0].sendtoaddress(self.address3, Decimal("1.0")) self.nodes[0].generate(1) + self.sync_blocks() # mine at least one block with each mn to be able to vote self.nodes[1].generate(1) + self.sync_blocks() self.nodes[2].generate(1) + self.sync_blocks() self.nodes[3].generate(1) self.sync_blocks() @@ -161,8 +162,10 @@ def vote_on_proposals(self, proposals, vote="yes"): for proposal in proposals: self.nodes[0].votegov(proposal["proposalId"], self.mn0, vote) self.nodes[0].generate(1) + self.sync_blocks() self.nodes[1].votegov(proposal["proposalId"], self.mn1, vote) self.nodes[1].generate(1) + self.sync_blocks() self.nodes[2].votegov(proposal["proposalId"], self.mn2, vote) self.nodes[2].generate(1) self.sync_blocks() diff --git a/test/functional/rpc_updatemasternode.py b/test/functional/rpc_updatemasternode.py index d450f681c24..ea224faf36b 100755 --- a/test/functional/rpc_updatemasternode.py +++ b/test/functional/rpc_updatemasternode.py @@ -7,7 +7,7 @@ from test_framework.util import ( assert_equal, assert_raises_rpc_error, - fund_tx, + create_address_utxo, ) from decimal import Decimal @@ -18,7 +18,6 @@ def set_test_params(self): self.setup_clean_chain = True self.extra_args = [ [ - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", @@ -26,7 +25,6 @@ def set_test_params(self): "-grandcentralheight=110", ], [ - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", @@ -326,7 +324,6 @@ def run_test(self): [ "-gen", "-masternode_operator=" + operator_address, - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", @@ -347,7 +344,7 @@ def run_test(self): ) self.nodes[0].updatemasternode(mn_id, {"rewardAddress": ""}) - self.nodes[0].generate(1) + self.nodes[0].generate(11) # CLI Reward address for test -rewardaddress cli_reward_address = self.nodes[0].getnewaddress("", "legacy") @@ -355,10 +352,8 @@ def run_test(self): self.restart_node( 0, [ - "-gen", "-masternode_operator=" + operator_address, "-rewardaddress=" + cli_reward_address, - "-txindex=1", "-txnotokens=0", "-amkheight=50", "-bayfrontheight=50", @@ -367,19 +362,7 @@ def run_test(self): ], ) - # Mine blocks - self.nodes[0].generate(101) - - # Check balance to new reward address - assert_equal( - len(self.nodes[0].listunspent(addresses=[forced_reward_address])), 1 - ) - assert_equal( - self.nodes[0].listunspent(addresses=[forced_reward_address])[0]["amount"], - Decimal("19.00000000"), - ) - - # Test updating operator and reward address simultaniously + # Test updating operator and reward address simultaneously new_operator_address = self.nodes[0].getnewaddress("", "legacy") new_reward_address = self.nodes[0].getnewaddress("", "legacy") self.nodes[0].updatemasternode( @@ -448,11 +431,15 @@ def run_test(self): # Set up input / output tests not_collateral = self.nodes[0].getnewaddress("", "legacy") owner_address = self.nodes[0].getnewaddress("", "legacy") - [not_collateral_tx, not_collateral_vout] = fund_tx( + [not_collateral_tx, not_collateral_vout] = create_address_utxo( self.nodes[0], not_collateral, 10 ) - [missing_auth_tx, missing_input_vout] = fund_tx(self.nodes[0], mn_owner, 0.1) - [owner_auth_tx, owner_auth_vout] = fund_tx(self.nodes[0], owner_address, 0.1) + [missing_auth_tx, missing_input_vout] = create_address_utxo( + self.nodes[0], mn_owner, 0.1 + ) + [owner_auth_tx, owner_auth_vout] = create_address_utxo( + self.nodes[0], owner_address, 0.1 + ) # Get TX to use OP_RETURN output missing_tx = self.nodes[0].updatemasternode( @@ -513,9 +500,8 @@ def run_test(self): assert_equal(result["state"], "PRE_RESIGNED") # Roll back resignation - self.nodes[0].invalidateblock( - self.nodes[0].getblockhash(self.nodes[0].getblockcount()) - ) + count = self.nodes[0].getblockcount() + self.nodes[0].invalidateblock(self.nodes[0].getblockhash(count)) result = self.nodes[0].getmasternode(mn_id)[mn_id] assert_equal(result["state"], "ENABLED") diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 119fc2fb78e..924766f9700 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -779,19 +779,18 @@ def find_spendable_utxo(node, min_value): raise AssertionError("Unspent output equal or higher than %s not found" % min_value) -def fund_tx(node, address, amount): +def create_address_utxo(node, address, amount): """ Create and send new utxo of the specified amount to address. """ - missing_auth_tx = node.sendtoaddress(address, amount) - count, missing_input_vout = 0, 0 - for vout in node.getrawtransaction(missing_auth_tx, 1)["vout"]: - if vout["scriptPubKey"]["addresses"][0] == address: - missing_input_vout = count + tx = node.sendtoaddress(address, amount) + output_num = 0 + for details in node.gettransaction(tx)["details"]: + if details["address"] == address: + output_num = details["vout"] break - count += 1 node.generate(1) - return missing_auth_tx, missing_input_vout + return tx, output_num def create_lots_of_big_transactions(node, txouts, utxos, num, fee):