Browse Source
replace some erroneous usages of IntFlag with IntEnum
patch-4
SomberNight
3 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
6 additions and
5 deletions
-
electrum/lnonion.py
-
electrum/lnutil.py
-
electrum/lnworker.py
|
|
@ -26,7 +26,7 @@ |
|
|
|
import io |
|
|
|
import hashlib |
|
|
|
from typing import Sequence, List, Tuple, NamedTuple, TYPE_CHECKING, Dict, Any, Optional |
|
|
|
from enum import IntEnum, IntFlag |
|
|
|
from enum import IntEnum |
|
|
|
|
|
|
|
from . import ecc |
|
|
|
from .crypto import sha256, hmac_oneshot, chacha20_encrypt |
|
|
|
|
|
@ -821,7 +821,8 @@ def make_funding_input(local_funding_pubkey: bytes, remote_funding_pubkey: bytes |
|
|
|
c_input._trusted_value_sats = funding_sat |
|
|
|
return c_input |
|
|
|
|
|
|
|
class HTLCOwner(IntFlag): |
|
|
|
|
|
|
|
class HTLCOwner(IntEnum): |
|
|
|
LOCAL = 1 |
|
|
|
REMOTE = -LOCAL |
|
|
|
|
|
|
@ -832,7 +833,7 @@ class HTLCOwner(IntFlag): |
|
|
|
return HTLCOwner(super().__neg__()) |
|
|
|
|
|
|
|
|
|
|
|
class Direction(IntFlag): |
|
|
|
class Direction(IntEnum): |
|
|
|
SENT = -1 # in the context of HTLCs: "offered" HTLCs |
|
|
|
RECEIVED = 1 # in the context of HTLCs: "received" HTLCs |
|
|
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ from decimal import Decimal |
|
|
|
import random |
|
|
|
import time |
|
|
|
import operator |
|
|
|
from enum import IntFlag |
|
|
|
from enum import IntEnum |
|
|
|
from typing import (Optional, Sequence, Tuple, List, Set, Dict, TYPE_CHECKING, |
|
|
|
NamedTuple, Union, Mapping, Any, Iterable, AsyncGenerator, DefaultDict) |
|
|
|
import threading |
|
|
@ -152,7 +152,7 @@ FALLBACK_NODE_LIST_MAINNET = [ |
|
|
|
from .trampoline import trampolines_by_id, hardcoded_trampoline_nodes, is_hardcoded_trampoline |
|
|
|
|
|
|
|
|
|
|
|
class PaymentDirection(IntFlag): |
|
|
|
class PaymentDirection(IntEnum): |
|
|
|
SENT = 0 |
|
|
|
RECEIVED = 1 |
|
|
|
SELF_PAYMENT = 2 |
|
|
|