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

nervous-system-agent: extract 'is_canister_stopped_error' from 'CallCanisters' #10

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

rvem
Copy link
Member

@rvem rvem commented Apr 1, 2025

'is_canister_stopped' is currently used by PocketIc and ic-agent implementations. However, the 'CallCanisters' trait requires implementing this function. As a result, some trait implementations have dummy implementation for this method which panics in runtime.

To avoid runtime panic, this method is extracted into a dedicated 'CallCanistersWithStoppedCanisterError' trait that inherits 'CallCanisters'. This trait is only implemented for PocketIc and ic-agent's. An attempt to use 'is_canister_stopped_error' for other implementation will cause compilation error instead of runtime panic.

@rvem rvem requested a review from sras April 1, 2025 12:48
@rvem rvem self-assigned this Apr 1, 2025
@rvem rvem force-pushed the serokell/sns-testing branch from c0efdaf to d45a31b Compare April 7, 2025 08:52
…anisters'

'is_canister_stopped' is currently used by PocketIc and ic-agent
implementations. However, the 'CallCanisters' trait requires
implementing this function. As a result, some trait implementations have
dummy implementation for this method which panics in runtime.

To avoid runtime panic, this method is extracted into a dedicated
'CallCanistersWithStoppedCanisterError' trait that inherits
'CallCanisters'. This trait is only implemented for PocketIc and ic-agent's.
An attempt to use 'is_canister_stopped_error' for other implementation
will cause compilation error instead of runtime panic.
@rvem rvem force-pushed the rvem/extract-is-canister-stopped-error branch from 9d55b95 to aba96df Compare April 7, 2025 10:46
@rvem rvem merged commit 58207bd into serokell/sns-testing Apr 7, 2025
4 of 15 checks passed
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