Return what we internally consider the "txid" for epic transactions from the epic confirmSend to be consistent with all other coins confirmSend return value. This should fix the epic notes issue.

This commit is contained in:
julian 2022-11-08 07:35:28 -06:00
parent 2f6b1278fe
commit fa0c982274

View file

@ -833,10 +833,16 @@ class EpicCashWallet extends CoinServiceAPI {
final txLogEntryFirst = txLogEntry[0]; final txLogEntryFirst = txLogEntry[0];
Logger.print("TX_LOG_ENTRY_IS $txLogEntryFirst"); Logger.print("TX_LOG_ENTRY_IS $txLogEntryFirst");
final wallet = await Hive.openBox<dynamic>(_walletId); final wallet = await Hive.openBox<dynamic>(_walletId);
final slateToAddresses = (await wallet.get("slate_to_address")) as Map?; final slateToAddresses =
slateToAddresses?[txLogEntryFirst['tx_slate_id']] = txData['addresss']; (await wallet.get("slate_to_address")) as Map? ?? {};
final slateId = txLogEntryFirst['tx_slate_id'] as String;
slateToAddresses[slateId] = txData['addresss'];
await wallet.put('slate_to_address', slateToAddresses); await wallet.put('slate_to_address', slateToAddresses);
return txLogEntryFirst['tx_slate_id'] as String; final slatesToCommits = await getSlatesToCommits();
String? commitId = slatesToCommits[slateId]?['commitId'] as String?;
Logging.instance.log("sent commitId: $commitId", level: LogLevel.Info);
return commitId!;
// return txLogEntryFirst['tx_slate_id'] as String;
} }
} catch (e, s) { } catch (e, s) {
Logging.instance.log("Error sending $e - $s", level: LogLevel.Error); Logging.instance.log("Error sending $e - $s", level: LogLevel.Error);
@ -2155,8 +2161,9 @@ class EpicCashWallet extends CoinServiceAPI {
as String? ?? as String? ??
""; "";
String? commitId = slatesToCommits[slateId]?['commitId'] as String?; String? commitId = slatesToCommits[slateId]?['commitId'] as String?;
Logging.instance Logging.instance.log(
.log("commitId: $commitId $slateId", level: LogLevel.Info); "commitId: $commitId, slateId: $slateId, id: ${tx["id"]}",
level: LogLevel.Info);
bool isCancelled = tx["tx_type"] == "TxSentCancelled" || bool isCancelled = tx["tx_type"] == "TxSentCancelled" ||
tx["tx_type"] == "TxReceivedCancelled"; tx["tx_type"] == "TxReceivedCancelled";