replace some erroneous usages of IntFlag with IntEnum
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user