-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add ic-canister-runtime crate
#35
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
Conversation
canruntime crateic-canister-runtime crate
4fa36b1 to
9824002
Compare
9824002 to
022551c
Compare
gregorydemay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @lpahlavi ! Some minor comments.
ic-canister-runtime/src/lib.rs
Outdated
|
|
||
| /// Runtime when interacting with a canister running on the Internet Computer. | ||
| #[derive(Copy, Clone, Eq, PartialEq, Debug)] | ||
| pub struct IcRuntime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce the risk of breaking change, let's ensure that this runtime can only be instantiated by a constructor (new() + Default). I could envision that in the future we sometimes don't always want to use unbounded_wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I added an unused private field to make sure it can only be instantiated with new or default now.
|
Thanks a lot for the feedback @gregorydemay! Your comments have been addressed. |
Add
ic-canister-runtimecrate whoseRuntimetrait abstracts the canister runtime and allows code making calls to canister to be re-used:ic_cdk,PocketIc.