tlnbase: avoid reimplementing int.to_bytes - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit fc2864cb63048047ca5a7a218921640880c0cc24
DIR parent f2066c4629a9df68193762d4fe814bee43b30b88
HTML Author: Janus <ysangkok@gmail.com>
Date: Wed, 11 Apr 2018 13:11:57 +0200
lnbase: avoid reimplementing int.to_bytes
Diffstat:
M lib/lnbase.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
DIR diff --git a/lib/lnbase.py b/lib/lnbase.py
t@@ -16,7 +16,6 @@ import hmac
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 int_to_hex, bfh, rev_hex
from electrum.util import PrintError
from electrum.wallet import Wallet
t@@ -118,7 +117,7 @@ def encode(n, s):
"""Return a bytestring version of the integer
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):