Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add helpers for each compressed account action #1106

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

vadorovsky
Copy link
Contributor

Remove the necessity of constructing InstructionDataInvokeCpi manually by adding utility functions for each type of singular account action:

  • Create (no inputs, only output)
    • new_compressed_account - creates an output compressed account
    • create_cpi_inputs_for_new_account
  • Update (input with old data, output with new data)
    • input_compressed_account
    • output_compressed_accoint
    • create_cpi_inputs_for_account_update
  • Delete (input with data to delete, no output)
    • input_compressed_account
    • create_cpi_inputs_for_account_deletion

While this abstraction doesn't fully hide the UTXO model full yet, it aims to make it clear which kind of inputs and outputs are needed for each action.

Remove the necessity of constructing `InstructionDataInvokeCpi` manually
by adding utility functions for each type of singular account action:

- **Create** (no inputs, only output)
  - `new_compressed_account` - creates an output compressed account
  - `create_cpi_inputs_for_new_account`
- **Update** (input with old data, output with new data)
  - `input_compressed_account`
  - `output_compressed_accoint`
  - `create_cpi_inputs_for_account_update`
- **Delete** (input with data to delete, no output)
  - `input_compressed_account`
  - `create_cpi_inputs_for_account_deletion`

While this abstraction doesn't fully hide the UTXO model full yet, it
aims to make it clear which kind of inputs and outputs are needed for
each action.
@vadorovsky vadorovsky force-pushed the vadorovsky/cpi-input-helpers branch from 14f1554 to 9e08a0b Compare August 20, 2024 10:07
@SwenSchaeferjohann SwenSchaeferjohann merged commit 515c3a4 into main Aug 20, 2024
8 checks passed
@SwenSchaeferjohann SwenSchaeferjohann deleted the vadorovsky/cpi-input-helpers branch August 20, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants