From 39bcd7e0aaa5a970f1aae28a6235dd0c28af91ac Mon Sep 17 00:00:00 2001 From: Diego Brito <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 24 Feb 2026 13:45:14 -0300 Subject: [PATCH 1/5] Hello World --- test/functional/feature_hello_world.py | 19 +++++++++++++++++++ test/functional/test_runner.py | 1 + 2 files changed, 20 insertions(+) create mode 100755 test/functional/feature_hello_world.py diff --git a/test/functional/feature_hello_world.py b/test/functional/feature_hello_world.py new file mode 100755 index 0000000000..c72e7bb0ee --- /dev/null +++ b/test/functional/feature_hello_world.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Hello from Floripa! :)""" +from test_framework.test_framework import BitcoinTestFramework + + +class HelloTest(BitcoinTestFramework): + def set_test_params(self): + self.num_nodes = 1 + + + def run_test(self): + self.log.info("Hello Brazil!") + + +if __name__ == "__main__": + HelloTest(__file__).main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index a4052f9102..e9f3fe1323 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -251,6 +251,7 @@ 'p2p_v2_encrypted.py', 'p2p_v2_misbehaving.py', 'example_test.py', + 'feature_hello_world.py', 'mempool_truc.py', 'wallet_multisig_descriptor_psbt.py', 'wallet_miniscript_decaying_multisig_descriptor_psbt.py', From 667645e0130d8e05c3b494b09a8f823376cf26ab Mon Sep 17 00:00:00 2001 From: Diego Brito <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:52:36 -0300 Subject: [PATCH 2/5] Add tests for wallet rpc basics --- test/functional/test_runner.py | 1 + test/functional/wallet_rpc_basics.py | 63 ++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 test/functional/wallet_rpc_basics.py diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index e9f3fe1323..ef89b7ae97 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -252,6 +252,7 @@ 'p2p_v2_misbehaving.py', 'example_test.py', 'feature_hello_world.py', + 'wallet_rpc_basics.py', 'mempool_truc.py', 'wallet_multisig_descriptor_psbt.py', 'wallet_miniscript_decaying_multisig_descriptor_psbt.py', diff --git a/test/functional/wallet_rpc_basics.py b/test/functional/wallet_rpc_basics.py new file mode 100755 index 0000000000..822a2735d3 --- /dev/null +++ b/test/functional/wallet_rpc_basics.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Test Wallet RPC basics""" + +from decimal import Decimal +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_greater_than + + +class WalletRPCBasicsTest(BitcoinTestFramework): + def set_test_params(self): + self.setup_clean_chain = True + self.num_nodes = 2 + + def skip_test_if_missing_module(self): + self.skip_if_no_wallet() + + def run_test(self): + self.nodes[0].createwallet("node0_wallet") + self.nodes[1].createwallet("node1_wallet") + + node0_wallet = self.nodes[0].get_wallet_rpc("node0_wallet") + node1_wallet = self.nodes[1].get_wallet_rpc("node1_wallet") + + node0_wallet.getbalance() + node1_wallet.getbalance() + + node0_address = node0_wallet.getnewaddress() + + self.generatetoaddress(self.nodes[0], 101, node0_address) + + assert_equal(node0_wallet.getbalance(), Decimal("50.0000000")) + + node1_address = node1_wallet.getnewaddress() + txid = node0_wallet.sendtoaddress(node1_address, "1") + + self.sync_mempools() + + node0_mempool = self.nodes[0].getrawmempool() + node1_mempool = self.nodes[1].getrawmempool() + + assert_equal(node0_mempool[0], txid) + assert_equal(node1_mempool[0], txid) + + assert_greater_than(Decimal("49.0000000"), node0_wallet.getbalance()) + + self.generatetoaddress(self.nodes[0], 1, node0_address) + + node0_mempool = self.nodes[0].getrawmempool() + node1_mempool = self.nodes[1].getrawmempool() + + assert_equal(node0_mempool, []) + assert_equal(node1_mempool, []) + + node1_balance = node1_wallet.getbalance() + + assert_equal(node1_balance, Decimal("1.00000000")) + + +if __name__ == "__main__": + WalletRPCBasicsTest(__file__).main() From 8f546d9600d4a97933e0f9c13e2d5482e8495324 Mon Sep 17 00:00:00 2001 From: Diego Brito <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:46:41 -0300 Subject: [PATCH 3/5] Test prune debug log --- test/functional/feature_prune_debug_log.py | 33 ++++++++++++++++++++++ test/functional/test_runner.py | 1 + 2 files changed, 34 insertions(+) create mode 100755 test/functional/feature_prune_debug_log.py diff --git a/test/functional/feature_prune_debug_log.py b/test/functional/feature_prune_debug_log.py new file mode 100755 index 0000000000..0704c124aa --- /dev/null +++ b/test/functional/feature_prune_debug_log.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Test Prune debug log""" + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_not_equal, assert_equal + +class PruneDebugLogTest(BitcoinTestFramework): + def set_test_params(self): + self.num_nodes = 1 + + def setup_network(self): + self.setup_nodes() + + def run_test(self): + with self.nodes[0].assert_debug_log([], ["Prune configured to target"]): + self.restart_node(0) + + is_pruned = self.nodes[0].getblockchaininfo()["pruned"] + assert_not_equal(is_pruned, True) + + with self.nodes[0].assert_debug_log(["Prune configured to target"], []): + self.restart_node(0, extra_args=["-prune=550"]) + + is_pruned = self.nodes[0].getblockchaininfo()["pruned"] + assert_equal(is_pruned, True) + + + +if __name__ == "__main__": + PruneDebugLogTest(__file__).main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index ef89b7ae97..f7a7342607 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -237,6 +237,7 @@ 'wallet_descriptor.py', 'p2p_nobloomfilter_messages.py', TEST_FRAMEWORK_UNIT_TESTS, + 'feature_prune_debug_log.py', 'p2p_filter.py', 'rpc_setban.py --v1transport', 'rpc_setban.py --v2transport', From 9c5882664a03e2ebd0d51f2b82dbb4d52411dd9e Mon Sep 17 00:00:00 2001 From: Diego Brito <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 3 Mar 2026 22:55:38 -0300 Subject: [PATCH 4/5] Add tests for MiniWallet --- test/functional/feature_miniwallet.py | 40 +++++++++++++++++++++++++++ test/functional/test_runner.py | 1 + 2 files changed, 41 insertions(+) create mode 100755 test/functional/feature_miniwallet.py diff --git a/test/functional/feature_miniwallet.py b/test/functional/feature_miniwallet.py new file mode 100755 index 0000000000..209475b22f --- /dev/null +++ b/test/functional/feature_miniwallet.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Test MiniWallet""" + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.wallet import MiniWallet +from test_framework.util import assert_greater_than, assert_equal, assert_not_equal + + +class MiniWalletTest(BitcoinTestFramework): + def set_test_params(self): + self.num_nodes = 1 + + def setup_network(self): + self.setup_nodes() + + def skip_test_if_missing_module(self): + self.skip_if_no_wallet() + + def run_test(self): + wallet = MiniWallet(self.nodes[0]) + assert_greater_than(wallet.get_balance(), 0) + + tx = wallet.send_self_transfer(from_node=self.nodes[0]) + + mempool_before = self.nodes[0].getrawmempool() + + assert_equal(tx["txid"], mempool_before[0]) + + self.generatetoaddress(self.nodes[0], 1, self.nodes[0].getnewaddress()) + + mempool_after = self.nodes[0].getrawmempool() + + assert_equal(len(mempool_after), 0) + + +if __name__ == "__main__": + MiniWalletTest(__file__).main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index f7a7342607..04a5ae0ea7 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -238,6 +238,7 @@ 'p2p_nobloomfilter_messages.py', TEST_FRAMEWORK_UNIT_TESTS, 'feature_prune_debug_log.py', + 'feature_miniwallet.py', 'p2p_filter.py', 'rpc_setban.py --v1transport', 'rpc_setban.py --v2transport', From 9ca92baec0a2faa128adbd3153b2e949794ef137 Mon Sep 17 00:00:00 2001 From: Diego Brito <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:40:21 -0300 Subject: [PATCH 5/5] Add ping pong testing --- test/functional/p2p_ping_pong.py | 30 ++++++++++++++++++++++++++++++ test/functional/test_runner.py | 1 + 2 files changed, 31 insertions(+) create mode 100755 test/functional/p2p_ping_pong.py diff --git a/test/functional/p2p_ping_pong.py b/test/functional/p2p_ping_pong.py new file mode 100755 index 0000000000..24fc5ac7b4 --- /dev/null +++ b/test/functional/p2p_ping_pong.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Test Ping Pong""" + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.p2p import P2PInterface +from test_framework.messages import msg_ping +from test_framework.util import assert_equal + + +class PingPongTest(BitcoinTestFramework): + def set_test_params(self): + self.num_nodes = 1 + + def run_test(self): + peer = self.nodes[0].add_p2p_connection(P2PInterface()) + + peer.last_message.pop("pong") + + msg = msg_ping(nonce=1234) + peer.send_without_ping(msg) + + peer.wait_until(lambda: "pong" in peer.last_message, timeout=5) + assert_equal(peer.last_message["pong"].nonce, msg.nonce) + + +if __name__ == "__main__": + PingPongTest(__file__).main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 04a5ae0ea7..f272519083 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -130,6 +130,7 @@ 'wallet_address_types.py', 'p2p_orphan_handling.py', 'wallet_basic.py', + 'p2p_ping_pong.py', 'feature_maxtipage.py', 'wallet_multiwallet.py', 'wallet_multiwallet.py --usecli',