Skip to content

Commit

Permalink
feat: add await to all try/catch async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 22, 2024
1 parent 07ef564 commit 10f19e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/functional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function functionalInterfaceFactory({
try {
// must be in try/catch in case sig is invalid
const sig = signature instanceof Signature ? signature : Signature.fromBytes(signature);
return sig.asyncVerify(publicKey, message);
return await sig.asyncVerify(publicKey, message);
} catch (e) {
if (e instanceof NotInitializedError) throw e;
return false;
Expand All @@ -150,7 +150,7 @@ export function functionalInterfaceFactory({
if (implementation === "herumi") return verifyAggregate(publicKeys, message, signature);
try {
const sig = signature instanceof Signature ? signature : Signature.fromBytes(signature);
return sig.asyncVerifyAggregate(publicKeys, message);
return await sig.asyncVerifyAggregate(publicKeys, message);
} catch (e) {
if (e instanceof NotInitializedError) throw e;
return false;
Expand All @@ -168,7 +168,7 @@ export function functionalInterfaceFactory({
if (implementation === "herumi") return verifyMultiple(publicKeys, messages, signature);
try {
const sig = signature instanceof Signature ? signature : Signature.fromBytes(signature);
return sig.asyncVerifyMultiple(publicKeys, messages);
return await sig.asyncVerifyMultiple(publicKeys, messages);
} catch (e) {
if (e instanceof NotInitializedError) throw e;
return false;
Expand All @@ -188,7 +188,7 @@ export function functionalInterfaceFactory({
async function asyncVerifyMultipleSignatures(sets: SignatureSet[]): Promise<boolean> {
try {
if (implementation === "herumi") return Signature.verifyMultipleSignatures(sets);
return Signature.asyncVerifyMultipleSignatures(sets);
return await Signature.asyncVerifyMultipleSignatures(sets);
} catch (e) {
if (e instanceof NotInitializedError) throw e;
return false;
Expand Down

0 comments on commit 10f19e2

Please sign in to comment.