Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 498905d

Browse files
committed
fix: update public key format and error message
1 parent 2222da1 commit 498905d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ export class SubdomainServer {
613613
const signerAddress = subdomainOp.owner
614614
615615
const newSubdomainOp = {
616-
...subdomainOp, owner: newOwner,
616+
...subdomainOp,
617+
owner: newOwner,
617618
sequenceNumber: 1, // seqn is unknown to transfer initiator
618619
signature: undefined // sig should NOT be included in hash
619620
}
@@ -623,15 +624,15 @@ export class SubdomainServer {
623624
624625
try {
625626
const publicKey = {
626-
data: publicKeyFromSignature(hash, { data: signature })
627+
data: Buffer.from(publicKeyFromSignature(hash, { data: signature }), 'hex')
627628
}
628629
const addressVersion = process.env.BSK_SUBDOMAIN_TESTNET
629630
? AddressVersion.TestnetSingleSig
630631
: AddressVersion.MainnetSingleSig
631632
const address = publicKeyToAddress(addressVersion, publicKey)
632633
633634
if (signerAddress !== address) {
634-
return `signature error: '${newOwner}' has invalid signature`
635+
return `signature error: current owner '${signerAddress}' does not match initiator '${address}'`
635636
}
636637
} catch (error) {
637638
return `signature error: ${newOwner} ${error.message}`

0 commit comments

Comments
 (0)