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
28 changes: 2 additions & 26 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 @@ -6,7 +6,6 @@ members = [
"nodes/*",
"pallets/*",
"rpc/did/runtime-api",
"rpc/public-credentials",
"rpc/public-credentials/runtime-api",
"runtimes/*",
"support",
Expand Down
18 changes: 0 additions & 18 deletions nodes/common/Cargo.toml

This file was deleted.

86 changes: 0 additions & 86 deletions nodes/common/src/public_credentials.rs

This file was deleted.

2 changes: 0 additions & 2 deletions nodes/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ substrate-build-script-utils = {git = "https://github.com/paritytech/substrate",

# Internal dependencies
clone-runtime = {path = "../../runtimes/clone"}
node-common = {path = "../common"}
peregrine-runtime = {path = "../../runtimes/peregrine"}
public-credentials = {path = "../../pallets/public-credentials"}
public-credentials-rpc = {path = "../../rpc/public-credentials"}
runtime-common = {path = "../../runtimes/common"}
spiritnet-runtime = {path = "../../runtimes/spiritnet"}

Expand Down
43 changes: 2 additions & 41 deletions nodes/parachain/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

use public_credentials::CredentialEntry;
use runtime_common::{
assets::AssetDid, authorization::AuthorizationId, AccountId, Balance, Block, BlockNumber, DidIdentifier, Hash,
Index,
};
use runtime_common::{AccountId, Balance, Block, Index};

/// Full client dependencies.
pub struct FullDeps<C, P> {
Expand All @@ -58,17 +54,10 @@ 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: public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Hash,
CredentialEntry<Hash, DidIdentifier, BlockNumber, AccountId, Balance, AuthorizationId<Hash>>,
>,
P: TransactionPool + 'static,
{
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use public_credentials_rpc::{PublicCredentialsApiServer, PublicCredentialsQuery};

let mut module = RpcModule::new(());
let FullDeps {
Expand All @@ -78,40 +67,12 @@ where
} = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;
// Extend this RPC with a custom API by using the following syntax.
// `YourRpcStruct` should have a reference to a client, which is needed
// to call into the runtime.
//
// `module.merge(YourRpcStruct::new(ReferenceToClient).into_rpc())?;`
module.merge(
PublicCredentialsQuery::<
C,
Block,
// Input subject ID
String,
// Runtime subject ID
AssetDid,
// Input/output credential ID
Hash,
// Runtime credential ID
Hash,
// Input/output credential entry
node_common::OuterCredentialEntry<
Hash,
DidIdentifier,
BlockNumber,
AccountId,
Balance,
AuthorizationId<Hash>,
>,
// Runtime credential entry
CredentialEntry<Hash, DidIdentifier, BlockNumber, AccountId, Balance, AuthorizationId<Hash>>,
// Credential filter
node_common::PublicCredentialFilter<Hash, DidIdentifier>,
>::new(client)
.into_rpc(),
)?;

Ok(module)
}
22 changes: 3 additions & 19 deletions nodes/parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ use sp_runtime::traits::BlakeTwo256;
use std::{sync::Arc, time::Duration};
use substrate_prometheus_endpoint::Registry;

use public_credentials::CredentialEntry;
use runtime_common::{
assets::AssetDid, authorization::AuthorizationId, AccountId, AuthorityId, Balance, BlockNumber, DidIdentifier,
Index,
};
use runtime_common::{AccountId, AuthorityId, Balance, BlockNumber, Index};

type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;
pub type Block = sp_runtime::generic::Block<Header, sp_runtime::OpaqueExtrinsic>;
Expand Down Expand Up @@ -255,13 +251,7 @@ where
+ sp_block_builder::BlockBuilder<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Hash,
CredentialEntry<Hash, DidIdentifier, BlockNumber, AccountId, Balance, AuthorizationId<Hash>>,
>,
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
Executor: sc_executor::NativeExecutionDispatch + 'static,
RB: FnOnce(
Expand Down Expand Up @@ -499,13 +489,7 @@ where
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ sp_consensus_aura::AuraApi<Block, AuthorityId>
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ public_credentials_rpc::PublicCredentialsRuntimeApi<
Block,
AssetDid,
Hash,
CredentialEntry<Hash, DidIdentifier, BlockNumber, AccountId, Balance, AuthorizationId<Hash>>,
>,
+ cumulus_primitives_core::CollectCollationInfo<Block>,
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>: sp_api::StateBackend<BlakeTwo256>,
{
start_node_impl::<API, RE, _, _, _>(
Expand Down
2 changes: 0 additions & 2 deletions nodes/standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ substrate-build-script-utils = {git = "https://github.com/paritytech/substrate",

# Internal dependencies
mashnet-node-runtime = {path = "../../runtimes/standalone"}
node-common = {path = "../common"}
public-credentials = {path = "../../pallets/public-credentials"}
public-credentials-rpc = {path = "../../rpc/public-credentials"}
runtime-common = {path = "../../runtimes/common"}

# External dependencies
Expand Down
Loading