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);
|
DateTime dt = DateTime.parse(tx.creationTs);
|
||||||
|
|
||||||
String? slateId = tx.txSlateId;
|
String? slateId = tx.txSlateId == "null" ? null : tx.txSlateId;
|
||||||
String address = slatesToCommits[slateId]
|
String address = slatesToCommits[slateId]
|
||||||
?[tx.txType == EpicTransactionType.TxReceived ? "from" : "to"] as String? ??
|
?[tx.txType == EpicTransactionType.TxReceived ? "from" : "to"] as String? ??
|
||||||
"";
|
"";
|
||||||
|
@ -1537,11 +1537,13 @@ class EpicCashWallet extends CoinServiceAPI
|
||||||
.valueEqualTo(address)
|
.valueEqualTo(address)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if (transactionAddress == null) {
|
if (transactionAddress!.value.isEmpty) {
|
||||||
if (isIncoming) {
|
if (isIncoming) {
|
||||||
|
//Use current receiving address as address
|
||||||
|
String receivingAddress = await currentReceivingAddress;
|
||||||
transactionAddress = isar_models.Address(
|
transactionAddress = isar_models.Address(
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
value: address,
|
value: receivingAddress,
|
||||||
publicKey: [],
|
publicKey: [],
|
||||||
derivationIndex: 0,
|
derivationIndex: 0,
|
||||||
derivationPath: null,
|
derivationPath: null,
|
||||||
|
|
|
@ -277,14 +277,15 @@ abstract class LibEpiccash {
|
||||||
if (result.toUpperCase().contains("ERROR")) {
|
if (result.toUpperCase().contains("ERROR")) {
|
||||||
throw Exception("Error getting epic transactions ${result.toString()}");
|
throw Exception("Error getting epic transactions ${result.toString()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Parse the returned data as an EpicTransaction
|
//Parse the returned data as an EpicTransaction
|
||||||
List<EpicTransaction> finalResult = [];
|
List<EpicTransaction> finalResult = [];
|
||||||
var jsonResult = json.decode(result) as List;
|
var jsonResult = json.decode(result) as List;
|
||||||
|
|
||||||
for (var tx in jsonResult) {
|
for (var tx in jsonResult) {
|
||||||
EpicTransaction itemTx = EpicTransaction.fromJson(tx);
|
EpicTransaction itemTx = EpicTransaction.fromJson(tx);
|
||||||
finalResult.add(itemTx);
|
finalResult.add(itemTx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return finalResult;
|
return finalResult;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw ("Error getting epic transactions : ${e.toString()}");
|
throw ("Error getting epic transactions : ${e.toString()}");
|
||||||
|
|
Loading…
Reference in a new issue