From 41656b8bcf6be88c679de09569fe74643be10828 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 7 Jun 2023 19:00:57 +0800 Subject: [PATCH] PKG -- [sdk] Use keyID from signatures --- .changeset/cyan-forks-rest.md | 5 +++++ packages/sdk/src/resolve/resolve-signatures.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/cyan-forks-rest.md diff --git a/.changeset/cyan-forks-rest.md b/.changeset/cyan-forks-rest.md new file mode 100644 index 000000000..172f95297 --- /dev/null +++ b/.changeset/cyan-forks-rest.md @@ -0,0 +1,5 @@ +--- +"@onflow/sdk": patch +--- + +Use keyID from signatures diff --git a/packages/sdk/src/resolve/resolve-signatures.js b/packages/sdk/src/resolve/resolve-signatures.js index f6d37836c..56225aca3 100644 --- a/packages/sdk/src/resolve/resolve-signatures.js +++ b/packages/sdk/src/resolve/resolve-signatures.js @@ -39,9 +39,12 @@ function fetchSignature(ix, payload) { return async function innerFetchSignature(id) { const acct = ix.accounts[id] if (acct.signature != null) return - const {signature} = await acct.signingFunction( + const { signature, keyId } = await acct.signingFunction( buildSignable(acct, payload, ix) ) + if (!acct.role.proposer && keyId) { + ix.accounts[id].keyId = keyId + } ix.accounts[id].signature = signature } }