mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
Fix missing receiving address for incoming transactions
This commit is contained in:
parent
c08bdd3c08
commit
e18c06fbcd
2 changed files with 7 additions and 4 deletions
|
@ -1485,7 +1485,7 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
|
||||
DateTime dt = DateTime.parse(tx.creationTs);
|
||||
|
||||
String? slateId = tx.txSlateId;
|
||||
String? slateId = tx.txSlateId == "null" ? null : tx.txSlateId;
|
||||
String address = slatesToCommits[slateId]
|
||||
?[tx.txType == EpicTransactionType.TxReceived ? "from" : "to"] as String? ??
|
||||
"";
|
||||
|
@ -1537,11 +1537,13 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
.valueEqualTo(address)
|
||||
.findFirst();
|
||||
|
||||
if (transactionAddress == null) {
|
||||
if (transactionAddress!.value.isEmpty) {
|
||||
if (isIncoming) {
|
||||
//Use current receiving address as address
|
||||
String receivingAddress = await currentReceivingAddress;
|
||||
transactionAddress = isar_models.Address(
|
||||
walletId: walletId,
|
||||
value: address,
|
||||
value: receivingAddress,
|
||||
publicKey: [],
|
||||
derivationIndex: 0,
|
||||
derivationPath: null,
|
||||
|
|
|
@ -277,14 +277,15 @@ abstract class LibEpiccash {
|
|||
if (result.toUpperCase().contains("ERROR")) {
|
||||
throw Exception("Error getting epic transactions ${result.toString()}");
|
||||
}
|
||||
|
||||
//Parse the returned data as an EpicTransaction
|
||||
List<EpicTransaction> finalResult = [];
|
||||
var jsonResult = json.decode(result) as List;
|
||||
|
||||
for (var tx in jsonResult) {
|
||||
EpicTransaction itemTx = EpicTransaction.fromJson(tx);
|
||||
finalResult.add(itemTx);
|
||||
}
|
||||
|
||||
return finalResult;
|
||||
} catch (e) {
|
||||
throw ("Error getting epic transactions : ${e.toString()}");
|
||||
|
|
Loading…
Reference in a new issue