Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ panic = "unwind"
members = [
"nodes/*",
"pallets/*",
"rpc/did",
"rpc/did/runtime-api",
"rpc/public-credentials",
"rpc/public-credentials/runtime-api",
Expand Down
3 changes: 0 additions & 3 deletions nodes/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ substrate-build-script-utils = {git = "https://github.com/paritytech/substrate",

# Internal dependencies
clone-runtime = {path = "../../runtimes/clone"}
did-rpc = {path = "../../rpc/did"}
node-common = {path = "../common"}
pallet-did-lookup = {path = "../../pallets/pallet-did-lookup"}
peregrine-runtime = {path = "../../runtimes/peregrine"}
public-credentials = {path = "../../pallets/public-credentials"}
public-credentials-rpc = {path = "../../rpc/public-credentials"}
Expand Down Expand Up @@ -106,7 +104,6 @@ fast-gov = [
"runtime-common/fast-gov",
]
runtime-benchmarks = [
"pallet-did-lookup/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"peregrine-runtime/runtime-benchmarks",
"public-credentials/runtime-benchmarks",
Expand Down
4 changes: 0 additions & 4 deletions nodes/parachain/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

use pallet_did_lookup::linkable_account::LinkableAccountId;
use public_credentials::CredentialEntry;
use runtime_common::{
assets::AssetDid, authorization::AuthorizationId, AccountId, Balance, Block, BlockNumber, DidIdentifier, Hash,
Expand All @@ -59,7 +58,6 @@ where
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
C::Api: did_rpc::DidRuntimeApi<Block, DidIdentifier, AccountId, LinkableAccountId, Balance, Hash, BlockNumber>,
C::Api: public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Expand All @@ -68,7 +66,6 @@ where
>,
P: TransactionPool + 'static,
{
use did_rpc::{DidApiServer, DidQuery};
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use public_credentials_rpc::{PublicCredentialsApiServer, PublicCredentialsQuery};
Expand All @@ -87,7 +84,6 @@ where
// to call into the runtime.
//
// `module.merge(YourRpcStruct::new(ReferenceToClient).into_rpc())?;`
module.merge(DidQuery::new(client.clone()).into_rpc())?;
module.merge(
PublicCredentialsQuery::<
C,
Expand Down
3 changes: 0 additions & 3 deletions nodes/parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use sp_runtime::traits::BlakeTwo256;
use std::{sync::Arc, time::Duration};
use substrate_prometheus_endpoint::Registry;

use pallet_did_lookup::linkable_account::LinkableAccountId;
use public_credentials::CredentialEntry;
use runtime_common::{
assets::AssetDid, authorization::AuthorizationId, AccountId, AuthorityId, Balance, BlockNumber, DidIdentifier,
Expand Down Expand Up @@ -257,7 +256,6 @@ where
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ did_rpc::DidRuntimeApi<Block, DidIdentifier, AccountId, LinkableAccountId, Balance, Hash, BlockNumber>
+ public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Expand Down Expand Up @@ -502,7 +500,6 @@ where
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ sp_consensus_aura::AuraApi<Block, AuthorityId>
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ did_rpc::DidRuntimeApi<Block, DidIdentifier, AccountId, LinkableAccountId, Balance, Hash, BlockNumber>
+ public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Expand Down
3 changes: 0 additions & 3 deletions nodes/standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ substrate-build-script-utils = {git = "https://github.com/paritytech/substrate",
[dependencies]

# Internal dependencies
did-rpc = {path = "../../rpc/did"}
mashnet-node-runtime = {path = "../../runtimes/standalone"}
node-common = {path = "../common"}
pallet-did-lookup = {path = "../../pallets/pallet-did-lookup"}
public-credentials = {path = "../../pallets/public-credentials"}
public-credentials-rpc = {path = "../../rpc/public-credentials"}
runtime-common = {path = "../../runtimes/common"}
Expand Down Expand Up @@ -77,7 +75,6 @@ try-runtime-cli = {git = "https://github.com/paritytech/substrate", branch = "po
default = []
runtime-benchmarks = [
"mashnet-node-runtime/runtime-benchmarks",
"pallet-did-lookup/runtime-benchmarks",
"public-credentials/runtime-benchmarks",
"runtime-common/runtime-benchmarks",
]
Expand Down
4 changes: 0 additions & 4 deletions nodes/standalone/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

use pallet_did_lookup::linkable_account::LinkableAccountId;
use public_credentials::CredentialEntry;
use runtime_common::{
assets::AssetDid, authorization::AuthorizationId, AccountId, Balance, Block, BlockNumber, DidIdentifier, Hash,
Expand All @@ -59,7 +58,6 @@ where
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
C::Api: did_rpc::DidRuntimeApi<Block, DidIdentifier, AccountId, LinkableAccountId, Balance, Hash, BlockNumber>,
C::Api: public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Expand All @@ -68,7 +66,6 @@ where
>,
P: TransactionPool + 'static,
{
use did_rpc::{DidApiServer, DidQuery};
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use public_credentials_rpc::{PublicCredentialsApiServer, PublicCredentialsQuery};
Expand All @@ -88,7 +85,6 @@ where
// to call into the runtime.
//
// `module.merge(YourRpcStruct::new(ReferenceToClient).into_rpc())?;`
module.merge(DidQuery::new(client.clone()).into_rpc())?;
module.merge(
PublicCredentialsQuery::<
C,
Expand Down
27 changes: 0 additions & 27 deletions rpc/did/Cargo.toml

This file was deleted.

12 changes: 10 additions & 2 deletions rpc/did/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub type RawDidLinkedInfo<DidIdentifier, AccountId, LinkableAccountId, Balance,
>;

sp_api::decl_runtime_apis! {
/// The API to query account nonce (aka transaction index).
#[api_version(2)]
/// The API to query DID information.
pub trait DidApi<DidIdentifier, AccountId, LinkableAccountId, Balance, Key: Ord, BlockNumber> where
DidIdentifier: Codec,
AccountId: Codec,
Expand All @@ -118,20 +119,27 @@ sp_api::decl_runtime_apis! {
/// * the web3name (optional)
/// * associated accounts
/// * service endpoints
#[changed_in(2)]
fn query_did_by_w3n(name: Vec<u8>) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, AccountId, Balance, Key, BlockNumber>>;
fn query_did_by_w3n(name: Vec<u8>) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, LinkableAccountId, Balance, Key, BlockNumber>>;
/// Given an account address this returns:
/// * the DID
/// * public keys stored for the did
/// * the web3name (optional)
/// * associated accounts
/// * service endpoints
// See https://paritytech.github.io/substrate/master/sp_api/macro.decl_runtime_apis.html#declaring-multiple-api-versions for more details
#[changed_in(2)]
fn query_did_by_account_id(account: AccountId) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, AccountId, Balance, Key, BlockNumber>>;
fn query_did_by_account_id(account: LinkableAccountId) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, LinkableAccountId, Balance, Key, BlockNumber>>;
/// Given a did this returns:
/// * the DID
/// * public keys stored for the did
/// * the web3name (optional)
/// * associated accounts
/// * service endpoints
fn query_did(did: DidIdentifier) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, LinkableAccountId,Balance, Key, BlockNumber>>;
#[changed_in(2)]
fn query_did(did: DidIdentifier) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, AccountId, Balance, Key, BlockNumber>>;
fn query_did(did: DidIdentifier) -> Option<RawDidLinkedInfo<DidIdentifier, AccountId, LinkableAccountId, Balance, Key, BlockNumber>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a changed_in flag for this call as well then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true! I think all of them must be marked as deprecated. Good catch!

}
}
Loading