mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
psbt: follow-ups: BCDataStream.read_bytes() should return bytes
This fixes keepkey, as in particular the code in the plugin expected TxOutpoint.txid to be bytes not a bytearray (and the TxOutpoint named tuple itself claims txid to be bytes).
This commit is contained in:
parent
cc4f6804b0
commit
46db33df75
1 changed files with 3 additions and 3 deletions
|
@ -256,11 +256,11 @@ class BCDataStream(object):
|
||||||
self.write_compact_size(len(string))
|
self.write_compact_size(len(string))
|
||||||
self.write(string)
|
self.write(string)
|
||||||
|
|
||||||
def read_bytes(self, length):
|
def read_bytes(self, length) -> bytes:
|
||||||
try:
|
try:
|
||||||
result = self.input[self.read_cursor:self.read_cursor+length]
|
result = self.input[self.read_cursor:self.read_cursor+length] # type: bytearray
|
||||||
self.read_cursor += length
|
self.read_cursor += length
|
||||||
return result
|
return bytes(result)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise SerializationError("attempt to read past end of buffer") from None
|
raise SerializationError("attempt to read past end of buffer") from None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue