ismaelsadeeq
4142d19d74
refactor: move address_to_scriptpubkey to address.py
...
The COINBASE_MATURITY constant in blocktools.py is imported in wallet.py.
However, importing address_to_scriptpubkey to blocktools.py will
generate a circular import error. Since the method is related to
addresses, it is best to move it to address.py, which will also
fix the circular import error.
Update imports of address_to_scriptpubkey accordingly.
2 years ago
ismaelsadeeq
aac8793c7a
test: test_bech32_decode in address.py
...
Adds bech32_to_bytes() which can decode a bech32 address and return the
version as an `int` and the payload in bytes.
bech32_to_bytes() is used by the test_bech32_decode unit test to test
decoding of segwit addresses.
2 years ago
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2 years ago
Sebastian Falbesoner
1999dcfa40
test: add helpers for creating P2TR scripts/addresses from output key
2 years ago
Sebastian Falbesoner
65c49ac750
test: throw `ValueError` for invalid base58 checksum
3 years ago
Sebastian Falbesoner
605fecfb66
scripted-diff: rename `chars` to `b58chars` in test_framework.address
...
-BEGIN VERIFY SCRIPT-
sed -i 's/chars/b58chars/g' ./test/functional/test_framework/address.py
-END VERIFY SCRIPT-
3 years ago
Sebastian Falbesoner
f11dad22a5
test: refactor: remove unneeded bytes<->hex conversions in `byte_to_base58`
...
It seems like the only reason for using hex strings in this
method was to have a convenient way to convert to an integer
from the input data interpreted as big-endian.
In Python3 we have `int.from_bytes(..., 'big')` for that
purpose, hence there is no need for that anymore and we can
simply operate on bytes only.
3 years ago
fanquake
ffdab41f94
Merge bitcoin/bitcoin#23474 : test: scripted-diff cleanups after generate* changes
...
fac23c2114
scripted-diff: Bump copyright headers (MarcoFalke)
fa974f1f14
scripted-diff: Remove redundant sync_all and sync_blocks (MarcoFalke)
fad13991ae
test: Properly set sync_fun in NodeNetworkLimitedTest (MarcoFalke)
faeff57709
test: Use 4 spaces for indentation (MarcoFalke)
Pull request description:
Some cleanups after commit 94db963de5
ACKs for top commit:
fanquake:
ACK fac23c2114
Tree-SHA512: 5acfd5bb9679b41969d0fc6fc85801ccadcd6530ea692bac6352668e06fc7a9b0e1db3fd6fba435e84afe983d2eb07bd0a47c8364462bb7110004bd3d102b698
3 years ago
MarcoFalke
fac23c2114
scripted-diff: Bump copyright headers
...
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
3 years ago
Sebastian Falbesoner
041abfebe4
test: MiniWallet: add P2TR support and use it per default
3 years ago
Sebastian Falbesoner
ca6c154ef1
test: refactor: remove `hex_str_to_bytes` helper
...
Use the built-in class method bytes.fromhex() instead,
which is available since Python 3.0.
3 years ago
John Newbery
825fcae484
[tests] Replace bytes literals with hex literals
...
It's almost impossible to read bytes literals in code, so replace them
with the hex string literal and then convert them to a bytes object
using bytes.fromhex().
4 years ago
John Newbery
64eca45100
[tests] Fix pep8 style violations in address.py
4 years ago
John Newbery
b230f8b3f3
[tests] Correct docstring for address.py
4 years ago
John Newbery
ea70e6a2ca
[tests] Tidy up imports in address.py
...
No need to import twice from util.py
4 years ago
John Newbery
7f639df0b8
[tests] Remove unused optional verify_checksum parameter
...
This optional parameter is never used, so remove it.
4 years ago
John Newbery
011e784f74
[tests] Rename segwit encode and decode functions
...
These functions can be exported to other modules,
so be explicit that they're encoding and decoding
segwit addresses
4 years ago
John Newbery
e38081846d
Revert "[TESTS] Move base58 to own module to break circular dependency"
...
This reverts commit c75de5da5f
.
4 years ago
Pieter Wuille
c75de5da5f
[TESTS] Move base58 to own module to break circular dependency
...
This breaks the script->key->address->script dependency cycle.
5 years ago
10xcryptodev
60ed33904c
tests: implement base58_decode
5 years ago
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
5 years ago
MarcoFalke
aaaae4d0eb
test: Add p2p test for forcerelay permission
5 years ago
MarcoFalke
fa144e6fde
rpc: Add generatetodescriptor
5 years ago
MarcoFalke
fa25668e1c
test: Test p2sh-witness and bech32 in wallet_import_rescan
5 years ago
MarcoFalke
faa7cdf764
scripted-diff: Update copyright in ./test
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
6 years ago
MarcoFalke
fa0e65b772
scripted-diff: test: Remove brackets after assert
...
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-
6 years ago
MarcoFalke
fa6bf21f5e
scripted-diff: test: Use py3.5 bytes::hex() method
...
-BEGIN VERIFY SCRIPT-
sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str)
export RE_B_0="[^()]*" # match no bracket
export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one ()
export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (())
export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)"
sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)')
sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str)
export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)"
sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share')
sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh
-END VERIFY SCRIPT-
6 years ago
MarcoFalke
faa4043c66
qa: Run more tests with wallet disabled
6 years ago
DrahtBot
eb7daf4d60
Update copyright headers to 2018
6 years ago
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
7 years ago
Pieter Wuille
fd0041aa27
Use BIP173 addresses in segwit.py test
7 years ago
practicalswift
2e6080bbf3
Remove unused variables and/or function calls
7 years ago
John Newbery
c28ee91db0
Rename rpc-tests directory to functional
8 years ago