Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_address_types.py
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | def test_desc(self, node, address, multisig, typ, utxo): | ||||
key_descs[deriv['pubkey']] = '[' + deriv['master_fingerprint'] + \ | key_descs[deriv['pubkey']] = '[' + deriv['master_fingerprint'] + \ | ||||
deriv['path'][1:] + ']' + deriv['pubkey'] | deriv['path'][1:] + ']' + deriv['pubkey'] | ||||
# Verify the descriptor checksum against the Python implementation | # Verify the descriptor checksum against the Python implementation | ||||
assert(descsum_check(info['desc'])) | assert(descsum_check(info['desc'])) | ||||
# Verify that stripping the checksum and recreating it using Python | # Verify that stripping the checksum and recreating it using Python | ||||
# roundtrips | # roundtrips | ||||
assert(info['desc'] == descsum_create(info['desc'][:-9])) | assert(info['desc'] == descsum_create(info['desc'][:-9])) | ||||
# Verify that stripping the checksum and feeding it to | |||||
# getdescriptorinfo roundtrips | |||||
assert(info['desc'] == self.nodes[0].getdescriptorinfo( | |||||
info['desc'][:-9])['descriptor']) | |||||
if not multisig and typ == 'legacy': | if not multisig and typ == 'legacy': | ||||
# P2PKH | # P2PKH | ||||
assert_equal(info['desc'], | assert_equal(info['desc'], | ||||
descsum_create("pkh({})".format(key_descs[info['pubkey']]))) | descsum_create("pkh({})".format(key_descs[info['pubkey']]))) | ||||
elif typ == 'legacy': | elif typ == 'legacy': | ||||
# P2SH-multisig | # P2SH-multisig | ||||
assert_equal(info['desc'], descsum_create("sh(multi(2,{},{}))".format( | assert_equal(info['desc'], descsum_create("sh(multi(2,{},{}))".format( | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |