From 43a71b17218445ce13ac84f724486d528f7b5388 Mon Sep 17 00:00:00 2001 From: Caos Date: Sun, 24 Nov 2024 20:29:58 +0800 Subject: [PATCH] Fixed an issue where the signer could not get the correct singerIndex when preparing a payload due to prefixed addresses in the sdk. --- packages/sdk/src/encode/encode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/encode/encode.ts b/packages/sdk/src/encode/encode.ts index aaeb7508b..3c9f31408 100644 --- a/packages/sdk/src/encode/encode.ts +++ b/packages/sdk/src/encode/encode.ts @@ -69,7 +69,7 @@ const preparePayloadSignatures = (tx: Transaction) => { return tx.payloadSigs ?.map((sig: Sig) => { return { - signerIndex: signers.get(sig.address) || "", + signerIndex: signers.get(sansPrefix(sig.address)) || "", keyId: sig.keyId, sig: sig.sig, } @@ -116,7 +116,7 @@ const prepareVoucher = (voucher: Voucher) => { const prepareSigs = (sigs: Sig[]) => { return sigs .map(({address, keyId, sig}) => { - return {signerIndex: signers.get(address) || "", keyId, sig} + return {signerIndex: signers.get(sansPrefix(address)) || "", keyId, sig} }) .sort((a, b) => { if (a.signerIndex > b.signerIndex) return 1