mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03:00
Merge bitcoin/bitcoin#25693: test: remove unused if statements
7ab43eb811
test: remove unused if statements (Aurèle Oulès) Pull request description: This change removes two useless if statements in a functional test. ACKs for top commit: furszy: Straightforward ACK7ab43eb8
, Tree-SHA512: 56ff472f6f53f82d35dead7181dfefa9e7545dfb989e80fb750062a517f0f3c02882db6daa115f2d844f68fac9ce58170c340cf9c9989368419b02fa7f9790e3
This commit is contained in:
commit
c991132b04
1 changed files with 8 additions and 20 deletions
|
@ -345,31 +345,19 @@ class AddressTypeTest(BitcoinTestFramework):
|
||||||
self.log.info("Nodes with addresstype=legacy never use a P2WPKH change output (unless changetype is set otherwise):")
|
self.log.info("Nodes with addresstype=legacy never use a P2WPKH change output (unless changetype is set otherwise):")
|
||||||
self.test_change_output_type(0, [to_address_bech32_1], 'legacy')
|
self.test_change_output_type(0, [to_address_bech32_1], 'legacy')
|
||||||
|
|
||||||
if self.options.descriptors:
|
self.log.info("Nodes with addresstype=p2sh-segwit match the change output")
|
||||||
self.log.info("Nodes with addresstype=p2sh-segwit match the change output")
|
self.test_change_output_type(1, [to_address_p2sh], 'p2sh-segwit')
|
||||||
self.test_change_output_type(1, [to_address_p2sh], 'p2sh-segwit')
|
self.test_change_output_type(1, [to_address_bech32_1], 'bech32')
|
||||||
self.test_change_output_type(1, [to_address_bech32_1], 'bech32')
|
self.test_change_output_type(1, [to_address_p2sh, to_address_bech32_1], 'bech32')
|
||||||
self.test_change_output_type(1, [to_address_p2sh, to_address_bech32_1], 'bech32')
|
self.test_change_output_type(1, [to_address_bech32_1, to_address_bech32_2], 'bech32')
|
||||||
self.test_change_output_type(1, [to_address_bech32_1, to_address_bech32_2], 'bech32')
|
|
||||||
else:
|
|
||||||
self.log.info("Nodes with addresstype=p2sh-segwit match the change output")
|
|
||||||
self.test_change_output_type(1, [to_address_p2sh], 'p2sh-segwit')
|
|
||||||
self.test_change_output_type(1, [to_address_bech32_1], 'bech32')
|
|
||||||
self.test_change_output_type(1, [to_address_p2sh, to_address_bech32_1], 'bech32')
|
|
||||||
self.test_change_output_type(1, [to_address_bech32_1, to_address_bech32_2], 'bech32')
|
|
||||||
|
|
||||||
self.log.info("Nodes with change_type=bech32 always use a P2WPKH change output:")
|
self.log.info("Nodes with change_type=bech32 always use a P2WPKH change output:")
|
||||||
self.test_change_output_type(2, [to_address_bech32_1], 'bech32')
|
self.test_change_output_type(2, [to_address_bech32_1], 'bech32')
|
||||||
self.test_change_output_type(2, [to_address_p2sh], 'bech32')
|
self.test_change_output_type(2, [to_address_p2sh], 'bech32')
|
||||||
|
|
||||||
if self.options.descriptors:
|
self.log.info("Nodes with addresstype=bech32 match the change output (unless changetype is set otherwise):")
|
||||||
self.log.info("Nodes with addresstype=bech32 match the change output (unless changetype is set otherwise):")
|
self.test_change_output_type(3, [to_address_bech32_1], 'bech32')
|
||||||
self.test_change_output_type(3, [to_address_bech32_1], 'bech32')
|
self.test_change_output_type(3, [to_address_p2sh], 'p2sh-segwit')
|
||||||
self.test_change_output_type(3, [to_address_p2sh], 'p2sh-segwit')
|
|
||||||
else:
|
|
||||||
self.log.info("Nodes with addresstype=bech32 match the change output (unless changetype is set otherwise):")
|
|
||||||
self.test_change_output_type(3, [to_address_bech32_1], 'bech32')
|
|
||||||
self.test_change_output_type(3, [to_address_p2sh], 'p2sh-segwit')
|
|
||||||
|
|
||||||
self.log.info('getrawchangeaddress defaults to addresstype if -changetype is not set and argument is absent')
|
self.log.info('getrawchangeaddress defaults to addresstype if -changetype is not set and argument is absent')
|
||||||
self.test_address(3, self.nodes[3].getrawchangeaddress(), multisig=False, typ='bech32')
|
self.test_address(3, self.nodes[3].getrawchangeaddress(), multisig=False, typ='bech32')
|
||||||
|
|
Loading…
Reference in a new issue