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

[Bug] System execute function implementation doesn't reflect definition #125

Open
notdanilo opened this issue Jan 14, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@notdanilo
Copy link
Contributor

notdanilo commented Jan 14, 2025

Describe the bug
There are two things which can add confusion to the end-user:

  1. The function signature is changed to fn execute(...) -> Result<Vec<Vec<u8>>>.
  2. #[system_input] transform the structure into #[derive(Accounts)] changing the structure with Anchor specific account definitions

Expected behavior

  1. fn execute should keep its signature
  2. The structure should look like how it was defined

Proposed solution
The internals should be moved to somewhere else. Maybe to another function calling fn execute.
The accounts structure should be generated separately and the process would looks like this:

  1. Accounts into components
  2. Get the resulting components of execute(components)
  3. Update the accounts with its respective resulting components
@notdanilo notdanilo added the bug Something isn't working label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant