Skip to content

Commit

Permalink
fix: handle private key decryption errors explicitly when sending assets
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranroneill committed Feb 29, 2024
1 parent 09b468e commit dc6043b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const submitTransactionThunk: AsyncThunk<
passwordTag: browser.runtime.id,
});

// attempt to decrypt the key suing the password
try {
decodedFromAddress = decodeAddress(fromAddress);
privateKey = await privateKeyService.getDecryptedPrivateKey(
Expand All @@ -125,7 +126,15 @@ const submitTransactionThunk: AsyncThunk<
)
);
}
} catch (error) {
logger.debug(
`${SendAssetsThunkEnum.SubmitTransaction}(): ${error.message}`
);

return rejectWithValue(error);
}

try {
return await signAndSendTransactions({
logger,
network,
Expand Down

0 comments on commit dc6043b

Please sign in to comment.