Skip to content

Commit

Permalink
fix: allow StructuredDataSignature type in publicKeyFromSignature*
Browse files Browse the repository at this point in the history
  • Loading branch information
whoabuddy authored and janniks committed Mar 12, 2024
1 parent 7a11d0b commit 92c9f6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/transactions/src/keys.ts
Expand Up @@ -38,6 +38,7 @@ import {
UNCOMPRESSED_PUBKEY_LENGTH_BYTES,
} from './constants';
import { hash160, hashP2PKH } from './utils';
import { StructuredDataSignature } from './structuredDataSignature';

/**
* To use secp256k1.signSync set utils.hmacSha256Sync to a function using noble-hashes
Expand Down Expand Up @@ -89,7 +90,7 @@ export function createStacksPublicKey(key: string): StacksPublicKey {

export function publicKeyFromSignatureVrs(
messageHash: string,
messageSignature: MessageSignature,
messageSignature: MessageSignature | StructuredDataSignature,
pubKeyEncoding = PubKeyEncoding.Compressed
): string {
const parsedSignature = parseRecoverableSignatureVrs(messageSignature.data);
Expand All @@ -101,7 +102,7 @@ export function publicKeyFromSignatureVrs(

export function publicKeyFromSignatureRsv(
messageHash: string,
messageSignature: MessageSignature,
messageSignature: MessageSignature | StructuredDataSignature,
pubKeyEncoding = PubKeyEncoding.Compressed
): string {
return publicKeyFromSignatureVrs(
Expand Down

0 comments on commit 92c9f6c

Please sign in to comment.