Cumulus changes version 2 (#2313)

* ensure imbalances are properly accounted for (#2183)

* ensure imbalances are properly accounted for

* bump runtime version

* Update node/runtime/src/lib.rs

* implement contract events (#2161)

* implement contract events

* update runtime

* renaming

* update test code hash

* improve complexity details

* add deposit event base cost

* add test

* Revert "add deposit event base cost"

This reverts commit 58ec010c0f4f4f0e16935ad41da32aedd17a8c57.

* update test

* Revert "update test"

This reverts commit 6fe61a593ccf0d41f09a0b97472b28ed8751a999.

* Revert "Revert "add deposit event base cost""

This reverts commit 145e8a9bac15313a4c380aa66b94fd4d36fa3f6d.

* Fix format a bit

*  Replace Vec<u8> with [u8; 32] for contract storage key (#2184)

* Replace Vec<u8> with [u8; 32] for contract storage key

* Read storage keys from sandbox memory into fixed size buffer

* Increment `impl_version`

* Remove redundant Ok(()) and explicitly specify StorageKey buffer type (#2188)

* Switch to `derive(Encode, Decode)` for `Call` (#2178)

* Add some tests

* More tests

* Switch to `derive(Encode, Decode)` for `Call`

* Update lock files

* Simplify the macro cases

* Cache changes trie config in db storage (#2170)

* cache changes trie config in db storage

* Update core/client/db/src/lib.rs

Co-Authored-By: svyatonik <svyatonik@gmail.com>

* Update core/client/db/src/lib.rs

Co-Authored-By: svyatonik <svyatonik@gmail.com>

* Fix version check for renamed runtime api methods (#2190)

* Add feature to disable including the test-runtime wasm blob

* Enable `std` feature for `consensus_authorities`

* Implement `skip_initialize_block` and `initialize_block` for runtime api

* Add test and fixes bug

* Begin to implement support for passing the `ProofRecorder`

* Make sure proof generation works as intended

* Fixes tests

* Make `BlockBuilder` generate proofs on request.

* Adds `TestClientBuilder` to simplify creating a test client

* Add `include-wasm-blob` to `test-client` as well

* Make `test-client` compile without including the wasm file

* Disable more stuff in test-client without wasm

* Reorganize the re-exports

* Use correct bounds

* Update docs

* Update core/client/src/block_builder/block_builder.rs

Co-Authored-By: bkchr <bkchr@users.noreply.github.com>

* Extend test to actually generated proof

* Switch to enum for `skip_initialize_block`

* Some wasm files updates
This commit is contained in:
Bastian Köcher
2019-04-29 16:55:20 +02:00
committed by GitHub
parent bb9746c798
commit bad3ce4e17
27 changed files with 800 additions and 267 deletions
+2
View File
@@ -3160,12 +3160,14 @@ version = "1.0.0"
dependencies = [
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-primitives 1.0.0",
"sr-version 1.0.0",
"substrate-client 1.0.0",
"substrate-consensus-common 1.0.0",
"substrate-primitives 1.0.0",
"substrate-state-machine 1.0.0",
"substrate-test-client 1.0.0",
@@ -296,13 +296,12 @@ mod tests {
use test_client::{self, runtime::{Extrinsic, Transfer}, AccountKeyring};
fn extrinsic(nonce: u64) -> Extrinsic {
let tx = Transfer {
Transfer {
amount: Default::default(),
nonce,
from: AccountKeyring::Alice.into(),
to: Default::default(),
};
tx.into_signed_tx()
}.into_signed_tx()
}
#[test]
@@ -24,10 +24,9 @@ use runtime_primitives::traits::{
};
use primitives::{H256, ExecutionContext};
use crate::blockchain::HeaderBackend;
use crate::runtime_api::Core;
use crate::runtime_api::{Core, ApiExt};
use crate::error;
/// Utility for building new (valid) blocks from a stream of extrinsics.
pub struct BlockBuilder<'a, Block, A: ProvideRuntimeApi> where Block: BlockT {
header: <Block as BlockT>::Header,
@@ -44,12 +43,22 @@ where
{
/// Create a new instance of builder from the given client, building on the latest block.
pub fn new(api: &'a A) -> error::Result<Self> {
api.info().and_then(|i| Self::at_block(&BlockId::Hash(i.best_hash), api))
api.info().and_then(|i|
Self::at_block(&BlockId::Hash(i.best_hash), api, false)
)
}
/// Create a new instance of builder from the given client using a particular block's ID to
/// build upon.
pub fn at_block(block_id: &BlockId<Block>, api: &'a A) -> error::Result<Self> {
/// Create a new instance of builder from the given client using a
/// particular block's ID to build upon with optional proof recording enabled.
///
/// While proof recording is enabled, all accessed trie nodes are saved.
/// These recorded trie nodes can be used by a third party to proof the
/// output of this block builder without having access to the full storage.
pub fn at_block(
block_id: &BlockId<Block>,
api: &'a A,
proof_recording: bool
) -> error::Result<Self> {
let number = api.block_number_from_id(block_id)?
.ok_or_else(|| error::Error::UnknownBlock(format!("{}", block_id)))?
+ One::one();
@@ -63,8 +72,17 @@ where
parent_hash,
Default::default()
);
let api = api.runtime_api();
api.initialize_block_with_context(block_id, ExecutionContext::BlockConstruction, &header)?;
let mut api = api.runtime_api();
if proof_recording {
api.record_proof();
}
api.initialize_block_with_context(
block_id, ExecutionContext::BlockConstruction, &header
)?;
Ok(BlockBuilder {
header,
extrinsics: Vec::new(),
@@ -77,13 +95,15 @@ where
///
/// This will ensure the extrinsic can be validly executed (by executing it);
pub fn push(&mut self, xt: <Block as BlockT>::Extrinsic) -> error::Result<()> {
use crate::runtime_api::ApiExt;
let block_id = &self.block_id;
let extrinsics = &mut self.extrinsics;
self.api.map_api_result(|api| {
match api.apply_extrinsic_with_context(block_id, ExecutionContext::BlockConstruction, xt.clone())? {
match api.apply_extrinsic_with_context(
block_id,
ExecutionContext::BlockConstruction,
xt.clone()
)? {
Ok(ApplyOutcome::Success) | Ok(ApplyOutcome::Fail) => {
extrinsics.push(xt);
Ok(())
@@ -97,13 +117,34 @@ where
/// Consume the builder to return a valid `Block` containing all pushed extrinsics.
pub fn bake(mut self) -> error::Result<Block> {
self.header = self.api.finalize_block_with_context(&self.block_id, ExecutionContext::BlockConstruction)?;
self.bake_impl()?;
Ok(<Block as BlockT>::new(self.header, self.extrinsics))
}
fn bake_impl(&mut self) -> error::Result<()> {
self.header = self.api.finalize_block_with_context(
&self.block_id, ExecutionContext::BlockConstruction
)?;
debug_assert_eq!(
self.header.extrinsics_root().clone(),
HashFor::<Block>::ordered_trie_root(self.extrinsics.iter().map(Encode::encode)),
HashFor::<Block>::ordered_trie_root(
self.extrinsics.iter().map(Encode::encode)
),
);
Ok(<Block as BlockT>::new(self.header, self.extrinsics))
Ok(())
}
/// Consume the builder to return a valid `Block` containing all pushed extrinsics
/// and the generated proof.
///
/// The proof will be `Some(_)`, if proof recording was enabled while creating
/// the block builder.
pub fn bake_and_extract_proof(mut self) -> error::Result<(Block, Option<Vec<Vec<u8>>>)> {
self.bake_impl()?;
let proof = self.api.extract_proof();
Ok((<Block as BlockT>::new(self.header, self.extrinsics), proof))
}
}
+79 -57
View File
@@ -14,21 +14,25 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use std::{sync::Arc, cmp::Ord, panic::UnwindSafe, result};
use std::{sync::Arc, cmp::Ord, panic::UnwindSafe, result, cell::RefCell, rc::Rc};
use parity_codec::{Encode, Decode};
use runtime_primitives::generic::BlockId;
use runtime_primitives::traits::{Block as BlockT, RuntimeApiInfo};
use runtime_primitives::{
generic::BlockId, traits::Block as BlockT,
};
use state_machine::{
self, OverlayedChanges, Ext, CodeExecutor, ExecutionManager, ExecutionStrategy, NeverOffchainExt,
self, OverlayedChanges, Ext, CodeExecutor, ExecutionManager,
ExecutionStrategy, NeverOffchainExt, backend::Backend as _,
};
use executor::{RuntimeVersion, RuntimeInfo, NativeVersion};
use hash_db::Hasher;
use trie::MemoryDB;
use primitives::{H256, Blake2Hasher, NativeOrEncoded, NeverNativeValue, OffchainExt};
use primitives::{
H256, Blake2Hasher, NativeOrEncoded, NeverNativeValue, OffchainExt
};
use crate::runtime_api::{ProofRecorder, InitializeBlock};
use crate::backend;
use crate::error;
use crate::runtime_api::Core as CoreApi;
/// Method call executor.
pub trait CallExecutor<B, H>
@@ -60,8 +64,9 @@ where
/// Before executing the method, passed header is installed as the current header
/// of the execution context.
fn contextual_call<
'a,
O: OffchainExt,
PB: Fn() -> error::Result<B::Header>,
IB: Fn() -> error::Result<()>,
EM: Fn(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>
@@ -70,15 +75,16 @@ where
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
at: &BlockId<B>,
method: &str,
call_data: &[u8],
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<B>>,
prepare_environment_block: PB,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
side_effects_handler: Option<&mut O>,
proof_recorder: &Option<Rc<RefCell<ProofRecorder<B>>>>,
) -> error::Result<NativeOrEncoded<R>> where ExecutionManager<EM>: Clone;
/// Extract RuntimeVersion of given block
@@ -119,7 +125,10 @@ where
call_data: &[u8]
) -> Result<(Vec<u8>, Vec<Vec<u8>>), error::Error> {
let trie_state = state.try_into_trie_backend()
.ok_or_else(|| Box::new(state_machine::ExecutionError::UnableToGenerateProof) as Box<state_machine::Error>)?;
.ok_or_else(||
Box::new(state_machine::ExecutionError::UnableToGenerateProof)
as Box<state_machine::Error>
)?;
self.prove_at_trie_state(&trie_state, overlay, method, call_data)
}
@@ -172,7 +181,8 @@ where
{
type Error = E::Error;
fn call<O: OffchainExt>(&self,
fn call<O: OffchainExt>(
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
@@ -200,8 +210,9 @@ where
}
fn contextual_call<
'a,
O: OffchainExt,
PB: Fn() -> error::Result<Block::Header>,
IB: Fn() -> error::Result<()>,
EM: Fn(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>
@@ -210,64 +221,75 @@ where
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<Block>>,
prepare_environment_block: PB,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, Block>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
mut side_effects_handler: Option<&mut O>,
side_effects_handler: Option<&mut O>,
recorder: &Option<Rc<RefCell<ProofRecorder<Block>>>>,
) -> Result<NativeOrEncoded<R>, error::Error> where ExecutionManager<EM>: Clone {
match initialize_block {
InitializeBlock::Do(ref init_block)
if init_block.borrow().as_ref().map(|id| id != at).unwrap_or(true) => {
initialize_block_fn()?;
},
// We don't need to initialize the runtime at a block.
_ => {},
}
let state = self.backend.state_at(*at)?;
let core_version = self.runtime_version(at)?.apis.iter().find(|a| a.0 == CoreApi::<Block>::ID).map(|a| a.1);
let init_block_function = if core_version < Some(2) {
"Core_initialise_block"
} else {
"Core_initialize_block"
};
match recorder {
Some(recorder) => {
let trie_state = state.try_into_trie_backend()
.ok_or_else(||
Box::new(state_machine::ExecutionError::UnableToGenerateProof)
as Box<state_machine::Error>
)?;
if method != init_block_function && initialized_block.map(|id| id != *at).unwrap_or(true) {
let header = prepare_environment_block()?;
state_machine::new(
let backend = state_machine::ProvingBackend::new_with_recorder(
&trie_state,
recorder.clone()
);
state_machine::new(
&backend,
self.backend.changes_trie_storage(),
side_effects_handler,
&mut *changes.borrow_mut(),
&self.executor,
method,
call_data,
)
.execute_using_consensus_failure_handler(
execution_manager,
false,
native_call,
)
.map(|(result, _, _)| result)
.map_err(Into::into)
}
None => state_machine::new(
&state,
self.backend.changes_trie_storage(),
side_effects_handler.as_mut().map(|x| &mut **x),
changes,
side_effects_handler,
&mut *changes.borrow_mut(),
&self.executor,
init_block_function,
&header.encode(),
).execute_using_consensus_failure_handler::<_, R, fn() -> _>(
execution_manager.clone(),
method,
call_data,
)
.execute_using_consensus_failure_handler(
execution_manager,
false,
None,
)?;
*initialized_block = Some(*at);
native_call,
)
.map(|(result, _, _)| result)
.map_err(Into::into)
}
let result = state_machine::new(
&state,
self.backend.changes_trie_storage(),
side_effects_handler,
changes,
&self.executor,
method,
call_data,
).execute_using_consensus_failure_handler(
execution_manager,
false,
native_call,
).map(|(result, _, _)| result)?;
// If the method is `initialize_block` we need to set the `initialized_block`
if method == init_block_function {
*initialized_block = Some(*at);
}
self.backend.destroy_state(state)?;
Ok(result)
}
fn runtime_version(&self, id: &BlockId<Block>) -> error::Result<RuntimeVersion> {
+56 -20
View File
@@ -16,7 +16,10 @@
//! Substrate Client
use std::{marker::PhantomData, collections::{HashSet, BTreeMap, HashMap}, sync::Arc, panic::UnwindSafe, result};
use std::{
marker::PhantomData, collections::{HashSet, BTreeMap, HashMap}, sync::Arc,
panic::UnwindSafe, result, cell::RefCell, rc::Rc,
};
use crate::error::Error;
use futures::sync::mpsc;
use parking_lot::{Mutex, RwLock};
@@ -26,16 +29,23 @@ use runtime_primitives::{
generic::{BlockId, SignedBlock},
};
use consensus::{
Error as ConsensusError, ErrorKind as ConsensusErrorKind, ImportBlock, ImportResult,
BlockOrigin, ForkChoiceStrategy, well_known_cache_keys::Id as CacheKeyId,
Error as ConsensusError, ErrorKind as ConsensusErrorKind, ImportBlock,
ImportResult, BlockOrigin, ForkChoiceStrategy,
well_known_cache_keys::Id as CacheKeyId,
};
use runtime_primitives::traits::{
Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight, BlockNumberToHash,
ApiRef, ProvideRuntimeApi, Digest, DigestItem
Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight,
BlockNumberToHash, ApiRef, ProvideRuntimeApi, Digest, DigestItem
};
use runtime_primitives::BuildStorage;
use crate::runtime_api::{CallRuntimeAt, ConstructRuntimeApi};
use primitives::{Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash, NeverNativeValue, ExecutionContext};
use crate::runtime_api::{
CallRuntimeAt, ConstructRuntimeApi, Core as CoreApi, ProofRecorder,
InitializeBlock,
};
use primitives::{
Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash,
NeverNativeValue, ExecutionContext
};
use primitives::storage::{StorageKey, StorageData};
use primitives::storage::well_known_keys;
use parity_codec::{Encode, Decode};
@@ -49,8 +59,8 @@ use hash_db::Hasher;
use crate::backend::{self, BlockImportOperation, PrunableStateChangesTrieStorage};
use crate::blockchain::{
self, Info as ChainInfo, Backend as ChainBackend, HeaderBackend as ChainHeaderBackend,
ProvideCache, Cache,
self, Info as ChainInfo, Backend as ChainBackend,
HeaderBackend as ChainHeaderBackend, ProvideCache, Cache,
};
use crate::call_executor::{CallExecutor, LocalCallExecutor};
use executor::{RuntimeVersion, RuntimeInfo};
@@ -610,7 +620,23 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
Self: ProvideRuntimeApi,
<Self as ProvideRuntimeApi>::Api: BlockBuilderAPI<Block>
{
block_builder::BlockBuilder::at_block(parent, &self)
block_builder::BlockBuilder::at_block(parent, &self, false)
}
/// Create a new block, built on top of `parent` with proof recording enabled.
///
/// While proof recording is enabled, all accessed trie nodes are saved.
/// These recorded trie nodes can be used by a third party to proof the
/// output of this block builder without having access to the full storage.
pub fn new_block_at_with_proof_recording(
&self, parent: &BlockId<Block>
) -> error::Result<block_builder::BlockBuilder<Block, Self>> where
E: Clone + Send + Sync,
RA: Send + Sync,
Self: ProvideRuntimeApi,
<Self as ProvideRuntimeApi>::Api: BlockBuilderAPI<Block>
{
block_builder::BlockBuilder::at_block(parent, &self, true)
}
/// Lock the import lock, and run operations inside.
@@ -1340,27 +1366,36 @@ impl<B, E, Block, RA> ProvideRuntimeApi for Client<B, E, Block, RA> where
impl<B, E, Block, RA> CallRuntimeAt<Block> for Client<B, E, Block, RA> where
B: backend::Backend<Block, Blake2Hasher>,
E: CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync,
Block: BlockT<Hash=H256>
Block: BlockT<Hash=H256>,
{
fn call_api_at<
'a,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
C: CoreApi<Block>,
>(
&self,
core_api: &C,
at: &BlockId<Block>,
function: &'static str,
args: Vec<u8>,
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<Block>>,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, Block>,
native_call: Option<NC>,
context: ExecutionContext,
recorder: &Option<Rc<RefCell<ProofRecorder<Block>>>>,
) -> error::Result<NativeOrEncoded<R>> {
let manager = match context {
ExecutionContext::BlockConstruction => self.execution_strategies.block_construction.get_manager(),
ExecutionContext::Syncing => self.execution_strategies.syncing.get_manager(),
ExecutionContext::Importing => self.execution_strategies.importing.get_manager(),
ExecutionContext::OffchainWorker(_) => self.execution_strategies.offchain_worker.get_manager(),
ExecutionContext::Other => self.execution_strategies.other.get_manager(),
ExecutionContext::BlockConstruction =>
self.execution_strategies.block_construction.get_manager(),
ExecutionContext::Syncing =>
self.execution_strategies.syncing.get_manager(),
ExecutionContext::Importing =>
self.execution_strategies.importing.get_manager(),
ExecutionContext::OffchainWorker(_) =>
self.execution_strategies.offchain_worker.get_manager(),
ExecutionContext::Other =>
self.execution_strategies.other.get_manager(),
};
let mut offchain_extensions = match context {
@@ -1369,15 +1404,16 @@ impl<B, E, Block, RA> CallRuntimeAt<Block> for Client<B, E, Block, RA> where
};
self.executor.contextual_call::<_, _, fn(_,_) -> _,_,_>(
|| core_api.initialize_block(at, &self.prepare_environment_block(at)?),
at,
function,
&args,
changes,
initialized_block,
|| self.prepare_environment_block(at),
initialize_block,
manager,
native_call,
offchain_extensions.as_mut(),
recorder,
)
}
@@ -17,17 +17,24 @@
//! Light client call executor. Executes methods on remote full nodes, fetching
//! execution proof and checking it locally.
use std::{collections::HashSet, sync::Arc, panic::UnwindSafe, result, marker::PhantomData};
use std::{
collections::HashSet, sync::Arc, panic::UnwindSafe, result,
marker::PhantomData, cell::RefCell, rc::Rc,
};
use futures::{IntoFuture, Future};
use parity_codec::{Encode, Decode};
use primitives::{H256, Blake2Hasher, convert_hash, NativeOrEncoded, OffchainExt};
use runtime_primitives::generic::BlockId;
use runtime_primitives::traits::{As, Block as BlockT, Header as HeaderT};
use state_machine::{self, Backend as StateBackend, CodeExecutor, OverlayedChanges, ExecutionStrategy,
create_proof_check_backend, execution_proof_check_on_trie_backend, ExecutionManager, NeverOffchainExt};
use state_machine::{
self, Backend as StateBackend, CodeExecutor, OverlayedChanges,
ExecutionStrategy, create_proof_check_backend,
execution_proof_check_on_trie_backend, ExecutionManager, NeverOffchainExt
};
use hash_db::Hasher;
use crate::runtime_api::{ProofRecorder, InitializeBlock};
use crate::backend::RemoteBackend;
use crate::blockchain::Backend as ChainBackend;
use crate::call_executor::CallExecutor;
@@ -104,8 +111,9 @@ where
}
fn contextual_call<
'a,
O: OffchainExt,
PB: Fn() -> ClientResult<Block::Header>,
IB: Fn() -> ClientResult<()>,
EM: Fn(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>
@@ -114,18 +122,26 @@ where
NC,
>(
&self,
_initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<Block>>,
_prepare_environment_block: PB,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, Block>,
execution_manager: ExecutionManager<EM>,
_native_call: Option<NC>,
side_effects_handler: Option<&mut O>,
_recorder: &Option<Rc<RefCell<ProofRecorder<Block>>>>,
) -> ClientResult<NativeOrEncoded<R>> where ExecutionManager<EM>: Clone {
let block_initialized = match initialize_block {
InitializeBlock::Do(ref init_block) => {
init_block.borrow().is_some()
},
InitializeBlock::Skip => false,
};
// it is only possible to execute contextual call if changes are empty
if !changes.is_empty() || initialized_block.is_some() {
if !changes.borrow().is_empty() || block_initialized {
return Err(ClientError::NotAvailableOnLightClient.into());
}
@@ -231,8 +247,9 @@ impl<Block, B, Remote, Local> CallExecutor<Block, Blake2Hasher> for
}
fn contextual_call<
'a,
O: OffchainExt,
PB: Fn() -> ClientResult<Block::Header>,
IB: Fn() -> ClientResult<()>,
EM: Fn(
Result<NativeOrEncoded<R>, Self::Error>,
Result<NativeOrEncoded<R>, Self::Error>
@@ -241,15 +258,16 @@ impl<Block, B, Remote, Local> CallExecutor<Block, Blake2Hasher> for
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<Block>>,
prepare_environment_block: PB,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, Block>,
_manager: ExecutionManager<EM>,
native_call: Option<NC>,
side_effects_handler: Option<&mut O>,
recorder: &Option<Rc<RefCell<ProofRecorder<Block>>>>,
) -> ClientResult<NativeOrEncoded<R>> where ExecutionManager<EM>: Clone {
// there's no actual way/need to specify native/wasm execution strategy on light node
// => we can safely ignore passed values
@@ -266,15 +284,16 @@ impl<Block, B, Remote, Local> CallExecutor<Block, Blake2Hasher> for
NC
>(
&self.local,
initialize_block_fn,
at,
method,
call_data,
changes,
initialized_block,
prepare_environment_block,
initialize_block,
ExecutionManager::NativeWhenPossible,
native_call,
side_effects_handler,
recorder,
).map_err(|e| ClientError::Execution(Box::new(e.to_string()))),
false => CallExecutor::contextual_call::<
_,
@@ -287,15 +306,16 @@ impl<Block, B, Remote, Local> CallExecutor<Block, Blake2Hasher> for
NC
>(
&self.remote,
initialize_block_fn,
at,
method,
call_data,
changes,
initialized_block,
prepare_environment_block,
initialize_block,
ExecutionManager::NativeWhenPossible,
native_call,
side_effects_handler,
recorder,
).map_err(|e| ClientError::Execution(Box::new(e.to_string()))),
}
}
+51 -4
View File
@@ -24,7 +24,10 @@ pub use state_machine::OverlayedChanges;
pub use primitives::NativeOrEncoded;
#[doc(hidden)]
pub use runtime_primitives::{
traits::{AuthorityIdFor, Block as BlockT, GetNodeBlockType, GetRuntimeBlockType, Header as HeaderT, ApiRef, RuntimeApiInfo},
traits::{
AuthorityIdFor, Block as BlockT, GetNodeBlockType, GetRuntimeBlockType,
Header as HeaderT, ApiRef, RuntimeApiInfo, Hash as HashT,
},
generic::BlockId, transaction_validity::TransactionValidity,
};
#[doc(hidden)]
@@ -42,8 +45,16 @@ use crate::error;
use sr_api_macros::decl_runtime_apis;
use primitives::OpaqueMetadata;
#[cfg(feature = "std")]
use std::panic::UnwindSafe;
use std::{panic::UnwindSafe, cell::RefCell, rc::Rc};
use rstd::vec::Vec;
#[cfg(feature = "std")]
use primitives::Hasher as HasherT;
#[cfg(feature = "std")]
/// A type that records all accessed trie nodes and generates a proof out of it.
pub type ProofRecorder<B> = state_machine::ProofRecorder<
<<<<B as BlockT>::Header as HeaderT>::Hashing as HashT>::Hasher as HasherT>::Out
>;
/// Something that can be constructed to a runtime api.
#[cfg(feature = "std")]
@@ -87,6 +98,35 @@ pub trait ApiExt<Block: BlockT> {
/// Returns the runtime version at the given block id.
fn runtime_version_at(&self, at: &BlockId<Block>) -> error::Result<RuntimeVersion>;
/// Start recording all accessed trie nodes for generating proofs.
fn record_proof(&mut self);
/// Extract the recorded proof.
/// This stops the proof recording.
fn extract_proof(&mut self) -> Option<Vec<Vec<u8>>>;
}
/// Before calling any runtime api function, the runtime need to be initialized
/// at the requested block. However, some functions like `execute_block` or
/// `initialize_block` itself don't require to have the runtime initialized
/// at the requested block.
///
/// `call_api_at` is instructed by this enum to do the initialization or to skip
/// it.
#[cfg(feature = "std")]
#[derive(Clone, Copy)]
pub enum InitializeBlock<'a, Block: BlockT> {
/// Skip initializing the runtime for a given block.
///
/// This is used by functions who do the initialization by themself or don't
/// require it.
Skip,
/// Initialize the runtime for a given block.
///
/// If the stored `BlockId` is `Some(_)`, the runtime is currently initialized
/// at this block.
Do(&'a RefCell<Option<BlockId<Block>>>),
}
/// Something that can call into the runtime at a given block.
@@ -95,17 +135,21 @@ pub trait CallRuntimeAt<Block: BlockT> {
/// Calls the given api function with the given encoded arguments at the given block
/// and returns the encoded result.
fn call_api_at<
'a,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
C: Core<Block>,
>(
&self,
core_api: &C,
at: &BlockId<Block>,
function: &'static str,
args: Vec<u8>,
changes: &mut OverlayedChanges,
initialized_block: &mut Option<BlockId<Block>>,
changes: &RefCell<OverlayedChanges>,
initialize_block: InitializeBlock<'a, Block>,
native_call: Option<NC>,
context: ExecutionContext,
recorder: &Option<Rc<RefCell<ProofRecorder<Block>>>>,
) -> error::Result<NativeOrEncoded<R>>;
/// Returns the runtime version at the given block.
@@ -120,9 +164,12 @@ decl_runtime_apis! {
/// Returns the version of the runtime.
fn version() -> RuntimeVersion;
/// Execute the given block.
#[skip_initialize_block]
fn execute_block(block: Block);
/// Initialize a block with the given header.
#[renamed("initialise_block", 2)]
#[skip_initialize_block]
#[initialize_block]
fn initialize_block(header: &<Block as BlockT>::Header);
/// Returns the authorities.
#[deprecated(since = "1.0", note = "Please switch to `AuthoritiesApi`.")]
@@ -53,11 +53,11 @@ fn fetch_cached_runtime_version<'a, E: Externalities<Blake2Hasher>>(
ext: &mut E,
default_heap_pages: Option<u64>,
) -> Result<(&'a WasmModuleInstanceRef, &'a Option<RuntimeVersion>)> {
let code_hash = match ext.original_storage_hash(well_known_keys::CODE) {
Some(code_hash) => code_hash,
None => return Err(ErrorKind::InvalidCode(vec![]).into()),
};
let maybe_runtime_preproc = cache.borrow_mut().entry(code_hash.into())
.or_insert_with(|| {
let code = match ext.original_storage(well_known_keys::CODE) {
@@ -84,6 +84,7 @@ fn fetch_cached_runtime_version<'a, E: Externalities<Blake2Hasher>>(
}
}
});
match maybe_runtime_preproc {
RuntimePreproc::InvalidCode => {
let code = ext.original_storage(well_known_keys::CODE).unwrap_or(vec![]);
@@ -306,6 +306,14 @@ impl ApiExt<Block> for RuntimeApi {
fn runtime_version_at(&self, _: &BlockId<Block>) -> Result<RuntimeVersion> {
unimplemented!("Not required for testing!")
}
fn record_proof(&mut self) {
unimplemented!("Not required for testing!")
}
fn extract_proof(&mut self) -> Option<Vec<Vec<u8>>> {
unimplemented!("Not required for testing!")
}
}
impl GrandpaApi<Block> for RuntimeApi {
+6 -9
View File
@@ -570,15 +570,12 @@ mod tests {
fn should_remove_transactions_from_the_pool() {
let client = Arc::new(substrate_test_client::new());
let pool = TransactionPool::new(Default::default(), ::transaction_pool::ChainApi::new(client.clone()));
let transaction = {
let transfer = Transfer {
amount: 5,
nonce: 0,
from: AccountKeyring::Alice.into(),
to: Default::default(),
};
transfer.into_signed_tx()
};
let transaction = Transfer {
amount: 5,
nonce: 0,
from: AccountKeyring::Alice.into(),
to: Default::default(),
}.into_signed_tx();
// store the transaction in the pool
pool.submit_one(&BlockId::hash(client.best_block_header().unwrap().hash()), transaction.clone()).unwrap();
+2
View File
@@ -22,6 +22,8 @@ runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" }
sr-version = { path = "../sr-version" }
substrate-primitives = { path = "../primitives" }
criterion = "0.2"
consensus_common = { package = "substrate-consensus-common", path = "../consensus/common" }
codec = { package = "parity-codec", version = "3.5.1" }
[[bench]]
name = "bench"
@@ -57,9 +57,21 @@ const CHANGED_IN_ATTRIBUTE: &str = "changed_in";
///
/// Is used when a trait method was renamed.
const RENAMED_ATTRIBUTE: &str = "renamed";
/// The `skip_initialize_block` attribute.
///
/// Is used when a trait method does not require that the block is initialized
/// before being called.
const SKIP_INITIALIZE_BLOCK_ATTRIBUTE: &str = "skip_initialize_block";
/// The `initialize_block` attribute.
///
/// A trait method tagged with this attribute, initializes the runtime at
/// certain block.
const INITIALIZE_BLOCK_ATTRIBUTE: &str = "initialize_block";
/// All attributes that we support in the declaration of a runtime api trait.
const SUPPORTED_ATTRIBUTE_NAMES: &[&str] = &[
CORE_TRAIT_ATTRIBUTE, API_VERSION_ATTRIBUTE, CHANGED_IN_ATTRIBUTE, RENAMED_ATTRIBUTE
CORE_TRAIT_ATTRIBUTE, API_VERSION_ATTRIBUTE, CHANGED_IN_ATTRIBUTE,
RENAMED_ATTRIBUTE, SKIP_INITIALIZE_BLOCK_ATTRIBUTE,
INITIALIZE_BLOCK_ATTRIBUTE,
];
/// The structure used for parsing the runtime api declarations.
@@ -338,7 +350,12 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result<TokenStream> {
if attrs.contains_key(RENAMED_ATTRIBUTE) && attrs.contains_key(CHANGED_IN_ATTRIBUTE) {
return Err(Error::new(
fn_.span(), format!("`{}` and `{}` are not supported at once.", RENAMED_ATTRIBUTE, CHANGED_IN_ATTRIBUTE)
fn_.span(),
format!(
"`{}` and `{}` are not supported at once.",
RENAMED_ATTRIBUTE,
CHANGED_IN_ATTRIBUTE
)
));
}
@@ -347,6 +364,15 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result<TokenStream> {
continue;
}
let skip_initialize_block = attrs.contains_key(SKIP_INITIALIZE_BLOCK_ATTRIBUTE);
let update_initialized_block = if attrs.contains_key(INITIALIZE_BLOCK_ATTRIBUTE) {
quote!(
|| *initialized_block.borrow_mut() = Some(*at)
)
} else {
quote!(|| ())
};
// Parse the renamed attributes.
let mut renames = Vec::new();
if let Some((_, a)) = attrs
@@ -375,43 +401,63 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result<TokenStream> {
NC: FnOnce() -> ::std::result::Result<R, &'static str> + ::std::panic::UnwindSafe,
Block: #crate_::runtime_api::BlockT,
T: #crate_::runtime_api::CallRuntimeAt<Block>,
C: #crate_::runtime_api::Core<Block>,
>(
call_runtime_at: &T,
core_api: &C,
at: &#crate_::runtime_api::BlockId<Block>,
args: Vec<u8>,
changes: &mut #crate_::runtime_api::OverlayedChanges,
initialized_block: &mut Option<#crate_::runtime_api::BlockId<Block>>,
changes: &std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>,
initialized_block: &std::cell::RefCell<Option<#crate_::runtime_api::BlockId<Block>>>,
native_call: Option<NC>,
context: #crate_::runtime_api::ExecutionContext,
recorder: &Option<std::rc::Rc<std::cell::RefCell<#crate_::runtime_api::ProofRecorder<Block>>>>,
) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded<R>> {
let version = call_runtime_at.runtime_version_at(at)?;
use #crate_::runtime_api::InitializeBlock;
let initialize_block = if #skip_initialize_block {
InitializeBlock::Skip
} else {
InitializeBlock::Do(&initialized_block)
};
let update_initialized_block = #update_initialized_block;
#(
// Check if we need to call the function by an old name.
if version.apis.iter().any(|(s, v)| {
s == &ID && *v < #versions
}) {
return call_runtime_at.call_api_at::<R, fn() -> _>(
let ret = call_runtime_at.call_api_at::<R, fn() -> _, _>(
core_api,
at,
#old_names,
args,
changes,
initialized_block,
initialize_block,
None,
context
);
context,
recorder,
)?;
update_initialized_block();
return Ok(ret);
}
)*
call_runtime_at.call_api_at(
let ret = call_runtime_at.call_api_at(
core_api,
at,
#trait_fn_name,
args,
changes,
initialized_block,
initialize_block,
native_call,
context
)
context,
recorder,
)?;
update_initialized_block();
Ok(ret)
}
));
}
@@ -263,9 +263,10 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
#[cfg(any(feature = "std", test))]
pub struct RuntimeApiImpl<C: #crate_::runtime_api::CallRuntimeAt<#block> + 'static> {
call: &'static C,
commit_on_success: ::std::cell::RefCell<bool>,
initialized_block: ::std::cell::RefCell<Option<#block_id>>,
changes: ::std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>,
commit_on_success: std::cell::RefCell<bool>,
initialized_block: std::cell::RefCell<Option<#block_id>>,
changes: std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>,
recorder: Option<std::rc::Rc<std::cell::RefCell<#crate_::runtime_api::ProofRecorder<#block>>>>,
}
// `RuntimeApi` itself is not threadsafe. However, an instance is only available in a
@@ -299,6 +300,22 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
) -> #crate_::error::Result<#crate_::runtime_api::RuntimeVersion> {
self.call.runtime_version_at(at)
}
fn record_proof(&mut self) {
self.recorder = Some(Default::default());
}
fn extract_proof(&mut self) -> Option<Vec<Vec<u8>>> {
self.recorder
.take()
.map(|r| {
r.borrow_mut()
.drain()
.into_iter()
.map(|n| n.data.to_vec())
.collect()
})
}
}
#[cfg(any(feature = "std", test))]
@@ -315,6 +332,7 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
commit_on_success: true.into(),
initialized_block: None.into(),
changes: Default::default(),
recorder: Default::default(),
}.into()
}
}
@@ -325,9 +343,11 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
R: #crate_::runtime_api::Encode + #crate_::runtime_api::Decode + PartialEq,
F: FnOnce(
&C,
&mut #crate_::runtime_api::OverlayedChanges,
&mut Option<#crate_::runtime_api::BlockId<#block>>,
) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded<R>>
&Self,
&std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>,
&std::cell::RefCell<Option<#crate_::runtime_api::BlockId<#block>>>,
&Option<std::rc::Rc<std::cell::RefCell<#crate_::runtime_api::ProofRecorder<#block>>>>,
) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded<R>>,
>(
&self,
call_api_at: F,
@@ -335,8 +355,10 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
let res = unsafe {
call_api_at(
&self.call,
&mut *self.changes.borrow_mut(),
&mut *self.initialized_block.borrow_mut()
self,
&self.changes,
&self.initialized_block,
&self.recorder,
)
};
@@ -479,9 +501,10 @@ impl<'a> Fold for ApiRuntimeImplToApiRuntimeApiImpl<'a> {
#( #error )*
self.call_api_at(
|call_runtime_at, changes, initialized_block| {
|call_runtime_at, core_api, changes, initialized_block, recorder| {
#runtime_mod_path #call_api_at_call(
call_runtime_at,
core_api,
at,
params_encoded,
changes,
@@ -493,6 +516,7 @@ impl<'a> Fold for ApiRuntimeImplToApiRuntimeApiImpl<'a> {
)
}),
context,
recorder,
)
}
)
@@ -14,9 +14,20 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use test_client::runtime::{TestAPI, DecodeFails};
use runtime_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
use state_machine::ExecutionStrategy;
use test_client::{
AccountKeyring, runtime::{TestAPI, DecodeFails, Transfer, Header},
NativeExecutor, LocalExecutor,
};
use runtime_primitives::{
generic::BlockId,
traits::{ProvideRuntimeApi, Header as HeaderT, Hash as HashT},
};
use state_machine::{
ExecutionStrategy, create_proof_check_backend,
execution_proof_check_on_trie_backend,
};
use codec::Encode;
fn calling_function_with_strat(strat: ExecutionStrategy) {
let client = test_client::new_with_execution_strategy(strat);
@@ -114,3 +125,66 @@ fn use_trie_function() {
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
assert_eq!(runtime_api.use_trie(&block_id).unwrap(), 2);
}
#[test]
fn initialize_block_works() {
let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both);
let runtime_api = client.runtime_api();
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
assert_eq!(runtime_api.get_block_number(&block_id).unwrap(), 1);
}
#[test]
fn initialize_block_is_called_only_once() {
let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both);
let runtime_api = client.runtime_api();
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
assert_eq!(runtime_api.take_block_number(&block_id).unwrap(), Some(1));
assert_eq!(runtime_api.take_block_number(&block_id).unwrap(), None);
}
#[test]
fn initialize_block_is_skipped() {
let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both);
let runtime_api = client.runtime_api();
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
assert!(runtime_api.without_initialize_block(&block_id).unwrap());
}
#[test]
fn record_proof_works() {
let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both);
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
let storage_root = client.best_block_header().unwrap().state_root().clone();
let transaction = Transfer {
amount: 1000,
nonce: 0,
from: AccountKeyring::Alice.into(),
to: Default::default(),
}.into_signed_tx();
// Build the block and record proof
let mut builder = client
.new_block_at_with_proof_recording(&block_id)
.expect("Creates block builder");
builder.push(transaction.clone()).unwrap();
let (block, proof) = builder.bake_and_extract_proof().expect("Bake block");
let backend = create_proof_check_backend::<<<Header as HeaderT>::Hashing as HashT>::Hasher>(
storage_root,
proof.expect("Proof was generated"),
).expect("Creates proof backend.");
// Use the proof backend to execute `execute_block`.
let mut overlay = Default::default();
let executor = NativeExecutor::<LocalExecutor>::new(None);
execution_proof_check_on_trie_backend(
&backend,
&mut overlay,
&executor,
"Core_execute_block",
&block.encode(),
).expect("Executes block while using the proof backend");
}
@@ -748,6 +748,12 @@ impl<'a, T> rstd::ops::Deref for ApiRef<'a, T> {
}
}
impl<'a, T> rstd::ops::DerefMut for ApiRef<'a, T> {
fn deref_mut(&mut self) -> &mut T {
&mut self.0
}
}
/// Something that provides a runtime api.
pub trait ProvideRuntimeApi {
/// The concrete type that provides the api.
+7 -2
View File
@@ -24,7 +24,9 @@ use log::warn;
use hash_db::Hasher;
use heapsize::HeapSizeOf;
use parity_codec::{Decode, Encode};
use primitives::{storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt};
use primitives::{
storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt
};
pub mod backend;
mod changes_trie;
@@ -52,7 +54,10 @@ pub use changes_trie::{
oldest_non_pruned_trie as oldest_non_pruned_changes_trie
};
pub use overlayed_changes::OverlayedChanges;
pub use proving_backend::{create_proof_check_backend, create_proof_check_backend_storage};
pub use proving_backend::{
create_proof_check_backend, create_proof_check_backend_storage,
Recorder as ProofRecorder, ProvingBackend,
};
pub use trie_backend_essence::{TrieBackendStorage, Storage};
pub use trie_backend::TrieBackend;
@@ -16,12 +16,16 @@
//! Proving state machine backend.
use std::cell::RefCell;
use std::{cell::RefCell, rc::Rc};
use log::debug;
use hash_db::Hasher;
use heapsize::HeapSizeOf;
use hash_db::HashDB;
use trie::{Recorder, MemoryDB, PrefixedMemoryDB, TrieError, default_child_trie_root, read_trie_value_with, read_child_trie_value_with, record_all_keys};
use trie::{
MemoryDB, PrefixedMemoryDB, TrieError, default_child_trie_root,
read_trie_value_with, read_child_trie_value_with, record_all_keys
};
pub use trie::Recorder;
use crate::trie_backend::TrieBackend;
use crate::trie_backend_essence::{Ephemeral, TrieBackendEssence, TrieBackendStorage};
use crate::{Error, ExecutionError, Backend};
@@ -87,7 +91,7 @@ impl<'a, S, H> ProvingBackendEssence<'a, S, H>
/// These can be sent to remote node and used as a proof of execution.
pub struct ProvingBackend<'a, S: 'a + TrieBackendStorage<H>, H: 'a + Hasher> {
backend: &'a TrieBackend<S, H>,
proof_recorder: RefCell<Recorder<H::Out>>,
proof_recorder: Rc<RefCell<Recorder<H::Out>>>,
}
impl<'a, S: 'a + TrieBackendStorage<H>, H: 'a + Hasher> ProvingBackend<'a, S, H> {
@@ -95,14 +99,27 @@ impl<'a, S: 'a + TrieBackendStorage<H>, H: 'a + Hasher> ProvingBackend<'a, S, H>
pub fn new(backend: &'a TrieBackend<S, H>) -> Self {
ProvingBackend {
backend,
proof_recorder: RefCell::new(Recorder::new()),
proof_recorder: Rc::new(RefCell::new(Recorder::new())),
}
}
/// Create new proving backend with the given recorder.
pub fn new_with_recorder(
backend: &'a TrieBackend<S, H>,
proof_recorder: Rc<RefCell<Recorder<H::Out>>>,
) -> Self {
ProvingBackend {
backend,
proof_recorder,
}
}
/// Consume the backend, extracting the gathered proof in lexicographical order
/// by value.
pub fn extract_proof(self) -> Vec<Vec<u8>> {
self.proof_recorder.into_inner().drain()
self.proof_recorder
.borrow_mut()
.drain()
.into_iter()
.map(|n| n.data.to_vec())
.collect()
+14 -1
View File
@@ -14,5 +14,18 @@ consensus = { package = "substrate-consensus-common", path = "../consensus/commo
keyring = { package = "substrate-keyring", path = "../../core/keyring" }
primitives = { package = "substrate-primitives", path = "../primitives" }
state_machine = { package = "substrate-state-machine", path = "../state-machine" }
runtime = { package = "substrate-test-runtime", path = "../test-runtime" }
runtime = { package = "substrate-test-runtime", path = "../test-runtime", default-features = false }
runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" }
[features]
default = [
"include-wasm-blob",
"std",
]
std = [
"runtime/std",
]
# If enabled, the WASM blob is added to the `GenesisConfig`.
include-wasm-blob = [
"runtime/include-wasm-blob",
]
+26 -8
View File
@@ -17,7 +17,10 @@
//! Client extension for tests.
use client::{self, Client};
use consensus::{ImportBlock, BlockImport, BlockOrigin, Error as ConsensusError, ForkChoiceStrategy};
use consensus::{
ImportBlock, BlockImport, BlockOrigin, Error as ConsensusError,
ForkChoiceStrategy,
};
use runtime_primitives::Justification;
use runtime_primitives::generic::BlockId;
use primitives::Blake2Hasher;
@@ -31,11 +34,19 @@ pub trait TestClient: Sized {
-> Result<(), ConsensusError>;
/// Import block with justification, finalizes block.
fn import_justified(&self, origin: BlockOrigin, block: runtime::Block, justification: Justification)
-> Result<(), ConsensusError>;
fn import_justified(
&self,
origin: BlockOrigin,
block: runtime::Block,
justification: Justification
) -> Result<(), ConsensusError>;
/// Finalize a block.
fn finalize_block(&self, id: BlockId<runtime::Block>, justification: Option<Justification>) -> client::error::Result<()>;
fn finalize_block(
&self,
id: BlockId<runtime::Block>,
justification: Option<Justification>,
) -> client::error::Result<()>;
/// Returns hash of the genesis block.
fn genesis_hash(&self) -> runtime::Hash;
@@ -64,9 +75,12 @@ impl<B, E, RA> TestClient for Client<B, E, runtime::Block, RA>
self.import_block(import, HashMap::new()).map(|_| ())
}
fn import_justified(&self, origin: BlockOrigin, block: runtime::Block, justification: Justification)
-> Result<(), ConsensusError>
{
fn import_justified(
&self,
origin: BlockOrigin,
block: runtime::Block,
justification: Justification,
) -> Result<(), ConsensusError> {
let import = ImportBlock {
origin,
header: block.header,
@@ -81,7 +95,11 @@ impl<B, E, RA> TestClient for Client<B, E, runtime::Block, RA>
self.import_block(import, HashMap::new()).map(|_| ())
}
fn finalize_block(&self, id: BlockId<runtime::Block>, justification: Option<Justification>) -> client::error::Result<()> {
fn finalize_block(
&self,
id: BlockId<runtime::Block>,
justification: Option<Justification>,
) -> client::error::Result<()> {
self.finalize_block(id, justification, true)
}
+129 -31
View File
@@ -19,29 +19,30 @@
#![warn(missing_docs)]
pub mod client_ext;
#[cfg(feature = "include-wasm-blob")]
pub mod trait_tests;
mod block_builder_ext;
pub use client_ext::TestClient;
pub use block_builder_ext::BlockBuilderExt;
pub use client;
pub use client::ExecutionStrategies;
pub use client::blockchain;
pub use client::backend;
pub use executor::NativeExecutor;
pub use client::{ExecutionStrategies, blockchain, backend, self};
pub use executor::{NativeExecutor, self};
pub use runtime;
pub use consensus;
pub use keyring::{AuthorityKeyring, AccountKeyring};
use std::sync::Arc;
use std::{sync::Arc, collections::HashMap};
use futures::future::FutureResult;
use primitives::Blake2Hasher;
use runtime_primitives::StorageOverlay;
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash as HashT, NumberFor};
use runtime_primitives::traits::{
Block as BlockT, Header as HeaderT, Hash as HashT, NumberFor
};
use runtime::genesismap::{GenesisConfig, additional_storage_with_genesis};
use state_machine::ExecutionStrategy;
use client::LocalCallExecutor;
#[cfg(feature = "include-wasm-blob")]
mod local_executor {
#![allow(missing_docs)]
use runtime;
@@ -56,12 +57,14 @@ mod local_executor {
}
/// Native executor used for tests.
#[cfg(feature = "include-wasm-blob")]
pub use local_executor::LocalExecutor;
/// Test client database backend.
pub type Backend = client_db::Backend<runtime::Block>;
/// Test client executor.
#[cfg(feature = "include-wasm-blob")]
pub type Executor = client::LocalCallExecutor<
Backend,
executor::NativeExecutor<LocalExecutor>,
@@ -78,6 +81,7 @@ pub type LightBackend = client::light::backend::Backend<
pub struct LightFetcher;
/// Test client light executor.
#[cfg(feature = "include-wasm-blob")]
pub type LightExecutor = client::light::call_executor::RemoteOrLocalCallExecutor<
runtime::Block,
LightBackend,
@@ -98,12 +102,112 @@ pub type LightExecutor = client::light::call_executor::RemoteOrLocalCallExecutor
>
>;
/// A builder for creating a test client instance.
pub struct TestClientBuilder {
execution_strategies: ExecutionStrategies,
genesis_extension: HashMap<Vec<u8>, Vec<u8>>,
support_changes_trie: bool,
}
impl TestClientBuilder {
/// Create a new instance of the test client builder.
pub fn new() -> Self {
TestClientBuilder {
execution_strategies: ExecutionStrategies::default(),
genesis_extension: HashMap::default(),
support_changes_trie: false,
}
}
/// Set the execution strategy that should be used by all contexts.
pub fn set_execution_strategy(
mut self,
execution_strategy: ExecutionStrategy
) -> Self {
self.execution_strategies = ExecutionStrategies {
syncing: execution_strategy,
importing: execution_strategy,
block_construction: execution_strategy,
offchain_worker: execution_strategy,
other: execution_strategy,
};
self
}
/// Set an extension of the genesis storage.
pub fn set_genesis_extension(
mut self,
extension: HashMap<Vec<u8>, Vec<u8>>
) -> Self {
self.genesis_extension = extension;
self
}
/// Enable/Disable changes trie support.
pub fn set_support_changes_trie(mut self, enable: bool) -> Self {
self.support_changes_trie = enable;
self
}
/// Build the test client.
#[cfg(feature = "include-wasm-blob")]
pub fn build(self) -> client::Client<
Backend, Executor, runtime::Block, runtime::RuntimeApi
> {
let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX));
self.build_with_backend(backend)
}
/// Build the test client with the given backend.
#[cfg(feature = "include-wasm-blob")]
pub fn build_with_backend<B>(self, backend: Arc<B>) -> client::Client<
B,
client::LocalCallExecutor<B, executor::NativeExecutor<LocalExecutor>>,
runtime::Block,
runtime::RuntimeApi
> where B: backend::LocalBackend<runtime::Block, Blake2Hasher> {
let executor = NativeExecutor::new(None);
let executor = LocalCallExecutor::new(backend.clone(), executor);
client::Client::new(
backend,
executor,
genesis_storage(self.support_changes_trie, self.genesis_extension),
self.execution_strategies
).expect("Creates new client")
}
/// Build the test client with the given native executor.
pub fn build_with_native_executor<E>(
self,
executor: executor::NativeExecutor<E>
) -> client::Client<
Backend,
client::LocalCallExecutor<Backend, executor::NativeExecutor<E>>,
runtime::Block,
runtime::RuntimeApi
> where E: executor::NativeExecutionDispatch
{
let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX));
let executor = LocalCallExecutor::new(backend.clone(), executor);
client::Client::new(
backend,
executor,
genesis_storage(self.support_changes_trie, self.genesis_extension),
self.execution_strategies
).expect("Creates new client")
}
}
/// Creates new client instance used for tests.
#[cfg(feature = "include-wasm-blob")]
pub fn new() -> client::Client<Backend, Executor, runtime::Block, runtime::RuntimeApi> {
new_with_backend(Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX)), false)
}
/// Creates new light client instance used for tests.
#[cfg(feature = "include-wasm-blob")]
pub fn new_light() -> client::Client<LightBackend, LightExecutor, runtime::Block, runtime::RuntimeApi> {
let storage = client_db::light::LightStorage::new_test();
let blockchain = Arc::new(client::light::blockchain::Blockchain::new(storage));
@@ -113,42 +217,28 @@ pub fn new_light() -> client::Client<LightBackend, LightExecutor, runtime::Block
let remote_call_executor = client::light::call_executor::RemoteCallExecutor::new(blockchain.clone(), fetcher);
let local_call_executor = client::LocalCallExecutor::new(backend.clone(), executor);
let call_executor = LightExecutor::new(backend.clone(), remote_call_executor, local_call_executor);
client::Client::new(backend, call_executor, genesis_storage(false), Default::default()).unwrap()
client::Client::new(backend, call_executor, genesis_storage(false, Default::default()), Default::default()).unwrap()
}
/// Creates new client instance used for tests with the given api execution strategy.
#[cfg(feature = "include-wasm-blob")]
pub fn new_with_execution_strategy(
execution_strategy: ExecutionStrategy
) -> client::Client<Backend, Executor, runtime::Block, runtime::RuntimeApi> {
let backend = Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX));
let executor = NativeExecutor::new(None);
let executor = LocalCallExecutor::new(backend.clone(), executor);
let execution_strategies = ExecutionStrategies {
syncing: execution_strategy,
importing: execution_strategy,
block_construction: execution_strategy,
offchain_worker: execution_strategy,
other: execution_strategy,
};
client::Client::new(
backend,
executor,
genesis_storage(false),
execution_strategies
).expect("Creates new client")
TestClientBuilder::new().set_execution_strategy(execution_strategy).build()
}
/// Creates new test client instance that suports changes trie creation.
#[cfg(feature = "include-wasm-blob")]
pub fn new_with_changes_trie()
-> client::Client<Backend, Executor, runtime::Block, runtime::RuntimeApi>
{
new_with_backend(Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX)), true)
TestClientBuilder::new().set_support_changes_trie(true).build()
}
/// Creates new client instance used for tests with an explicitly provided backend.
/// This is useful for testing backend implementations.
#[cfg(feature = "include-wasm-blob")]
pub fn new_with_backend<B>(
backend: Arc<B>,
support_changes_trie: bool
@@ -159,8 +249,9 @@ pub fn new_with_backend<B>(
runtime::RuntimeApi
> where B: backend::LocalBackend<runtime::Block, Blake2Hasher>
{
let executor = NativeExecutor::new(None);
client::new_with_backend(backend, executor, genesis_storage(support_changes_trie)).unwrap()
TestClientBuilder::new()
.set_support_changes_trie(support_changes_trie)
.build_with_backend(backend)
}
fn genesis_config(support_changes_trie: bool) -> GenesisConfig {
@@ -177,9 +268,16 @@ fn genesis_config(support_changes_trie: bool) -> GenesisConfig {
)
}
fn genesis_storage(support_changes_trie: bool) -> StorageOverlay {
fn genesis_storage(
support_changes_trie: bool,
extension: HashMap<Vec<u8>, Vec<u8>>
) -> StorageOverlay {
let mut storage = genesis_config(support_changes_trie).genesis_map();
let state_root = <<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(storage.clone().into_iter());
storage.extend(extension.into_iter());
let state_root = <<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
storage.clone().into_iter()
);
let block: runtime::Block = client::genesis::construct_genesis_block(state_root);
storage.extend(additional_storage_with_genesis(&block));
storage
+6 -1
View File
@@ -31,7 +31,10 @@ substrate-executor = { path = "../executor" }
substrate-test-client = { path = "../test-client" }
[features]
default = ["std"]
default = [
"std",
"include-wasm-blob"
]
std = [
"log",
"serde",
@@ -54,3 +57,5 @@ std = [
"executive/std",
"consensus_authorities/std",
]
# If enabled, the WASM blob is added to the `GenesisConfig`.
include-wasm-blob = []
@@ -32,7 +32,12 @@ pub struct GenesisConfig {
}
impl GenesisConfig {
pub fn new(support_changes_trie: bool, authorities: Vec<AuthorityId>, endowed_accounts: Vec<AccountId>, balance: u64) -> Self {
pub fn new(
support_changes_trie: bool,
authorities: Vec<AuthorityId>,
endowed_accounts: Vec<AccountId>,
balance: u64
) -> Self {
GenesisConfig {
changes_trie_config: match support_changes_trie {
true => Some(super::changes_trie_config()),
@@ -44,11 +49,13 @@ impl GenesisConfig {
}
pub fn genesis_map(&self) -> HashMap<Vec<u8>, Vec<u8>> {
#[cfg(feature = "include-wasm-blob")]
let wasm_runtime = include_bytes!("../wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm").to_vec();
let mut map: HashMap<Vec<u8>, Vec<u8>> = self.balances.iter()
.map(|&(ref account, balance)| (account.to_keyed_vec(b"balance:"), vec![].and(&balance)))
.map(|(k, v)| (blake2_256(&k[..])[..].to_vec(), v.to_vec()))
.chain(vec![
#[cfg(feature = "include-wasm-blob")]
(well_known_keys::CODE.into(), wasm_runtime),
(well_known_keys::HEAP_PAGES.into(), vec![].and(&(16 as u64))),
(well_known_keys::AUTHORITY_COUNT.into(), vec![].and(&(self.authorities.len() as u32))),
+39 -4
View File
@@ -102,8 +102,7 @@ pub enum Extrinsic {
}
#[cfg(feature = "std")]
impl serde::Serialize for Extrinsic
{
impl serde::Serialize for Extrinsic {
fn serialize<S>(&self, seq: S) -> Result<S::Ok, S::Error> where S: ::serde::Serializer {
self.using_encoded(|bytes| seq.serialize_bytes(bytes))
}
@@ -240,6 +239,13 @@ cfg_if! {
fn use_trie() -> u64;
fn benchmark_indirect_call() -> u64;
fn benchmark_direct_call() -> u64;
/// Returns the initialized block number.
fn get_block_number() -> u64;
/// Takes and returns the initialized block number.
fn take_block_number() -> Option<u64>;
/// Returns if no block was initialized.
#[skip_initialize_block]
fn without_initialize_block() -> bool;
}
}
} else {
@@ -264,6 +270,13 @@ cfg_if! {
fn use_trie() -> u64;
fn benchmark_indirect_call() -> u64;
fn benchmark_direct_call() -> u64;
/// Returns the initialized block number.
fn get_block_number() -> u64;
/// Takes and returns the initialized block number.
fn take_block_number() -> Option<u64>;
/// Returns if no block was initialized.
#[skip_initialize_block]
fn without_initialize_block() -> bool;
}
}
}
@@ -417,6 +430,18 @@ cfg_if! {
fn benchmark_direct_call() -> u64 {
(0..1000).fold(0, |p, i| p + benchmark_add_one(i))
}
fn get_block_number() -> u64 {
system::get_block_number().expect("Block number is initialized")
}
fn without_initialize_block() -> bool {
system::get_block_number().is_none()
}
fn take_block_number() -> Option<u64> {
system::take_block_number()
}
}
impl consensus_aura::AuraApi<Block> for Runtime {
@@ -537,10 +562,20 @@ cfg_if! {
fn benchmark_direct_call() -> u64 {
(0..10000).fold(0, |p, i| p + benchmark_add_one(i))
}
fn get_block_number() -> u64 {
system::get_block_number().expect("Block number is initialized")
}
fn without_initialize_block() -> bool {
system::get_block_number().is_none()
}
fn take_block_number() -> Option<u64> {
system::take_block_number()
}
}
impl consensus_aura::AuraApi<Block> for Runtime {
fn slot_duration() -> u64 { 1 }
}
+13 -3
View File
@@ -35,7 +35,7 @@ const BALANCE_OF: &[u8] = b"balance:";
storage_items! {
ExtrinsicData: b"sys:xtd" => required map [ u32 => Vec<u8> ];
// The current block number being processed. Set by `execute_block`.
Number: b"sys:num" => required BlockNumber;
Number: b"sys:num" => BlockNumber;
ParentHash: b"sys:pha" => required Hash;
NewAuthorities: b"sys:new_auth" => Vec<AuthorityId>;
}
@@ -70,6 +70,14 @@ pub fn initialize_block(header: &Header) {
storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &0u32);
}
pub fn get_block_number() -> Option<BlockNumber> {
Number::get()
}
pub fn take_block_number() -> Option<BlockNumber> {
Number::take()
}
/// Actually execute all transitioning for `block`.
pub fn polish_block(block: &mut Block) {
let header = &mut block.header;
@@ -167,7 +175,9 @@ pub fn validate_transaction(utx: Extrinsic) -> TransactionValidity {
let mut deps = Vec::new();
deps.push(hash(&tx.from, tx.nonce - 1));
deps
} else { Vec::new() };
} else {
Vec::new()
};
let provides = {
let mut p = Vec::new();
@@ -200,7 +210,7 @@ pub fn finalize_block() -> Header {
let txs = txs.iter().map(Vec::as_slice).collect::<Vec<_>>();
let extrinsics_root = enumerated_trie_root::<Blake2Hasher>(&txs).into();
let number = <Number>::take();
let number = <Number>::take().expect("Number is set by `initialize_block`");
let parent_hash = <ParentHash>::take();
let storage_root = BlakeTwo256::storage_root();
let storage_changes_root = BlakeTwo256::storage_changes_root(parent_hash, number - 1);
+21 -21
View File
@@ -79,7 +79,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -463,7 +463,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -959,7 +959,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1474,7 +1474,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1592,7 +1592,7 @@ dependencies = [
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1649,7 +1649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2015,7 +2015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2153,7 +2153,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2252,7 +2252,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-api-macros 1.0.0",
"srml-support-procedural-tools 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2263,7 +2263,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"srml-support-procedural-tools-derive 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2272,7 +2272,7 @@ version = "1.0.0"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2325,7 +2325,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2340,7 +2340,7 @@ dependencies = [
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2369,7 +2369,7 @@ dependencies = [
"heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2636,7 +2636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.31"
version = "0.15.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2651,7 +2651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3065,7 +3065,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3095,7 +3095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3115,7 +3115,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3503,7 +3503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "<none>"
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
"checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926"
"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a"
"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836"
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
+21 -21
View File
@@ -79,7 +79,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -463,7 +463,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -959,7 +959,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1508,7 +1508,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1626,7 +1626,7 @@ dependencies = [
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1683,7 +1683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2049,7 +2049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2187,7 +2187,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2391,7 +2391,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-api-macros 1.0.0",
"srml-support-procedural-tools 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2402,7 +2402,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"srml-support-procedural-tools-derive 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2411,7 +2411,7 @@ version = "1.0.0"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2477,7 +2477,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2492,7 +2492,7 @@ dependencies = [
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2521,7 +2521,7 @@ dependencies = [
"heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2755,7 +2755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.31"
version = "0.15.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2770,7 +2770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3184,7 +3184,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3214,7 +3214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3234,7 +3234,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3622,7 +3622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "<none>"
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
"checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926"
"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a"
"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836"
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
+21 -21
View File
@@ -79,7 +79,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -463,7 +463,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -959,7 +959,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1530,7 +1530,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1648,7 +1648,7 @@ dependencies = [
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1705,7 +1705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2081,7 +2081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2219,7 +2219,7 @@ dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2513,7 +2513,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-api-macros 1.0.0",
"srml-support-procedural-tools 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2524,7 +2524,7 @@ dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"srml-support-procedural-tools-derive 1.0.0",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2533,7 +2533,7 @@ version = "1.0.0"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2612,7 +2612,7 @@ dependencies = [
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2627,7 +2627,7 @@ dependencies = [
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2656,7 +2656,7 @@ dependencies = [
"heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2901,7 +2901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.31"
version = "0.15.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2916,7 +2916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3330,7 +3330,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3360,7 +3360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3380,7 +3380,7 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3778,7 +3778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "<none>"
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
"checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926"
"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a"
"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836"
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"