mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 17:55:20 +00:00
lnbase: avoid reimplementing int.to_bytes
This commit is contained in:
parent
24d52009b0
commit
bea30e7da1
1 changed files with 1 additions and 2 deletions
|
@ -16,7 +16,6 @@ import hmac
|
||||||
import cryptography.hazmat.primitives.ciphers.aead as AEAD
|
import cryptography.hazmat.primitives.ciphers.aead as AEAD
|
||||||
|
|
||||||
from electrum.bitcoin import public_key_from_private_key, ser_to_point, point_to_ser, string_to_number
|
from electrum.bitcoin import public_key_from_private_key, ser_to_point, point_to_ser, string_to_number
|
||||||
from electrum.bitcoin import int_to_hex, bfh, rev_hex
|
|
||||||
from electrum.util import PrintError
|
from electrum.util import PrintError
|
||||||
from electrum.wallet import Wallet
|
from electrum.wallet import Wallet
|
||||||
|
|
||||||
|
@ -118,7 +117,7 @@ def encode(n, s):
|
||||||
"""Return a bytestring version of the integer
|
"""Return a bytestring version of the integer
|
||||||
value n, with a string length of s
|
value n, with a string length of s
|
||||||
"""
|
"""
|
||||||
return bfh(rev_hex(int_to_hex(n, s)))
|
return n.to_bytes(length=s, byteorder="big")
|
||||||
|
|
||||||
|
|
||||||
def H256(data):
|
def H256(data):
|
||||||
|
|
Loading…
Add table
Reference in a new issue