Closed JoeGruffins closed 4 years ago
Yeah. This is the right idea. What do you think about converting arguments based on type?
func convertHash(h):
if isinstance(h, str):
h = reversed(ByteArray(h))
return h
func getSomeTxInfo(txhi):
"""
Args:
txhi (ByteArray or str): The transaction hash, or its hexadecimal representation (the transaction ID).
"""
txHash = convertHash(txhi)
return doStuff(txHash)
User can then pass either one.
ah, I remember you saying something about that before, sorry, I completely forgot. Will make it a choice then for rpc call arguments. Anything can also be str.
isort and black differed in opinion on a long import.
Will pop off the last commit and leave it to @teknico
For all block hashes, block hex, filters, and txid use ByteArrays instead of strings.
@buck54321 ~I didn't touch any of the class/types yet, should I?~ Is what I've done so far look like what you had in mind?