Skip to content

Commit

Permalink
fix: remove Buffer from transaction signature verification (solana-la…
Browse files Browse the repository at this point in the history
  • Loading branch information
macalinao authored and nickfrosty committed Jan 4, 2023
1 parent 6534bc8 commit 9796019
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web3.js/src/transaction/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,14 +699,17 @@ export class Transaction {
/**
* @internal
*/
_verifySignatures(signData: Buffer, requireAllSignatures: boolean): boolean {
_verifySignatures(
signData: Uint8Array,
requireAllSignatures: boolean,
): boolean {
for (const {signature, publicKey} of this.signatures) {
if (signature === null) {
if (requireAllSignatures) {
return false;
}
} else {
if (!verify(signature, signData, publicKey.toBuffer())) {
if (!verify(signature, signData, publicKey.toBytes())) {
return false;
}
}
Expand Down

0 comments on commit 9796019

Please sign in to comment.