Repository navigation
refactor(nervous_system): create ic-nervous-system-agent crate for interacting with the NNS and SNSes - #1087
Merged
anchpop merged 1 commit intoAug 24, 2024
Conversation
anchpop
force-pushed
the
@anchpop/create-nervous-system-interactions-crate
branch
from
August 22, 2024 22:43
3a5fc95 to
5ece81a
Compare
anchpop
force-pushed
the
@anchpop/create-nervous-system-interactions-crate
branch
from
August 23, 2024 02:08
5ece81a to
414c387
Compare
anchpop
enabled auto-merge
August 23, 2024 17:21
jasonz-dfinity
approved these changes
Aug 23, 2024
anchpop
force-pushed
the
@anchpop/create-nervous-system-interactions-crate
branch
3 times, most recently
from
August 24, 2024 02:15
ce57b01 to
8b3eee8
Compare
anchpop
force-pushed
the
@anchpop/create-nervous-system-interactions-crate
branch
from
August 24, 2024 02:37
8b3eee8 to
7263dd2
Compare
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Aug 27, 2024
…ng with our canisters (#1091) ## Problem Making requests to canisters in rust code is quite tedious because we must get the request type, encode it, send it, check if the canister returned an error, then decode the response. It is also ## Solution Add a `Request` trait which can be used to contain the information needed to perform a request: its method string, whether it's an update call, and its response type. Check out `interactions/sns_wasm.rs` to see how much it cleans up the code. ## Notes In the future I would like to automatically generate Request implementations from our candid files or from the code that causes them to be generated, but for now they are not that bad to implement manually. Right now, I only actually implement the trait for SNS-W's api, and only use it in the `nervous_system/interaction` crate. I want to implement this trait for other canisters' types as well, and use them in canister code. [← Previous PR](#1087)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I thought it would make sense to have a crate where we would put various helper functions for interaction with SNSes and the NNS. Right now, the only rust helper functions I'm aware of are in some in
//rs/nervous_system/tools/sync-with-released-nevous-system-wasmsfor interacting with SNS-W, so I moved just those for now. There are also some that were developed for use in system tests, but they are not trivial to extract so I haven't yet.Next PR →