mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
rpc: deprecate addresses
and reqSigs
from rpc outputs
1) add a new sane "address" field (for outputs that have an identifiable address, which doesn't include bare multisig) 2) with -deprecatedrpc: leave "reqSigs" and "addresses" intact (with all weird/wrong behavior they have now) 3) without -deprecatedrpc: drop "reqSigs" and "addresses" entirely, always.
This commit is contained in:
@@ -27,13 +27,13 @@ class GenerateBlockTest(BitcoinTestFramework):
|
||||
hash = node.generateblock(output=address, transactions=[])['hash']
|
||||
block = node.getblock(blockhash=hash, verbose=2)
|
||||
assert_equal(len(block['tx']), 1)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], address)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['address'], address)
|
||||
|
||||
self.log.info('Generate an empty block to a descriptor')
|
||||
hash = node.generateblock('addr(' + address + ')', [])['hash']
|
||||
block = node.getblock(blockhash=hash, verbosity=2)
|
||||
assert_equal(len(block['tx']), 1)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], address)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['address'], address)
|
||||
|
||||
self.log.info('Generate an empty block to a combo descriptor with compressed pubkey')
|
||||
combo_key = '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'
|
||||
@@ -41,7 +41,7 @@ class GenerateBlockTest(BitcoinTestFramework):
|
||||
hash = node.generateblock('combo(' + combo_key + ')', [])['hash']
|
||||
block = node.getblock(hash, 2)
|
||||
assert_equal(len(block['tx']), 1)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], combo_address)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['address'], combo_address)
|
||||
|
||||
self.log.info('Generate an empty block to a combo descriptor with uncompressed pubkey')
|
||||
combo_key = '0408ef68c46d20596cc3f6ddf7c8794f71913add807f1dc55949fa805d764d191c0b7ce6894c126fce0babc6663042f3dde9b0cf76467ea315514e5a6731149c67'
|
||||
@@ -49,7 +49,7 @@ class GenerateBlockTest(BitcoinTestFramework):
|
||||
hash = node.generateblock('combo(' + combo_key + ')', [])['hash']
|
||||
block = node.getblock(hash, 2)
|
||||
assert_equal(len(block['tx']), 1)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], combo_address)
|
||||
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['address'], combo_address)
|
||||
|
||||
# Generate 110 blocks to spend
|
||||
node.generatetoaddress(110, address)
|
||||
|
Reference in New Issue
Block a user