diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-15 18:43:15 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-17 15:45:34 +0100 |
commit | e57c0eb865b4ce155b5a4a2e56e46791a47e85af (patch) | |
tree | f4e7019956866b66133fdcfe918c2e78dac82ce5 /test/functional/wallet_taproot.py | |
parent | df5d783aef3e5af2d1294fc8ff9470a5dc878325 (diff) |
test: refactor: replace OP_1/OP_TRUE magic numbers by constants
Diffstat (limited to 'test/functional/wallet_taproot.py')
-rwxr-xr-x | test/functional/wallet_taproot.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/wallet_taproot.py b/test/functional/wallet_taproot.py index b22c171374..614f7e1ec0 100755 --- a/test/functional/wallet_taproot.py +++ b/test/functional/wallet_taproot.py @@ -10,7 +10,12 @@ from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal from test_framework.descriptors import descsum_create -from test_framework.script import (CScript, OP_CHECKSIG, taproot_construct) +from test_framework.script import ( + CScript, + OP_1, + OP_CHECKSIG, + taproot_construct, +) from test_framework.segwit_addr import encode_segwit_address # xprvs/xpubs, and m/* derived x-only pubkeys (created using independent implementation) @@ -165,7 +170,7 @@ def pk(hex_key): def compute_taproot_address(pubkey, scripts): """Compute the address for a taproot output with given inner key and scripts.""" tap = taproot_construct(pubkey, scripts) - assert tap.scriptPubKey[0] == 0x51 + assert tap.scriptPubKey[0] == OP_1 assert tap.scriptPubKey[1] == 0x20 return encode_segwit_address("bcrt", 1, tap.scriptPubKey[2:]) |