1
0

swaps: use StoredObject to store data

This commit is contained in:
ThomasV
2020-05-28 10:59:20 +02:00
parent a73f24e826
commit 3874f7ec77
3 changed files with 86 additions and 65 deletions

View File

@@ -42,6 +42,7 @@ from .lnutil import ChannelConstraints, Outpoint, ShachainElement
from .json_db import StoredDict, JsonDB, locked, modifier
from .plugin import run_hook, plugin_loaders
from .paymentrequest import PaymentRequest
from .submarine_swaps import SwapData
if TYPE_CHECKING:
from .storage import WalletStorage
@@ -1133,6 +1134,8 @@ class WalletDB(JsonDB):
v = dict((k, UpdateAddHtlc.from_tuple(*x)) for k, x in v.items())
elif key == 'fee_updates':
v = dict((k, FeeUpdate(**x)) for k, x in v.items())
elif key == 'submarine_swaps':
v = dict((k, SwapData(**x)) for k, x in v.items())
elif key == 'channel_backups':
v = dict((k, ChannelBackupStorage(**x)) for k, x in v.items())
elif key == 'tx_fees':