-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for multi- and custom-signatures (#376)
* Added MultiSig and CustomSig pallets * Enabled pallet_multisig in runtime * Ported pallet_custom_signatures to FRAME 2.0 * Enabled pallet_custom_signatures with Ethereum signatures on runtime * Switch to polkadot-v0.9.9 release * Added payment-info RPC service * Bump runtime version * Bump version * Updated Cargo.lock
- Loading branch information
Showing
16 changed files
with
1,589 additions
and
835 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ mod cli; | |
mod command; | ||
|
||
mod aura_upgrade; | ||
mod primitives; | ||
mod rpc; | ||
|
||
pub use cli::*; | ||
pub use command::*; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//! Opaque primitives for different parachain runtimes. | ||
|
||
pub type BlockNumber = u32; | ||
pub type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>; | ||
pub type Block = sp_runtime::generic::Block<Header, sp_runtime::OpaqueExtrinsic>; | ||
pub type Hash = sp_core::H256; | ||
pub type Balance = u128; | ||
pub type Nonce = u32; | ||
pub type AccountId = sp_runtime::AccountId32; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
//! Parachain-specific RPCs implementation. | ||
|
||
use sc_client_api::AuxStore; | ||
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; | ||
use sc_transaction_pool_api::TransactionPool; | ||
use sp_api::ProvideRuntimeApi; | ||
use sp_block_builder::BlockBuilder; | ||
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; | ||
use std::sync::Arc; | ||
|
||
use crate::primitives::*; | ||
|
||
/// A type representing all RPC extensions. | ||
pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>; | ||
|
||
/// Full client dependencies | ||
pub struct FullDeps<C, P> { | ||
/// The client instance to use. | ||
pub client: Arc<C>, | ||
/// Transaction pool instance. | ||
pub pool: Arc<P>, | ||
/// Whether to deny unsafe calls | ||
pub deny_unsafe: DenyUnsafe, | ||
} | ||
|
||
/// Instantiate all RPC extensions. | ||
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> RpcExtension | ||
where | ||
C: ProvideRuntimeApi<Block> | ||
+ HeaderBackend<Block> | ||
+ AuxStore | ||
+ HeaderMetadata<Block, Error = BlockChainError> | ||
+ Send | ||
+ Sync | ||
+ 'static, | ||
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>, | ||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>, | ||
C::Api: BlockBuilder<Block>, | ||
P: TransactionPool + Sync + Send + 'static, | ||
{ | ||
use frame_rpc_system::{FullSystem, SystemApi}; | ||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; | ||
|
||
let mut io = jsonrpc_core::IoHandler::default(); | ||
let FullDeps { | ||
client, | ||
pool, | ||
deny_unsafe, | ||
} = deps; | ||
|
||
io.extend_with(SystemApi::to_delegate(FullSystem::new( | ||
client.clone(), | ||
pool, | ||
deny_unsafe, | ||
))); | ||
io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new( | ||
client.clone(), | ||
))); | ||
|
||
io | ||
} |
Oops, something went wrong.