def METHOD_NAME(self, base_wallet, test_wallet, encrypt=False):
    default = self.nodes[0].get_wallet_rpc(self.default_wallet_name)
    # The first address should be known by both wallets.
    addr1 = base_wallet.getnewaddress()
    assert test_wallet.getaddressinfo(addr1)["ismine"]
    # The address at index 9 is the first address that the test wallet will not know initially
    for _ in range(0, 9):
        base_wallet.getnewaddress()
    addr2 = base_wallet.getnewaddress()
    assert not test_wallet.getaddressinfo(addr2)["ismine"]
    # Send to first address on the old seed
    txid = default.sendtoaddress(addr1, 10)
    self.generate(self.nodes[0], 1)
    # Wait for the test wallet to see the transaction
    while True:
        try:
            test_wallet.gettransaction(txid)
            break
        except JSONRPCException:
            time.sleep(0.1)
    if encrypt:
        # The test wallet will not be able to generate the topped up keypool
        # until it is unlocked. So it still should not know about the second address
        assert not test_wallet.getaddressinfo(addr2)["ismine"]
        test_wallet.walletpassphrase("pass", 1)
    # The test wallet should now know about the second address as it
    # should have generated it in the inactive chain's keypool
    assert test_wallet.getaddressinfo(addr2)["ismine"]
    # Send to second address on the old seed
    txid = default.sendtoaddress(addr2, 10)
    self.generate(self.nodes[0], 1)
    test_wallet.gettransaction(txid)