storage: encapsulate type conversions of stored objects using
decorators (instead of overloading JsonDB._convert_dict and _convert_value) - stored_in for elements of a StoreDict - stored_as for singletons - extra register methods are defined for key conversions This commit was adapted from the jsonpatch branch
This commit is contained in:
@@ -19,7 +19,7 @@ from .lnutil import REDEEM_AFTER_DOUBLE_SPENT_DELAY, ln_dummy_address
|
||||
from .bitcoin import dust_threshold
|
||||
from .logging import Logger
|
||||
from .lnutil import hex_to_bytes
|
||||
from .json_db import StoredObject
|
||||
from .json_db import StoredObject, stored_in
|
||||
from . import constants
|
||||
from .address_synchronizer import TX_HEIGHT_LOCAL
|
||||
from .i18n import _
|
||||
@@ -87,6 +87,7 @@ class SwapServerError(Exception):
|
||||
return _("The swap server errored or is unreachable.")
|
||||
|
||||
|
||||
@stored_in('submarine_swaps')
|
||||
@attr.s
|
||||
class SwapData(StoredObject):
|
||||
is_reverse = attr.ib(type=bool)
|
||||
|
||||
Reference in New Issue
Block a user