mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-11 05:14:46 +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) {
|
factory ElectrumTransactionInfo.fromJson(Map<String, dynamic> data, WalletType type) {
|
||||||
final inputAddresses = data['inputAddresses'] as List<dynamic>;
|
final inputAddresses = data['inputAddresses'] as List<dynamic>? ?? [];
|
||||||
final outputAddresses = data['outputAddresses'] as List<dynamic>;
|
final outputAddresses = data['outputAddresses'] as List<dynamic>? ?? [];
|
||||||
|
final unspents = data['unspents'] as List<dynamic>? ?? [];
|
||||||
|
|
||||||
return ElectrumTransactionInfo(
|
return ElectrumTransactionInfo(
|
||||||
type,
|
type,
|
||||||
id: data['id'] as String,
|
id: data['id'] as String,
|
||||||
|
@ -175,13 +177,11 @@ class ElectrumTransactionInfo extends TransactionInfo {
|
||||||
outputAddresses:
|
outputAddresses:
|
||||||
outputAddresses.isEmpty ? [] : outputAddresses.map((e) => e.toString()).toList(),
|
outputAddresses.isEmpty ? [] : outputAddresses.map((e) => e.toString()).toList(),
|
||||||
to: data['to'] as String?,
|
to: data['to'] as String?,
|
||||||
unspents: data['unspents'] != null
|
unspents: unspents
|
||||||
? (data['unspents'] as List<dynamic>)
|
.map((unspent) => BitcoinUnspent.fromJSON(
|
||||||
.map((unspent) => BitcoinUnspent.fromJSON(
|
BitcoinSilentPaymentAddressRecord.fromJSON(unspent['address_record'].toString()),
|
||||||
BitcoinSilentPaymentAddressRecord.fromJSON(unspent['address_record'].toString()),
|
unspent as Map<String, dynamic>))
|
||||||
unspent as Map<String, dynamic>))
|
.toList(),
|
||||||
.toList()
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue