Closed pputnik closed 10 months ago
Similar to https://github.com/1200wd/bitcoinlib/issues/338 using BitcoindClient instead of Service:
BitcoindClient
Service
from bitcoinlib.services.bitcoind import * bdc = BitcoindClient.from_config('/path/to/bitcoin.conf') txid = "67e758b27df26ad609f943b30e5bbb270d835b737c8b3df1a7944ba08df8b9a2" t = bdc.gettransaction(txid) print(t.as_json())
The error:
self.script = Script.parse_bytes(self.unlocking_script, strict=strict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.pyenv/versions/3.11.4/lib/python3.11/site-packages/bitcoinlib/scripts.py", line 492, in parse_bytes return cls.parse_bytesio(BytesIO(script), message, tx_data, data_length, strict, _level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.pyenv/versions/3.11.4/lib/python3.11/site-packages/bitcoinlib/scripts.py", line 351, in parse_bytesio raise ScriptError(str(e)) bitcoinlib.scripts.ScriptError: Expected a sequence of 69 bytes, got 70
I tried
bdc = BitcoindClient.from_config('/path/to/bitcoin.conf', strict=False)
but got error TypeError: BitcoindClient.from_config() got an unexpected keyword argument 'strict'
TypeError: BitcoindClient.from_config() got an unexpected keyword argument 'strict'
Could you please lmk what is the workaround for this case?
The BitcoindClient was only accepting positional arguments. Now using **kwargs to accept only extra keyword arguments.
Fixed in commit d935eea0744738667e32ce4bac06c571ec679458
Similar to https://github.com/1200wd/bitcoinlib/issues/338 using
BitcoindClient
instead ofService
:The error:
I tried
but got error
TypeError: BitcoindClient.from_config() got an unexpected keyword argument 'strict'
Could you please lmk what is the workaround for this case?