Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,30 @@ async function handleExport() {
logger.debug('Flattened transactions', { count: collectionTransactions.length });

if (isOnlyExternalSelected.value) {
const filteredTransactions: ITransaction[] = [];
for (const tx of collectionTransactions) {
const sdkTransaction = Transaction.fromBytes(hexToUint8Array(tx.transactionBytes));
const mirrorNodeLink = network.getMirrorNodeREST(network.network);
const audit = await computeSignatureKey(
sdkTransaction,
mirrorNodeLink,
accountInfoCache,
nodeInfoCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
if (audit.externalKeys.size > 0) {
filteredTransactions.push(tx);
try {
const filteredTransactions: ITransaction[] = [];
for (const tx of collectionTransactions) {
const sdkTransaction = Transaction.fromBytes(hexToUint8Array(tx.transactionBytes));
const mirrorNodeLink = network.getMirrorNodeREST(network.network);
const audit = await computeSignatureKey(
sdkTransaction,
mirrorNodeLink,
accountInfoCache,
nodeInfoCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
if (audit.externalKeys.size > 0) {
filteredTransactions.push(tx);
}
}
logger.debug('Filtered external transactions', { count: collectionTransactions.length });
Comment thread
ericleponner marked this conversation as resolved.
} catch(error) {
// Leaves filteredtransactions empty
Comment thread
ericleponner marked this conversation as resolved.
Outdated
toastManager.error('Failed to filter external transactions');
logger.error('Failed to filter external transactions: ' + error?.toString());
collectionTransactions = [];
}
collectionTransactions = filteredTransactions;

logger.debug('Filtered external transactions', { count: collectionTransactions.length });
}

show.value = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ const hasTransactionChanged = computed(() => {
(initialValidStart.compare(now) > 0 || validStart.compare(now) > 0)
) {
result = true; // validStart was updated
} else if (hasStartTimestampChanged(initialTransaction.value as Transaction, transaction.value as Transaction, now)) {
} else if (
hasStartTimestampChanged(
initialTransaction.value as Transaction,
transaction.value as Transaction,
now,
)
) {
result = true; // startTimestamp was manually updated to a future time
} else {
// whether tx data match, excluding validStart and startTimestamp
Expand Down Expand Up @@ -313,15 +319,19 @@ function basePreCreateAssert() {
}

async function updateTransactionKey() {
const computedKeys = await computeSignatureKey(
transaction.value,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
transactionKey.value = new KeyList(computedKeys.signatureKeys);
try {
const computedKeys = await computeSignatureKey(
transaction.value,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
transactionKey.value = new KeyList(computedKeys.signatureKeys);
} catch {
transactionKey.value = new KeyList();
}
Comment thread
ericleponner marked this conversation as resolved.
}

/* Hooks */
Expand Down
20 changes: 12 additions & 8 deletions front-end/src/renderer/composables/useTransactionAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ export default function useTransactionAudit(transactionId: Ref<number | null>):
if (sdkTX === null || sdkTX instanceof Error) {
result = null;
} else {
result = await computeSignatureKey(
sdkTX,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
try {
result = await computeSignatureKey(
sdkTX,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
} catch {
Comment thread
ericleponner marked this conversation as resolved.
Outdated
result = null;
}
}
return result;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@ async function fetchTransaction() {
}

if (isLoggedInOrganization(user.selectedOrganization)) {
signatureKeyObject.value = await computeSignatureKey(
sdkTransaction.value,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
try {
signatureKeyObject.value = await computeSignatureKey(
sdkTransaction.value,
network.mirrorNodeBaseURL,
accountByIdCache,
nodeByIdCache,
publicKeyOwnerCache,
user.selectedOrganization,
);
} catch {
Comment thread
ericleponner marked this conversation as resolved.
Outdated
signatureKeyObject.value = null;
}
}

feePayer.value = getTransactionPayerId(sdkTransaction.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export abstract class TransactionBaseModel<T extends SDKTransaction> {
logger.warn('Failed to resolve fee payer key', {
error,
});
throw error;
}
}

Expand All @@ -109,6 +110,7 @@ export abstract class TransactionBaseModel<T extends SDKTransaction> {
accountId,
error,
});
throw error;
}
}

Expand All @@ -130,6 +132,7 @@ export abstract class TransactionBaseModel<T extends SDKTransaction> {
accountId,
error,
});
throw error;
}
}

Expand Down Expand Up @@ -167,6 +170,7 @@ export abstract class TransactionBaseModel<T extends SDKTransaction> {
error,
nodeId,
});
throw error;
}

/* Add keys to the signature key list */
Expand Down
Loading