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

chore(boundary): add candid error types and unit tests for rate-limit canister #2746

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nikolay-komarevskiy
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the chore label Nov 21, 2024
@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/error-handling-unit-tests branch 3 times, most recently from d6736d2 to 5d8ffb2 Compare November 21, 2024 15:17
@nikolay-komarevskiy nikolay-komarevskiy marked this pull request as ready for review November 21, 2024 15:25
@nikolay-komarevskiy nikolay-komarevskiy requested a review from a team as a code owner November 21, 2024 15:25
@nikolay-komarevskiy nikolay-komarevskiy added the CI_OVERRIDE_DIDC_CHECK Skips the backwards compatibility didc check (explain in PR description why) label Nov 21, 2024
@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/error-handling-unit-tests branch from 5d8ffb2 to 4d14857 Compare November 21, 2024 15:27
@nikolay-komarevskiy nikolay-komarevskiy changed the title chore(boundary): add candid errors and unit tests to rate-limit canister chore(boundary): add candid error types and unit tests for rate-limit canister Nov 21, 2024
@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/error-handling-unit-tests branch from 4d14857 to 743b393 Compare November 21, 2024 15:29
@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/error-handling-unit-tests branch from ee99041 to 6b0a377 Compare November 23, 2024 15:21
@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/error-handling-unit-tests branch from 6b0a377 to fae7e53 Compare November 23, 2024 15:22

#[derive(CandidType, Deserialize, Debug, Clone)]
pub enum DiscloseRulesArg {
RuleIds(Vec<RuleId>),
IncidentIds(Vec<IncidentId>),
}

#[derive(CandidType, Debug, Deserialize)]
pub enum GetConfigError {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need all these errors separately? Maybe just combine in a single enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GetRulesByIncidentIdError and GetRuleByIdError could indeed be combined to avoid some overhead, but GetConfigError has different variant. My rationale to keep errors separate was for better clarify and for potential forward compatibility. This would ensure we could more easily extend/modify candid errors in the future, if we need to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was also a recommendation from the nns folks - better keep definitions separate and as flexible as possible for the potential future changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@boundary-node chore CI_OVERRIDE_DIDC_CHECK Skips the backwards compatibility didc check (explain in PR description why)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants