Skip to content

Conversation

@GuidoDipietro
Copy link
Member

@GuidoDipietro GuidoDipietro commented Jan 20, 2026

Changes Settler unit test pattern to use context() as requested in previous PRs (comes from #50).

GuidoDipietro and others added 30 commits December 17, 2025 11:25
@GuidoDipietro GuidoDipietro changed the title Solana: Test refactor Solana: Settler tests refactor Jan 20, 2026
@GuidoDipietro GuidoDipietro self-assigned this Jan 20, 2026
Base automatically changed from solana/4-settler-signatures to solana/settler January 21, 2026 15:19
Copy link
Member

@PedroAraoz PedroAraoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comments

  1. If we are going to always do &[EntityType::Solver as u8 + 1] when using the controller from the settler, I would just change the controller so the enum starts at 0.
  2. Follow the testing convention we use, you can use the EVM Settler as reference
  3. Extract repeated code into functions
  4. Always use helper functions, for example when creating the intent it is sometimes done createTestIntent but not always

Helpers.ts

Leaving this here because GH does not allow commenting on files not changed by the PR

  1. I would split it into multiple files
  2. I would split createTestIntent into one function that creates the data (like we use in the backend repo) and maybe another that sends the ix and returns the hash

@GuidoDipietro
Copy link
Member Author

Feedback about your earlier message @PedroAraoz:


  1. If we are going to always do &[EntityType::Solver as u8 + 1] when using the controller from the settler, I would just change the controller so the enum starts at 0.

Granted. Changed

  1. Follow the testing convention we use, you can use the EVM Settler as reference

Modified tests to follow that convention better, still unsure if they are properly formatted

  1. Extract repeated code into functions

Did this with everything I could, let me know if you see anything I missed

  1. Always use helper functions, for example when creating the intent it is sometimes done createTestIntent but not always

Tried to fix that as well, again let me know if I missed anything

  1. I would split it (helpers.ts) into multiple files

I split this into several files now, grouping functionality together

  1. I would split createTestIntent into one function that creates the data (like we use in the backend repo) and maybe another that sends the ix and returns the hash

Makes sense, done.

@GuidoDipietro
Copy link
Member Author

NOTE: The add_axia_sig and add_validator_sig tests still have logic on the it, but I'm refactoring them on a new PR given the logic in them will change as well.

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.

5 participants