From 9b20af676a39ac9ac06a01eb3a901c139c22b79b Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Thu, 18 Jan 2024 15:14:13 -0600 Subject: [PATCH] Code review --- examples/with-solana/src/createSolanaTransfer.ts | 13 +++---------- examples/with-solana/src/index.ts | 1 - packages/solana/src/index.ts | 2 -- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/examples/with-solana/src/createSolanaTransfer.ts b/examples/with-solana/src/createSolanaTransfer.ts index 623c8d6f5..13ee644a4 100644 --- a/examples/with-solana/src/createSolanaTransfer.ts +++ b/examples/with-solana/src/createSolanaTransfer.ts @@ -17,16 +17,9 @@ export async function createAndSignTransfer(input: { toAddress: string; amount: number; turnkeyOrganizationId: string; - turnkeySolAddress: string; }): Promise { - const { - client, - fromAddress, - toAddress, - amount, - turnkeyOrganizationId, - turnkeySolAddress, - } = input; + const { client, fromAddress, toAddress, amount, turnkeyOrganizationId } = + input; const fromKey = new PublicKey(fromAddress); const toKey = new PublicKey(toAddress); @@ -47,6 +40,6 @@ export async function createAndSignTransfer(input: { organizationId: turnkeyOrganizationId, client, }); - await signer.addSignature(transferTransaction, turnkeySolAddress); + await signer.addSignature(transferTransaction, fromAddress); return transferTransaction.serialize(); } diff --git a/examples/with-solana/src/index.ts b/examples/with-solana/src/index.ts index dd2022ab8..1df4218d3 100644 --- a/examples/with-solana/src/index.ts +++ b/examples/with-solana/src/index.ts @@ -88,7 +88,6 @@ async function main() { toAddress: destination, amount: Number(amount), turnkeyOrganizationId: organizationId, - turnkeySolAddress: solAddress, }); // Broadcast the signed payload on devnet diff --git a/packages/solana/src/index.ts b/packages/solana/src/index.ts index 437249917..1b7dee36b 100644 --- a/packages/solana/src/index.ts +++ b/packages/solana/src/index.ts @@ -45,8 +45,6 @@ export class TurnkeySigner { }); } - // TODO: handle other failure types here (500? 400? How is that surfaced?) - const signature = `${result.signRawPayloadResult?.r}${result.signRawPayloadResult?.s}`; tx.addSignature(fromKey, Buffer.from(signature, "hex"));