diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart index f05cce21e..32ade6e6b 100644 --- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart +++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart @@ -323,6 +323,40 @@ class TransactionV2 { } } + if (isMimblewimblecoinTransaction) { + if (slateId == null) { + return "Restored Funds"; + } + + if (isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Received"; + } else { + if (numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((numberOfMessages ?? 0) > 1) { + return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no) + } else { + return "Receiving ${prettyConfirms()}"; + } + } + } else if (type == TransactionType.outgoing) { + if (isConfirmed(currentChainHeight, minConfirms)) { + return "Sent (confirmed)"; + } else { + if (numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending ${prettyConfirms()}"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; diff --git a/test/services/node_service_test.dart b/test/services/node_service_test.dart index fed0f3eec..467745e7f 100644 --- a/test/services/node_service_test.dart +++ b/test/services/node_service_test.dart @@ -173,6 +173,17 @@ void main() { isFailover: true, isDown: false, ); + final nodeD = NodeModel( + host: "host3", + port: 423, + name: "btcnode", + id: "pnodeID3", + useSSL: true, + enabled: true, + coinName: "mimblewimblecoin", + isFailover: true, + isDown: false, + ); setUp(() async { await NodeService(secureStorageInterface: FakeSecureStorage())