CW-745 don't show txkey when it's unavailable (#1692)
Some checks are pending
Cache Dependencies / test (push) Waiting to run

This commit is contained in:
cyan 2024-09-22 23:16:09 +02:00 committed by GitHub
parent 4adb81c4dc
commit e2b3507134
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -319,27 +319,9 @@ class Transaction {
final txKey = monero.Wallet_getTxKey(wptr!, txid: monero.TransactionInfo_hash(txInfo));
final status = monero.Wallet_status(wptr!);
if (status != 0) {
return monero.Wallet_errorString(wptr!);
return "";
}
return breakTxKey(txKey);
}
static String breakTxKey(String input) {
final x = 64;
StringBuffer buffer = StringBuffer();
for (int i = 0; i < input.length; i += x) {
int endIndex = i + x;
if (endIndex > input.length) {
endIndex = input.length;
}
buffer.write(input.substring(i, endIndex));
if (endIndex != input.length) {
buffer.write('\n\n');
}
}
return buffer.toString().trim();
return txKey;
}
Transaction.dummy({