Skip to content

Commit

Permalink
tests: add receiving functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
josibake committed Sep 11, 2023
1 parent 47a5cb0 commit 0f49043
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,10 @@ def __getattr__(self, name):
def createwallet_passthrough(self, *args, **kwargs):
return self.__getattr__("createwallet")(*args, **kwargs)

def createwallet(self, wallet_name, disable_private_keys=None, blank=None, passphrase='', avoid_reuse=None, descriptors=None, load_on_startup=None, external_signer=None):
def createwallet(self, wallet_name, disable_private_keys=None, blank=None, passphrase='', avoid_reuse=None, descriptors=None, load_on_startup=None, external_signer=None, silent_payment=None):
if descriptors is None:
descriptors = self.descriptors
return self.__getattr__('createwallet')(wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors, load_on_startup, external_signer)
return self.__getattr__('createwallet')(wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors, load_on_startup, external_signer, silent_payment)

def importprivkey(self, privkey, label=None, rescan=None):
wallet_info = self.getwalletinfo()
Expand Down
1 change: 1 addition & 0 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
'feature_maxuploadtarget.py',
'mempool_updatefromblock.py',
'mempool_persist.py --descriptors',
'wallet_silentpayments_receiving.py',
# vv Tests less than 60s vv
'rpc_psbt.py --legacy-wallet',
'rpc_psbt.py --descriptors',
Expand Down
34 changes: 34 additions & 0 deletions test/functional/wallet_silentpayments_receiving.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.descriptors import descsum_create


class SilentTransactioTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.extra_args = [[], ["-txindex=1"], []]

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
self.skip_if_no_sqlite()

def init_wallet(self, *, node):
pass

def create_silent_payments_wallet(self):

self.nodes[0].createwallet(wallet_name='sp', descriptors=True, silent_payment=True)
sp_wallet = self.nodes[0].get_wallet_rpc('sp')
address = sp_wallet.getnewaddress(address_type="silent-payment")
assert address

def run_test(self):
self.create_silent_payments_wallet()


if __name__ == '__main__':
SilentTransactioTest().main()

0 comments on commit 0f49043

Please sign in to comment.