Uh oh!
There was an error while loading. Please reload this page.
feat: did rpc - #348
Conversation
weichweich
left a comment
There was a problem hiding this comment.
Had to touch a lot of files unfortunately.
- all fields in DidDetails should be public. How should dependent crates use this? Create getters for everything and clone each part!?
- updated the dependencies
- fixed some features
| } | ||
| } | ||
| /// Verify that a given slice can be used as a web3 name. |
There was a problem hiding this comment.
reordered to keep the impl blocks together
| sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false} | ||
| sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false} | ||
| sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false} | ||
| pallet-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19"} |
There was a problem hiding this comment.
default-features = false is not needed and should not be used in dev-dependencies
| } | ||
| #[cfg(feature = "std")] | ||
| impl<T, S> fmt::Debug for OrderedSet<T, S> |
There was a problem hiding this comment.
we can derive RuntimeDebug. No need to implement that our self
tjwelde
commented
Apr 28, 2022
Add an example please |
ntn-x2
left a comment
There was a problem hiding this comment.
Didn't look thoroughly into it. I just had few personal opinions.
| } | ||
| } | ||
| impl did_rpc_runtime_api::DidApi< |
There was a problem hiding this comment.
Since it's used in all runtimes, why don't we move it into common? So far we have the same features deployed in all runtimes.
There was a problem hiding this comment.
yeah it's a huge chunk of code. I would like to slim it down a bit but wasn't sure how.
The issue is, since it's implemented for the runtime you can't move it out there.
The impl also has to be in the impl_runtime_apis! block.
There was a problem hiding this comment.
I could move the following to commons since it's shared between all queries.
let accounts = pallet_did_lookup::ConnectedAccounts::<Runtime>::iter_key_prefix(&owner_info.owner).collect();let service_endpoints = did::ServiceEndpoints::<Runtime>::iter_prefix(&owner_info.owner).map(|e|From::from(e.1)).collect();
did_rpc_runtime_api::RawDidDocument{identifier: owner_info.owner,w3n:Some(name.into()),
accounts,
service_endpoints,details: details.into(),}Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: William Freudenberger <william@kilt.io>
DidDocument is overloaded
ntn-x2
left a comment
There was a problem hiding this comment.
Amazingly written code... especially from a certain point on..... 🙏
fixes#2016
todo:
RPC methods not decoratedExamples
query using did
Response
query using w3n
Response
query using linked account
Response
Checklist:
array[3]useget(3), ...)