Skip to content

Commit

Permalink
fix(signer): set owner before signing data
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Apr 26, 2024
1 parent 4c89149 commit 0b558f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/contracts/warp-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ export class WarpContract<T>
}
const warpSigner = new Signature(this.warp, {
signer: async (tx: Transaction) => {
tx.setOwner(toB64Url(signer.publicKey));
const dataToSign = await tx.getSignatureData();
const signatureUint8Array = await signer.sign(dataToSign);
const signatureBuffer = Buffer.from(signatureUint8Array);
const id = sha256B64Url(signatureBuffer);
tx.setOwner(toB64Url(signer.publicKey));
tx.setSignature({
id: id,
owner: toB64Url(signer.publicKey),
Expand Down

0 comments on commit 0b558f5

Please sign in to comment.