Repository navigation
Conversation
`sendUpdateTransaction` and `ModuleClient.createAndSendInitTransaction` built the transaction with the default of one signature before signing, so any signer producing more than one signature failed with "Too many sender signatures added to the transaction". Declare the signer's signature count on the transaction, as already done for `Token` and `Lock`.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Since 12.0.0, the contract clients cannot be used with a signer that produces more than one signature (several keys on one credential, or several credentials). The call fails before anything is sent:
sendUpdateTransactioninGenericContract.tsandModuleClient.createAndSendInitTransactionbuild the transaction with the default of one signature and then sign with the suppliedAccountSigner. Up to 11.1.1 both went throughsignTransaction, which handled any number of signatures.This affects
Contract,CIS2Contract,CIS3Contract,CIS4Contract, and the clients generated by@concordium/ccd-js-gen, since all of them route through these two functions.#679 fixed the same problem for
TokenandLock. These two call sites follow the same pattern and were not covered there.Changes
packages/sdk/src/GenericContract.tsandpackages/sdk/src/types/ModuleClient.ts: declare the signer's signature count with.addMultiSig(signer.getSignatureCount())before building, the same wayTokenandLockdo.packages/sdk/test/ci/GenericContract.test.tsandpackages/sdk/test/ci/types/ModuleClient.test.ts: new tests for contract update and contract init, each with a signer holding one key, two keys on one credential, and one key on each of two credentials.packages/sdk/CHANGELOG.md: entry under Unreleased.Testing
New tests against the unmodified source, 4 of 6 fail (the single-key cases pass):
With the fix all 6 pass.
In
packages/sdk:yarn test ./test/ci,yarn test-rn ./test/ciandyarn test-web ./test/ci: 54 suites, 749 tests pass in each configuration.yarn typecheck,yarn lintandyarn fmt-checkpass.Notes
release/p11because that is where Fix inability to useLock/Tokenwith multisig signers #679 landed.mainhas the same two call sites, andToken.sendRawthere is also still without the fix, so 12.x is affected as released. I can retarget, or open a separate PR againstmain, whichever you prefer.Checklist
hard-to-understand areas.
CLA acceptance
By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0
link: https://developers.concordium.com/CLAs/Contributor-License-Agreement-v1.0.pdf
I accept the above linked CLA.