(3) Settler: Proposal Lifecycle #49
Open
+1,687
−20
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.
Adds instructions to the Settler for the lifecycle of a
ProposalPDA.Updates Rust program, Typescript SDK, and Typescript tests.
Instructions
create_proposalCreates an on-chain
ProposalPDA with the series of instructions that need to be executed to fulfill a given intent, along other fields (such as fees).add_instructions_to_proposalAdds more instruction to the
ProposalPDA, if transaction space was not enough oncreate_proposal(similar idea toextend_intent, see #48 for an explanation).claim_stale_proposalAllows
proposal_creatorto claim rent from one or more staleProposals (deadline in the past).Technical debt: see if
claim_stale_intentcan be refactored to "one or more" like this instruction, rename toclaim_stale_proposals.execute_proposalPartially implemented instruction.
Executes the instructions in a
Proposaland validates Intent fulfillment.This is a
TODO, and only the Accounts section of this instruction is implemented as this is out of the scope of this PR.This instruction is present here given this PR comes from a split of PR #41.
State
ProposalPDA modeling a Proposal, i.e. a series of instructions and other metadata that has to be executed on-chain to solve an Intent. Axia will be able to validate on-chain through a signature that a given Proposal is valid and can be executed.
NOTE: Some files might have content from future PRs given this series of PRs come from a larger PR that was split (#41). I have tried to keep this to a minimum but bear this in mind.