Repository navigation
Conversation
Adds --squads-transaction-index, which approves the existing vault transaction at that index instead of proposing a new one, after checking it holds exactly the instructions the command builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
Adds
--squads-transaction-index, which approves an already-staged Squads vault transaction instead of proposing a new one. Before voting, the CLI rebuilds the instructions for the command and checks that the staged transaction holds exactly those.Motivation
#177 lets one member stage a transaction, but every other member then has to approve it in the Squads UI, and the UI only shows the raw instructions. With this flag, a second member runs the same test-cli command with the transaction index, and their vote only goes through if the staged transaction matches what the command would have sent. See SC-439.
This was split out of #177 so that PR only covers staging and this one can be reviewed on its own. It's based on #177's branch.
Considerations
What gets checked before approving
Multisig::approveintest-cli/src/utils/squads/mod.rsrefuses to vote unless all of the following hold:--squads-vault-indexThis is the critical part to review: the message comparison is the only thing tying a vote to the intended instructions.
Generated client
Comparing messages needs the
ProposalandVaultTransactionaccounts, so they're added back totest-cli/squads-idl/generate.mjs, along with their generated types. The message encoder goes back to going through the generatedVaultTransactionMessage, so both proposing and approving build the same struct that gets compared.Tests
Unit tests cover approving a matching transaction, opening a missing proposal, and each of the rejection cases above.
How to test
To try it end to end: stage a transaction with one member as in #177, then run the same command again as a second member with
--squads-transaction-index <index>. Changing any argument should fail with "holds different instructions than this command builds".🤖 Generated with Claude Code