Skip to content

Commit

Permalink
rebase v2
Browse files Browse the repository at this point in the history
  • Loading branch information
vekamo committed Dec 15, 2024
2 parents adb6531 + 0accfff commit 626efb7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lib/models/isar/models/blockchain_data/v2/transaction_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
11 changes: 11 additions & 0 deletions test/services/node_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 626efb7

Please sign in to comment.