Skip to content

Commit

Permalink
refactor: move helper functions to end of file
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 11, 2024
1 parent 05270f4 commit d61970a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/functional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,6 @@ export function functionalInterfaceFactory({
}
}

function convertToBlstPublicKeyArg(publicKey: PublicKeyArg): blst.PublicKeyArg {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return publicKey instanceof PublicKey ? ((publicKey as any).value as blst.PublicKey) : publicKey;
}

function convertToBlstSignatureArg(signature: SignatureArg): blst.SignatureArg {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return signature instanceof Signature ? ((signature as any).value as blst.Signature) : signature;
}

/**
* Verifies if signature is message signed with given public key.
*/
Expand Down Expand Up @@ -260,6 +250,16 @@ export function functionalInterfaceFactory({
return SecretKey.fromBytes(secretKey).toPublicKey().toBytes();
}

function convertToBlstPublicKeyArg(publicKey: PublicKeyArg): blst.PublicKeyArg {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return publicKey instanceof PublicKey ? ((publicKey as any).value as blst.PublicKey) : publicKey;
}

function convertToBlstSignatureArg(signature: SignatureArg): blst.SignatureArg {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return signature instanceof Signature ? ((signature as any).value as blst.Signature) : signature;
}

return {
sign,
aggregateSignatures,
Expand Down

0 comments on commit d61970a

Please sign in to comment.