mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
fix: silent payment txs not being restored
This commit is contained in:
parent
615db5a6d4
commit
a887ea74b5
1 changed files with 9 additions and 9 deletions
|
@ -158,8 +158,10 @@ class ElectrumTransactionInfo extends TransactionInfo {
|
|||
}
|
||||
|
||||
factory ElectrumTransactionInfo.fromJson(Map<String, dynamic> data, WalletType type) {
|
||||
final inputAddresses = data['inputAddresses'] as List<dynamic>;
|
||||
final outputAddresses = data['outputAddresses'] as List<dynamic>;
|
||||
final inputAddresses = data['inputAddresses'] as List<dynamic>? ?? [];
|
||||
final outputAddresses = data['outputAddresses'] as List<dynamic>? ?? [];
|
||||
final unspents = data['unspents'] as List<dynamic>? ?? [];
|
||||
|
||||
return ElectrumTransactionInfo(
|
||||
type,
|
||||
id: data['id'] as String,
|
||||
|
@ -175,13 +177,11 @@ class ElectrumTransactionInfo extends TransactionInfo {
|
|||
outputAddresses:
|
||||
outputAddresses.isEmpty ? [] : outputAddresses.map((e) => e.toString()).toList(),
|
||||
to: data['to'] as String?,
|
||||
unspents: data['unspents'] != null
|
||||
? (data['unspents'] as List<dynamic>)
|
||||
.map((unspent) => BitcoinUnspent.fromJSON(
|
||||
BitcoinSilentPaymentAddressRecord.fromJSON(unspent['address_record'].toString()),
|
||||
unspent as Map<String, dynamic>))
|
||||
.toList()
|
||||
: null,
|
||||
unspents: unspents
|
||||
.map((unspent) => BitcoinUnspent.fromJSON(
|
||||
BitcoinSilentPaymentAddressRecord.fromJSON(unspent['address_record'].toString()),
|
||||
unspent as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue