Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commands are responsible for validating their parameters #8475

Closed
Tracked by #7226
shuse2 opened this issue May 22, 2023 · 1 comment
Closed
Tracked by #7226

Commands are responsible for validating their parameters #8475

shuse2 opened this issue May 22, 2023 · 1 comment
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented May 22, 2023

Expected behavior

All the params must be validated against the schema at some point.
Consider moving the schema validation into state machine where the params is decoded

Actual behavior

Steps to reproduce

N/A

Which version(s) does this affect? (Environment, OS, etc...)

6.0.0-alpha.2

@shuse2 shuse2 self-assigned this Jun 5, 2023
@Madhulearn Madhulearn added this to the Sprint 97 milestone Jun 5, 2023
@shuse2
Copy link
Collaborator Author

shuse2 commented Jun 6, 2023

the reason why the property validation was done on each module was to ensure each module is responsible for writing the test for this.
If we move the validation to the state machine, the validation becomes responsibility of state machine and on the unit test, the param validation will not be tested on each module.
In the past, there was a bug introduced the bug because of this.

Additionally, for cross-chain command, currently the params is not decoded on submitCrossChainUpdate command. Therefore, if we introduce the validation, it will be required to decode twice unless we change the context

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants