mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 19:51:05 +00:00
Fix various spelling errors (#4940)
* meaningfull -> meaningful * initialise -> initialize * tokans -> tokens * incentivise -> incentivize * lenght -> length * incentivisation -> incentivization * doesnt't -> doesn't * overwriten -> overwritten * lifecycle -> life cycle * lifecycle -> life cycle * usefull -> useful * noone -> no one * spaming -> spamming * defered -> deferred * hieght -> height * sumation -> summation * ingore -> ignore * registed -> registered * Auxialary -> Auxiliary * loggin -> logging * independance -> independence * trailling -> trailing * responsability -> responsibility * trunkated -> truncated * Weither -> Whether * informations -> information * Runtume -> Runtime * choosen -> chosen * delcataion -> declaration * Unchekced -> Unchecked * defintion -> definition * scrach -> scratch * imput -> input * transfered -> transferred * endownment -> endowment * Determinator -> Determiner * relevent -> relevant * emited -> emitted * acocunt -> account * proprotional -> proportional * instantiaion -> instantiation * commited -> committed * tombstonedead -> tombstone * uwnrap -> unwrap * acount -> account * specialised -> specialized * existant -> existent * requried -> required * Anull -> Annul * AUTHORITES -> AUTHORITIES * underyling -> underlying * recognisable -> recognizable * Capitalise -> Capitalize * reportfor -> report for * hearbeat -> heartbeat * onlineness -> being online * creater -> creator * Bytearray -> Byte array * Despoit -> Deposit * substratced -> subtracted * Curent -> Current * imbalanes -> imbalances * countfown -> countdown * inexisting -> inexistent * additionaly -> additionally * substracted -> subtracted * auxilary -> auxiliary * parital -> partial * in't -> isn't * compatability -> compatibility * infomation -> information * etected -> detected * extrinsiscs -> extrinsics * reprensentation -> representation * coonfiguration -> configuration * primtives -> primitives * miscelanious -> miscellaneous * VERISON -> VERSION * endcoded -> encoded * Genrates -> Generates * miliseconds -> milliseconds * occured -> occurred * trully -> truely * truely -> truly * conjuction -> conjunction * encouters -> encounters * customised -> customized * deterministicly -> deterministically * finalisation -> finalization * pluggable -> plugable * wakeup -> wake-up * interemdiate -> intermediate * intepreting -> interpreting * finalzied -> finalized * throgh -> through * extinsic -> extrinsic * convient -> convenient * allocater -> allocator * propagateable -> propagatable * succesfuly -> successfully * finalising -> finalizing * publically -> publicly * phrasee -> phrase * substration -> substractions * substractions -> subtractions * neccessarily -> necessarily * Inlucde -> Include * unefficient -> inefficient * thay -> they * funtion -> function * datastructures -> data structures * infromation -> information * propagatable -> propagable * ecountered -> encountered * recognise -> recognize * intergration -> integration * lastet -> latest * datatypes -> data types * datatype -> data type * Strongarming -> Strong Arming * avaible -> available * Commiting -> Committing * Retreiving -> Retrieving * shoud -> should * canonicaliziation -> canonicalization * comitted -> committed * clonable -> cloneable * Uknown -> Unknown * reponse -> response * arbitary -> arbitrary * Capapbilities -> Capabilities * responsbile -> responsible * initialisation -> initialization * cames -> came * intemediate -> intermediate * reqeust -> request * intance -> instance * explcitly -> explicitly * neighor -> neighbor * reolving -> resolving * untill -> until * Validte -> Validate * deserailize -> deserialize * literaly -> literally * preceeding -> preceding * abpve -> above * chcecked -> checked * numbet -> number * Unknow -> Unknown * halfs -> halves * gossup -> gossip * givent -> given * immediatelly -> immediately * slicable -> sliceable * conensus -> consensus * Mimicks -> Mimics * acccept -> accept * serialise -> serialize * exstrinsics -> extrinsics * panicks -> panics * maintaince -> maintenance * repeatidely -> repeatedly * anecstor -> ancestor * becasue -> because * processer -> processor * Prunning -> Pruning * insterested -> interested * unuseful -> not useful * yeided -> yielded * descendfing -> descending * corresponts -> corresponds * survivew -> survive * keps -> keeps * ligh -> light * prerequisities -> prerequisites * positiion -> position * depedency -> dependency * extrinisic -> extrinsic * atomicaly -> atomically * staticly -> statically * resul -> result * timestamb -> timestamp * Utilites -> Utilities * ammount -> amount * pocess -> process * exteral -> external * Update client/finality-grandpa/src/tests.rs * Update primitives/io/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update primitives/blockchain/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update frame/support/src/weights.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update bin/node/cli/tests/common.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/api/src/execution_extensions.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/cli/src/params.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/executor/common/src/sandbox.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/api/src/execution_extensions.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/finality-grandpa/src/communication/mod.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/state-db/src/pruning.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update frame/contracts/src/tests.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update client/api/src/execution_extensions.rs * bump impl * timestamb -> timestamp Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
@@ -33,7 +33,7 @@ spec:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
sessionAffinity: None
|
||||
type: NodePort
|
||||
# don't route exteral traffic to non-local pods
|
||||
# don't route external traffic to non-local pods
|
||||
externalTrafficPolicy: Local
|
||||
{{- else if .Values.validator.keys }}
|
||||
{{- $root := . -}}
|
||||
|
||||
@@ -48,7 +48,7 @@ validator: {}
|
||||
# substrate-1-node-key <node-secret-key>
|
||||
#
|
||||
# pod names are canonical. changing these or providing different amount of
|
||||
# keys than the replicas count will lead to behavior noone ever has
|
||||
# keys than the replicas count will lead to behavior no one ever has
|
||||
# experienced before.
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ decl_event!(
|
||||
pub enum Event<T> where AccountId = <T as system::Trait>::AccountId {
|
||||
/// Just a dummy event.
|
||||
/// Event `Something` is declared with a parameter of the type `u32` and `AccountId`
|
||||
/// To emit this event, we call the deposit funtion, from our runtime funtions
|
||||
/// To emit this event, we call the deposit function, from our runtime functions
|
||||
SomethingStored(u32, AccountId),
|
||||
}
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ use frame_support::{assert_ok, assert_noop};
|
||||
#[test]
|
||||
fn it_works_for_default_value() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Just a dummy test for the dummy funtion `do_something`
|
||||
// Just a dummy test for the dummy function `do_something`
|
||||
// calling the `do_something` function with a value 42
|
||||
assert_ok!(TemplateModule::do_something(Origin::signed(1), 42));
|
||||
// asserting that the stored value is equal to what we stored
|
||||
|
||||
@@ -69,7 +69,7 @@ pub type DigestItem = generic::DigestItem<Hash>;
|
||||
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
|
||||
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
|
||||
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
|
||||
/// to even the core datastructures.
|
||||
/// to even the core data structures.
|
||||
pub mod opaque {
|
||||
use super::*;
|
||||
|
||||
@@ -109,7 +109,7 @@ pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
|
||||
pub const HOURS: BlockNumber = MINUTES * 60;
|
||||
pub const DAYS: BlockNumber = HOURS * 24;
|
||||
|
||||
/// The version infromation used to identify this runtime when compiled natively.
|
||||
/// The version information used to identify this runtime when compiled natively.
|
||||
#[cfg(feature = "std")]
|
||||
pub fn native_version() -> NativeVersion {
|
||||
NativeVersion {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::{process::{Child, ExitStatus}, thread, time::Duration};
|
||||
|
||||
/// Wait for the given `child` the given ammount of `secs`.
|
||||
/// Wait for the given `child` the given number of `secs`.
|
||||
///
|
||||
/// Returns the `Some(exit status)` or `None` if the process did not finish in the given time.
|
||||
pub fn wait_for(child: &mut Child, secs: usize) -> Option<ExitStatus> {
|
||||
|
||||
@@ -38,7 +38,7 @@ fn running_the_node_works_and_can_be_interrupted() {
|
||||
assert_eq!(
|
||||
common::wait_for(&mut cmd, 30).map(|x| x.success()),
|
||||
Some(true),
|
||||
"the pocess must exit gracefully after signal {}",
|
||||
"the process must exit gracefully after signal {}",
|
||||
signal,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! Example substrate RPC client code.
|
||||
//!
|
||||
//! This module shows how you can write a Rust RPC client that connects to a running
|
||||
//! substrate node and use staticly typed RPC wrappers.
|
||||
//! substrate node and use statically typed RPC wrappers.
|
||||
|
||||
use futures::Future;
|
||||
use hyper::rt;
|
||||
@@ -55,7 +55,7 @@ fn main() {
|
||||
/// 1. Calls the `pending_extrinsics` method to get all extrinsics in the pool.
|
||||
/// 2. Then calls `remove_extrinsic` passing the obtained raw extrinsics.
|
||||
///
|
||||
/// As the resul of running the code the entire content of the transaction pool is going
|
||||
/// As the result of running the code the entire content of the transaction pool is going
|
||||
/// to be removed and the extrinsics are going to be temporarily banned.
|
||||
fn remove_all_extrinsics(client: AuthorClient<Hash, Hash>) -> impl Future<Item=(), Error=RpcError> {
|
||||
client.pending_extrinsics()
|
||||
|
||||
@@ -83,7 +83,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
// implementation changes and behavior does not, then leave spec_version as
|
||||
// is and increment impl_version.
|
||||
spec_version: 219,
|
||||
impl_version: 0,
|
||||
impl_version: 1,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
@@ -419,7 +419,7 @@ impl pallet_contracts::Trait for Runtime {
|
||||
type Randomness = RandomnessCollectiveFlip;
|
||||
type Call = Call;
|
||||
type Event = Event;
|
||||
type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminator<Runtime>;
|
||||
type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer<Runtime>;
|
||||
type ComputeDispatchFee = pallet_contracts::DefaultDispatchFeeComputor<Runtime>;
|
||||
type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter<Runtime>;
|
||||
type GasPayment = ();
|
||||
|
||||
@@ -174,7 +174,7 @@ impl BenchDb {
|
||||
|
||||
let mut inherent_data = InherentData::new();
|
||||
inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp)
|
||||
.expect("Put timestamb failed");
|
||||
.expect("Put timestamp failed");
|
||||
inherent_data.put_data(sp_finality_tracker::INHERENT_IDENTIFIER, &0)
|
||||
.expect("Put finality tracker failed");
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Utilites to build a `TestClient` for `node-runtime`.
|
||||
//! Utilities to build a `TestClient` for `node-runtime`.
|
||||
|
||||
use sp_runtime::BuildStorage;
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ fn get_app<'a, 'b>(usage: &'a str) -> App<'a, 'b> {
|
||||
SubCommand::with_name("transfer")
|
||||
.about("Author and sign a Node pallet_balances::Transfer transaction with a given (secret) key")
|
||||
.args_from_usage("
|
||||
<genesis> -g, --genesis <genesis> 'The genesis hash or a recognised \
|
||||
<genesis> -g, --genesis <genesis> 'The genesis hash or a recognized \
|
||||
chain identifier (dev, elm, alex).'
|
||||
<from> 'The signing secret key URI.'
|
||||
<to> 'The destination account public key URI.'
|
||||
@@ -572,7 +572,7 @@ fn read_genesis_hash(matches: &ArgMatches) -> Result<H256, Error> {
|
||||
"elm" => hex!["10c08714a10c7da78f40a60f6f732cf0dba97acfb5e2035445b032386157d5c3"].into(),
|
||||
"alex" => hex!["dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b"].into(),
|
||||
h => Decode::decode(&mut &decode_hex(h)?[..])
|
||||
.expect("Invalid genesis hash or unrecognised chain identifier"),
|
||||
.expect("Invalid genesis hash or unrecognized chain identifier"),
|
||||
};
|
||||
println!(
|
||||
"Using a genesis hash of {}",
|
||||
|
||||
@@ -64,7 +64,7 @@ impl Default for ExecutionStrategies {
|
||||
|
||||
/// Generate the starting set of ExternalitiesExtensions based upon the given capabilities
|
||||
pub trait ExtensionsFactory: Send + Sync {
|
||||
/// Make `Extensions` for given Capapbilities
|
||||
/// Make `Extensions` for given `Capabilities`.
|
||||
fn extensions_for(&self, capabilities: offchain::Capabilities) -> Extensions;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ impl ExtensionsFactory for () {
|
||||
/// A producer of execution extensions for offchain calls.
|
||||
///
|
||||
/// This crate aggregates extensions available for the offchain calls
|
||||
/// and is responsbile to produce a right `Extensions` object
|
||||
/// and is responsible for producing a correct `Extensions` object.
|
||||
/// for each call, based on required `Capabilities`.
|
||||
pub struct ExecutionExtensions<Block: traits::Block> {
|
||||
strategies: ExecutionStrategies,
|
||||
@@ -125,7 +125,7 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
|
||||
/// To break retain cycle between `Client` and `TransactionPool` we require this
|
||||
/// extension to be a `Weak` reference.
|
||||
/// That's also the reason why it's being registered lazily instead of
|
||||
/// during initialisation.
|
||||
/// during initialization.
|
||||
pub fn register_transaction_pool(&self, pool: Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>) {
|
||||
*self.transaction_pool.write() = Some(pool);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ pub fn derive(
|
||||
let err = || {
|
||||
let err = Error::new(
|
||||
Span::call_site(),
|
||||
"ChainSpecGroup is only avaible for structs with named fields."
|
||||
"ChainSpecGroup is only available for structs with named fields."
|
||||
).to_compile_error();
|
||||
quote!( #err ).into()
|
||||
};
|
||||
|
||||
@@ -336,7 +336,7 @@ mod tests {
|
||||
type TestSpec = ChainSpec<Genesis>;
|
||||
|
||||
#[test]
|
||||
fn should_deserailize_example_chain_spec() {
|
||||
fn should_deserialize_example_chain_spec() {
|
||||
let spec1 = TestSpec::from_json_bytes(Cow::Owned(
|
||||
include_bytes!("../res/chain_spec.json").to_vec()
|
||||
)).unwrap();
|
||||
|
||||
@@ -718,7 +718,7 @@ pub struct BuildSpecCmd {
|
||||
pub node_key_params: NodeKeyParams,
|
||||
}
|
||||
|
||||
/// Wrapper type of `String` which holds an arbitary sized unsigned integer formatted as decimal.
|
||||
/// Wrapper type of `String` that holds an unsigned integer of arbitrary size, formatted as a decimal.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct BlockNumber(String);
|
||||
|
||||
@@ -908,7 +908,7 @@ pub enum Subcommand {
|
||||
/// Import blocks from file.
|
||||
ImportBlocks(ImportBlocksCmd),
|
||||
|
||||
/// Validte a single block.
|
||||
/// Validate a single block.
|
||||
CheckBlock(CheckBlockCmd),
|
||||
|
||||
/// Revert chain to the previous state.
|
||||
@@ -1266,4 +1266,3 @@ impl BenchmarkCmd {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -316,12 +316,12 @@ impl TestNetFactory for BabeTestNet {
|
||||
}
|
||||
|
||||
fn peer(&mut self, i: usize) -> &mut Peer<Self::PeerData, DummySpecialization> {
|
||||
trace!(target: "babe", "Retreiving a peer");
|
||||
trace!(target: "babe", "Retrieving a peer");
|
||||
&mut self.peers[i]
|
||||
}
|
||||
|
||||
fn peers(&self) -> &Vec<Peer<Self::PeerData, DummySpecialization>> {
|
||||
trace!(target: "babe", "Retreiving peers");
|
||||
trace!(target: "babe", "Retrieving peers");
|
||||
&self.peers
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ impl<Epoch> ViableEpoch<Epoch> where
|
||||
}
|
||||
}
|
||||
|
||||
/// The datatype encoded on disk.
|
||||
/// The data type encoded on disk.
|
||||
#[derive(Clone, Encode, Decode)]
|
||||
pub enum PersistedEpoch<Epoch> {
|
||||
/// Genesis persisted epoch data. epoch_0, epoch_1.
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ impl<Block: BlockT, T: CacheItemT, S: Storage<Block, T>> ListCache<Block, T, S>
|
||||
// it is possible that we're inserting extra (but still required) fork here
|
||||
let new_storage_entry = StorageEntry {
|
||||
prev_valid_from: Some(prev_valid_from),
|
||||
value: value.expect("chcecked abpve that !value.is_none(); qed"),
|
||||
value: value.expect("checked above that !value.is_none(); qed"),
|
||||
};
|
||||
|
||||
tx.insert_storage_entry(&block, &new_storage_entry);
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ impl<Block: BlockT, T: CacheItemT> Entry<Block, T> {
|
||||
.map(|(entry, next)| (entry.valid_from, next)))
|
||||
}
|
||||
|
||||
/// Searches the list, ending with THIS entry for the best entry preceeding (or at)
|
||||
/// Searches the list, ending with THIS entry for the best entry preceding (or at)
|
||||
/// given block number.
|
||||
/// If the entry is found, result is the entry and the block id of next entry (if exists).
|
||||
/// NOTE that this function does not check that the passed block is actually linked to
|
||||
|
||||
@@ -48,7 +48,7 @@ pub fn extract_new_configuration<Header: HeaderT>(header: &Header) -> Option<&Op
|
||||
/// Opaque configuration cache transaction. During its lifetime, no-one should modify cache. This is currently
|
||||
/// guaranteed because import lock is held during block import/finalization.
|
||||
pub struct DbChangesTrieStorageTransaction<Block: BlockT> {
|
||||
/// Cache operations that must be performed after db transaction is comitted.
|
||||
/// Cache operations that must be performed after db transaction is committed.
|
||||
cache_ops: DbCacheTransactionOps<Block>,
|
||||
/// New configuration (if changed at current block).
|
||||
new_config: Option<Option<ChangesTrieConfiguration>>,
|
||||
|
||||
@@ -100,7 +100,7 @@ mod tests {
|
||||
children2.push(1_6);
|
||||
write_children(&mut tx, 0, PREFIX, 1_2, children2);
|
||||
|
||||
db.write(tx.clone()).expect("(2) Commiting transaction failed");
|
||||
db.write(tx.clone()).expect("(2) Committing transaction failed");
|
||||
|
||||
let r1: Vec<u32> = read_children(&db, 0, PREFIX, 1_1).expect("(1) Getting r1 failed");
|
||||
let r2: Vec<u32> = read_children(&db, 0, PREFIX, 1_2).expect("(1) Getting r2 failed");
|
||||
@@ -109,7 +109,7 @@ mod tests {
|
||||
assert_eq!(r2, vec![1_4, 1_6]);
|
||||
|
||||
remove_children(&mut tx, 0, PREFIX, 1_2);
|
||||
db.write(tx).expect("(2) Commiting transaction failed");
|
||||
db.write(tx).expect("(2) Committing transaction failed");
|
||||
|
||||
let r1: Vec<u32> = read_children(&db, 0, PREFIX, 1_1).expect("(2) Getting r1 failed");
|
||||
let r2: Vec<u32> = read_children(&db, 0, PREFIX, 1_2).expect("(2) Getting r2 failed");
|
||||
|
||||
@@ -741,7 +741,7 @@ impl<T: Clone> FrozenForDuration<T> {
|
||||
|
||||
/// Disk backend.
|
||||
///
|
||||
/// Disk backend keps data in a key-value store. In archive mode, trie nodes are kept from all blocks.
|
||||
/// Disk backend keeps data in a key-value store. In archive mode, trie nodes are kept from all blocks.
|
||||
/// Otherwise, trie nodes are kept only from some recent blocks.
|
||||
pub struct Backend<Block: BlockT> {
|
||||
storage: Arc<StorageDb<Block>>,
|
||||
@@ -878,7 +878,7 @@ impl<Block: BlockT> Backend<Block> {
|
||||
inmem
|
||||
}
|
||||
|
||||
/// Returns total numbet of blocks (headers) in the block DB.
|
||||
/// Returns total number of blocks (headers) in the block DB.
|
||||
#[cfg(feature = "test-helpers")]
|
||||
pub fn blocks_count(&self) -> u64 {
|
||||
self.blockchain.db.iter(columns::HEADER).count() as u64
|
||||
@@ -1000,7 +1000,7 @@ impl<Block: BlockT> Backend<Block> {
|
||||
Ok((*hash, number, false, true))
|
||||
}
|
||||
|
||||
// performs forced canonicaliziation with a delay after importing a non-finalized block.
|
||||
// performs forced canonicalization with a delay after importing a non-finalized block.
|
||||
fn force_delayed_canonicalize(
|
||||
&self,
|
||||
transaction: &mut DBTransaction,
|
||||
|
||||
@@ -815,7 +815,7 @@ pub(crate) mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_cht_fails_for_non_existant_cht() {
|
||||
fn get_cht_fails_for_non_existent_cht() {
|
||||
let cht_size: u64 = cht::size();
|
||||
assert!(LightStorage::<Block>::new_test().header_cht_root(cht_size, cht_size / 2).unwrap().is_none());
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ impl<B: BlockT> CacheChanges<B> {
|
||||
is_best,
|
||||
);
|
||||
let cache = &mut *cache;
|
||||
// Filter out commiting block if any.
|
||||
// Filter out committing block if any.
|
||||
let enacted: Vec<_> = enacted
|
||||
.iter()
|
||||
.filter(|h| commit_hash.as_ref().map_or(true, |p| *h != p))
|
||||
@@ -1453,7 +1453,7 @@ mod qc {
|
||||
|
||||
self.head_state(
|
||||
self.canon.last()
|
||||
.expect("wasn't forking to emptiness so there shoud be one!")
|
||||
.expect("wasn't forking to emptiness so there should be one!")
|
||||
.hash
|
||||
)
|
||||
},
|
||||
|
||||
@@ -118,7 +118,7 @@ fn current_version(path: &Path) -> sp_blockchain::Result<u32> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens database of givent type with given number of columns.
|
||||
/// Opens database of given type with given number of columns.
|
||||
fn open_database(db_path: &Path, db_type: DatabaseType, db_columns: u32) -> sp_blockchain::Result<Database> {
|
||||
let db_path = db_path.to_str()
|
||||
.ok_or_else(|| sp_blockchain::Error::Backend("Invalid database path".into()))?;
|
||||
|
||||
@@ -27,7 +27,7 @@ pub type Result<T> = std::result::Result<T, Error>;
|
||||
pub enum Error {
|
||||
/// Unserializable Data
|
||||
InvalidData(sp_serializer::Error),
|
||||
/// Trap occured during execution
|
||||
/// Trap occurred during execution
|
||||
Trap(wasmi::Trap),
|
||||
/// Wasmi loading/instantiating error
|
||||
Wasmi(wasmi::Error),
|
||||
|
||||
@@ -498,7 +498,7 @@ pub fn instantiate<'a, FE: SandboxCapabilities>(
|
||||
///
|
||||
/// This is generic over a supervisor function reference type.
|
||||
pub struct Store<FR> {
|
||||
// Memories and instances are `Some` untill torndown.
|
||||
// Memories and instances are `Some` until torn down.
|
||||
instances: Vec<Option<Rc<SandboxInstance<FR>>>>,
|
||||
memories: Vec<Option<MemoryRef>>,
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ struct Resolver<'a> {
|
||||
/// Will be used as initial and maximum size of the imported memory.
|
||||
heap_pages: usize,
|
||||
/// By default, runtimes should import memory and this is `Some(_)` after
|
||||
/// reolving. However, to be backwards compatible, we also support memory
|
||||
/// resolving. However, to be backwards compatible, we also support memory
|
||||
/// exported by the WASM blob (this will be `None` after resolving).
|
||||
import_memory: RefCell<Option<MemoryRef>>,
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use wasmtime::{Instance, Module, Memory, Table, Val};
|
||||
/// routines.
|
||||
pub struct InstanceWrapper {
|
||||
instance: Instance,
|
||||
// The memory instance of the `intance`.
|
||||
// The memory instance of the `instance`.
|
||||
//
|
||||
// It is important to make sure that we don't make any copies of this to make it easier to proof
|
||||
// See `memory_as_slice` and `memory_as_slice_mut`.
|
||||
@@ -142,7 +142,7 @@ impl InstanceWrapper {
|
||||
Val::I64(val) => Ok(Some(Value::I64(val))),
|
||||
Val::F32(val) => Ok(Some(Value::F32(val))),
|
||||
Val::F64(val) => Ok(Some(Value::F64(val))),
|
||||
_ => Err("Unknow value type".into()),
|
||||
_ => Err("Unknown value type".into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ mod cost {
|
||||
pub(super) const MALFORMED_CATCH_UP: Rep = Rep::new(-1000, "Grandpa: Malformed cath-up");
|
||||
pub(super) const MALFORMED_COMMIT: Rep = Rep::new(-1000, "Grandpa: Malformed commit");
|
||||
pub(super) const FUTURE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Future message");
|
||||
pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Uknown voter");
|
||||
pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Unknown voter");
|
||||
|
||||
pub(super) const INVALID_VIEW_CHANGE: Rep = Rep::new(-500, "Grandpa: Invalid view change");
|
||||
pub(super) const PER_UNDECODABLE_BYTE: i32 = -5;
|
||||
@@ -83,7 +83,7 @@ mod cost {
|
||||
pub(super) const INVALID_CATCH_UP: Rep = Rep::new(-5000, "Grandpa: Invalid catch-up");
|
||||
pub(super) const INVALID_COMMIT: Rep = Rep::new(-5000, "Grandpa: Invalid commit");
|
||||
pub(super) const OUT_OF_SCOPE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Out-of-scope message");
|
||||
pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up reqeust timeout");
|
||||
pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up request timeout");
|
||||
|
||||
// cost of answering a catch up request
|
||||
pub(super) const CATCH_UP_REPLY: Rep = Rep::new(-200, "Grandpa: Catch-up reply");
|
||||
@@ -153,14 +153,14 @@ pub(crate) struct NetworkBridge<B: BlockT, N: Network<B>> {
|
||||
|
||||
/// `NeighborPacketWorker` processing packets sent through the `NeighborPacketSender`.
|
||||
//
|
||||
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children,
|
||||
// thus one has to wrap neighor_packet_worker with an `Arc` `Mutex`.
|
||||
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children,
|
||||
// thus one has to wrap `neighbor_packet_worker` with an `Arc` `Mutex`.
|
||||
neighbor_packet_worker: Arc<Mutex<periodic::NeighborPacketWorker<B>>>,
|
||||
|
||||
/// Receiver side of the peer report stream populated by the gossip validator, forwarded to the
|
||||
/// gossip engine.
|
||||
//
|
||||
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children,
|
||||
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children,
|
||||
// thus one has to wrap gossip_validator_report_stream with an `Arc` `Mutex`. Given that it is
|
||||
// just an `UnboundedReceiver`, one could also switch to a multi-producer-*multi*-consumer
|
||||
// channel implementation.
|
||||
|
||||
@@ -920,7 +920,7 @@ pub(crate) mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finality_proof_check_fails_when_intemediate_fragment_has_unknown_headers() {
|
||||
fn finality_proof_check_fails_when_intermediate_fragment_has_unknown_headers() {
|
||||
let blockchain = test_blockchain();
|
||||
|
||||
// when intermediate (#0) fragment has non-empty unknown headers
|
||||
@@ -945,7 +945,7 @@ pub(crate) mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finality_proof_check_fails_when_intemediate_fragment_has_no_authorities_proof() {
|
||||
fn finality_proof_check_fails_when_intermediate_fragment_has_no_authorities_proof() {
|
||||
let blockchain = test_blockchain();
|
||||
|
||||
// when intermediate (#0) fragment has empty authorities proof
|
||||
@@ -1004,7 +1004,7 @@ pub(crate) mod tests {
|
||||
#[test]
|
||||
fn finality_proof_is_none_if_first_justification_is_generated_by_unknown_set() {
|
||||
// this is the case for forced change: set_id has been forcibly increased on full node
|
||||
// and ligh node missed that
|
||||
// and light node missed that
|
||||
// => justification verification will fail on light node anyways, so we do not return
|
||||
// finality proof at all
|
||||
let blockchain = test_blockchain();
|
||||
|
||||
@@ -147,7 +147,7 @@ impl TestNetFactory for GrandpaTestNet {
|
||||
use crate::light_import::tests::light_block_import_without_justifications;
|
||||
|
||||
let authorities_provider = Arc::new(self.test_config.clone());
|
||||
// forbid direct finalization using justification that cames with the block
|
||||
// forbid direct finalization using justification that came with the block
|
||||
// => light clients will try to fetch finality proofs
|
||||
let import = light_block_import_without_justifications(
|
||||
client.clone(),
|
||||
@@ -982,7 +982,7 @@ fn force_change_to_new_set() {
|
||||
|
||||
// it will only finalize if the forced transition happens.
|
||||
// we add_blocks after the voters are spawned because otherwise
|
||||
// the link-halfs have the wrong AuthoritySet
|
||||
// the link-halves have the wrong AuthoritySet
|
||||
run_to_completion(&mut runtime, 25, net, peers_a);
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ impl Store {
|
||||
/// Get public keys of all stored keys that match the key type.
|
||||
///
|
||||
/// This will just use the type of the public key (a list of which to be returned) in order
|
||||
/// to determine the key type. Unless you use a specialised application-type public key, then
|
||||
/// to determine the key type. Unless you use a specialized application-type public key, then
|
||||
/// this only give you keys registered under generic cryptography, and will not return keys
|
||||
/// registered under the application type.
|
||||
pub fn public_keys<Public: AppPublic>(&self) -> Result<Vec<Public>> {
|
||||
|
||||
@@ -45,7 +45,7 @@ mod rep {
|
||||
pub const DUPLICATE_GOSSIP: Rep = Rep::new(-(1 << 2), "Duplicate gossip");
|
||||
/// Reputation change when a peer sends us a gossip message for an unknown engine, whatever that
|
||||
/// means.
|
||||
pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossup message engine id");
|
||||
pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossip message engine id");
|
||||
/// Reputation change when a peer sends a message from a topic it isn't registered on.
|
||||
pub const UNREGISTERED_TOPIC: Rep = Rep::new(-(1 << 10), "Unregistered gossip message topic");
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ pub enum DiscoveryOut {
|
||||
/// e.g. obtained through the `identify` protocol.
|
||||
UnroutablePeer(PeerId),
|
||||
|
||||
/// The DHT yeided results for the record request, grouped in (key, value) pairs.
|
||||
/// The DHT yielded results for the record request, grouped in (key, value) pairs.
|
||||
ValueFound(Vec<(record::Key, Vec<u8>)>),
|
||||
|
||||
/// The record requested was not found in the DHT.
|
||||
|
||||
@@ -81,7 +81,7 @@ pub use light_client_handler::LightClientHandler;
|
||||
const REQUEST_TIMEOUT_SEC: u64 = 40;
|
||||
/// Interval at which we perform time based maintenance
|
||||
const TICK_TIMEOUT: time::Duration = time::Duration::from_millis(1100);
|
||||
/// Interval at which we propagate exstrinsics;
|
||||
/// Interval at which we propagate extrinsics;
|
||||
const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(2900);
|
||||
|
||||
/// Maximim number of known block hashes to keep for a peer.
|
||||
@@ -97,7 +97,7 @@ pub(crate) const MIN_VERSION: u32 = 3;
|
||||
// Maximum allowed entries in `BlockResponse`
|
||||
const MAX_BLOCK_DATA_RESPONSE: u32 = 128;
|
||||
/// When light node connects to the full node and the full node is behind light node
|
||||
/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it unuseful
|
||||
/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it not useful
|
||||
/// and disconnect to free connection slot.
|
||||
const LIGHT_MAXIMAL_BLOCKS_DIFFERENCE: u64 = 8192;
|
||||
|
||||
@@ -183,7 +183,7 @@ struct Peer<B: BlockT, H: ExHashT> {
|
||||
info: PeerInfo<B>,
|
||||
/// Current block request, if any.
|
||||
block_request: Option<(Instant, message::BlockRequest<B>)>,
|
||||
/// Requests we are no longer insterested in.
|
||||
/// Requests we are no longer interested in.
|
||||
obsolete_requests: HashMap<message::RequestId, Instant>,
|
||||
/// Holds a set of transactions known to this peer.
|
||||
known_extrinsics: LruHashSet<H>,
|
||||
|
||||
@@ -36,7 +36,7 @@ pub enum DhtEvent {
|
||||
/// The record has been successfully inserted into the DHT.
|
||||
ValuePut(Key),
|
||||
|
||||
/// An error has occured while putting a record into the DHT.
|
||||
/// An error has occurred while putting a record into the DHT.
|
||||
ValuePutFailed(Key),
|
||||
}
|
||||
|
||||
|
||||
@@ -836,10 +836,10 @@ where
|
||||
};
|
||||
if let Some(peer) = available_peer {
|
||||
let id = self.next_request_id();
|
||||
let rq = serialise_request(id, &request.request);
|
||||
let rq = serialize_request(id, &request.request);
|
||||
let mut buf = Vec::with_capacity(rq.encoded_len());
|
||||
if let Err(e) = rq.encode(&mut buf) {
|
||||
log::debug!("failed to serialise request {}: {}", id, e);
|
||||
log::debug!("failed to serialize request {}: {}", id, e);
|
||||
send_reply(Err(ClientError::RemoteFetchFailed), request.request)
|
||||
} else {
|
||||
log::trace!("sending request {} to peer {}", id, peer);
|
||||
@@ -917,7 +917,7 @@ fn retries<B: Block>(request: &Request<B>) -> usize {
|
||||
rc.unwrap_or(0)
|
||||
}
|
||||
|
||||
fn serialise_request<B: Block>(id: u64, request: &Request<B>) -> api::v1::light::Request {
|
||||
fn serialize_request<B: Block>(id: u64, request: &Request<B>) -> api::v1::light::Request {
|
||||
let request = match request {
|
||||
Request::Header { request, .. } => {
|
||||
let r = api::v1::light::RemoteHeaderRequest { block: request.block.encode() };
|
||||
@@ -1051,7 +1051,7 @@ where
|
||||
/// Sends a request to remote and awaits the response.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct OutboundProtocol {
|
||||
/// The serialised protobuf request.
|
||||
/// The serialized protobuf request.
|
||||
request: Vec<u8>,
|
||||
/// The max. request length in bytes.
|
||||
max_data_size: usize,
|
||||
|
||||
@@ -227,7 +227,7 @@ impl<Block: BlockT> FetchChecker<Block> for AlwaysBadChecker {
|
||||
impl<B: BlockT> LightDispatch<B> where
|
||||
B::Header: HeaderT,
|
||||
{
|
||||
/// Creates new light client requests processer.
|
||||
/// Creates new light client requests processor.
|
||||
pub fn new(checker: Arc<dyn FetchChecker<B>>) -> Self {
|
||||
LightDispatch {
|
||||
checker,
|
||||
@@ -567,7 +567,7 @@ impl<B: BlockT> LightDispatch<B> where
|
||||
// return peer to the back of the queue
|
||||
self.idle_peers.push_back(peer.clone());
|
||||
|
||||
// we have enumerated all peers and noone can handle request
|
||||
// we have enumerated all peers and no one can handle request
|
||||
if Some(peer) == last_peer {
|
||||
let request = self.pending_requests.pop_front().expect("checked in loop condition; qed");
|
||||
unhandled_requests.push_back(request);
|
||||
|
||||
@@ -209,13 +209,13 @@ pub mod generic {
|
||||
RemoteHeaderResponse(RemoteHeaderResponse<Header>),
|
||||
/// Remote changes request.
|
||||
RemoteChangesRequest(RemoteChangesRequest<Hash>),
|
||||
/// Remote changes reponse.
|
||||
/// Remote changes response.
|
||||
RemoteChangesResponse(RemoteChangesResponse<Number, Hash>),
|
||||
/// Remote child storage read request.
|
||||
RemoteReadChildRequest(RemoteReadChildRequest<Hash>),
|
||||
/// Finality proof request.
|
||||
FinalityProofRequest(FinalityProofRequest<Hash>),
|
||||
/// Finality proof reponse.
|
||||
/// Finality proof response.
|
||||
FinalityProofResponse(FinalityProofResponse<Hash>),
|
||||
/// Batch of consensus protocol messages.
|
||||
ConsensusBatch(Vec<ConsensusMessage>),
|
||||
|
||||
@@ -8,7 +8,7 @@ package api.v1;
|
||||
enum Direction {
|
||||
// Enumerate in ascending order (from child to parent).
|
||||
Ascending = 0;
|
||||
// Enumerate in descendfing order (from parent to canonical child).
|
||||
// Enumerate in descending order (from parent to canonical child).
|
||||
Descending = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -751,7 +751,7 @@ impl<B: BlockT> ChainSync<B> {
|
||||
| PeerSyncState::DownloadingFinalityProof(..) => Vec::new()
|
||||
}
|
||||
} else {
|
||||
// When request.is_none() just acccept blocks
|
||||
// When request.is_none() just accept blocks
|
||||
blocks.into_iter().map(|b| {
|
||||
IncomingBlock {
|
||||
hash: b.hash,
|
||||
@@ -955,7 +955,7 @@ impl<B: BlockT> ChainSync<B> {
|
||||
},
|
||||
Err(BlockImportError::MissingState) => {
|
||||
// This may happen if the chain we were requesting upon has been discarded
|
||||
// in the meantime becasue other chain has been finalized.
|
||||
// in the meantime because other chain has been finalized.
|
||||
// Don't mark it as bad as it still may be synced if explicitly requested.
|
||||
trace!(target: "sync", "Obsolete block");
|
||||
},
|
||||
|
||||
@@ -469,7 +469,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn anecstor_roots_are_finalized_when_finality_notification_is_missed() {
|
||||
fn ancestor_roots_are_finalized_when_finality_notification_is_missed() {
|
||||
let mut finality_proofs = ExtraRequests::<Block>::new("test");
|
||||
|
||||
let hash4 = [4; 32].into();
|
||||
|
||||
@@ -367,7 +367,7 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> NetworkWorker
|
||||
|
||||
/// Get network state.
|
||||
///
|
||||
/// **Note**: Use this only for debugging. This API is unstable. There are warnings literaly
|
||||
/// **Note**: Use this only for debugging. This API is unstable. There are warnings literally
|
||||
/// everywhere about this. Please don't use this function to retrieve actual information.
|
||||
pub fn network_state(&mut self) -> NetworkState {
|
||||
let swarm = &mut self.network_service;
|
||||
|
||||
@@ -766,7 +766,7 @@ pub trait TestNetFactory: Sized {
|
||||
|
||||
/// Blocks the current thread until we are sync'ed.
|
||||
///
|
||||
/// Calls `poll_until_sync` repeatidely with the runtime passed as parameter.
|
||||
/// Calls `poll_until_sync` repeatedly with the runtime passed as parameter.
|
||||
fn block_until_sync(&mut self, runtime: &mut tokio::runtime::current_thread::Runtime) {
|
||||
runtime.block_on(futures::future::poll_fn::<(), (), _>(|| Ok(self.poll_until_sync()))).unwrap();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! function returns a pair of [`HttpApi`] and [`HttpWorker`] that share some state.
|
||||
//!
|
||||
//! The [`HttpApi`] is (indirectly) passed to the runtime when calling an offchain worker, while
|
||||
//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimicks the API of the
|
||||
//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimics the API of the
|
||||
//! HTTP-related methods available to offchain workers.
|
||||
//!
|
||||
//! The reason for this design is driven by the fact that HTTP requests should continue running
|
||||
@@ -110,7 +110,7 @@ struct HttpApiRequestRp {
|
||||
}
|
||||
|
||||
impl HttpApi {
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_start(
|
||||
&mut self,
|
||||
method: &str,
|
||||
@@ -138,7 +138,7 @@ impl HttpApi {
|
||||
Ok(new_id)
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_add_header(
|
||||
&mut self,
|
||||
request_id: HttpRequestId,
|
||||
@@ -158,7 +158,7 @@ impl HttpApi {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_write_body(
|
||||
&mut self,
|
||||
request_id: HttpRequestId,
|
||||
@@ -266,7 +266,7 @@ impl HttpApi {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_wait(
|
||||
&mut self,
|
||||
ids: &[HttpRequestId],
|
||||
@@ -392,7 +392,7 @@ impl HttpApi {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_headers(
|
||||
&mut self,
|
||||
request_id: HttpRequestId
|
||||
@@ -411,7 +411,7 @@ impl HttpApi {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_read_body(
|
||||
&mut self,
|
||||
request_id: HttpRequestId,
|
||||
@@ -947,7 +947,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn fuzzing() {
|
||||
// Uses the API in random ways to try to trigger panicks.
|
||||
// Uses the API in random ways to try to trigger panics.
|
||||
// Doesn't test some paths, such as waiting for multiple requests. Also doesn't test what
|
||||
// happens if the server force-closes our socket.
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ pub struct HttpApi;
|
||||
pub struct HttpWorker;
|
||||
|
||||
impl HttpApi {
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_start(
|
||||
&mut self,
|
||||
_: &str,
|
||||
@@ -43,7 +43,7 @@ impl HttpApi {
|
||||
Err(())
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_add_header(
|
||||
&mut self,
|
||||
_: HttpRequestId,
|
||||
@@ -54,7 +54,7 @@ impl HttpApi {
|
||||
never be called; qed")
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn request_write_body(
|
||||
&mut self,
|
||||
_: HttpRequestId,
|
||||
@@ -65,7 +65,7 @@ impl HttpApi {
|
||||
never be called; qed")
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_wait(
|
||||
&mut self,
|
||||
requests: &[HttpRequestId],
|
||||
@@ -79,7 +79,7 @@ impl HttpApi {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_headers(
|
||||
&mut self,
|
||||
_: HttpRequestId
|
||||
@@ -88,7 +88,7 @@ impl HttpApi {
|
||||
never be called; qed")
|
||||
}
|
||||
|
||||
/// Mimicks the corresponding method in the offchain API.
|
||||
/// Mimics the corresponding method in the offchain API.
|
||||
pub fn response_read_body(
|
||||
&mut self,
|
||||
_: HttpRequestId,
|
||||
|
||||
@@ -217,6 +217,6 @@ mod tests {
|
||||
|
||||
// then
|
||||
assert_eq!(pool.0.status().ready, 1);
|
||||
assert_eq!(pool.0.ready().next().unwrap().is_propagateable(), false);
|
||||
assert_eq!(pool.0.ready().next().unwrap().is_propagable(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ pub trait AuthorApi<Hash, BlockHash> {
|
||||
/// Submit an extrinsic to watch.
|
||||
///
|
||||
/// See [`TransactionStatus`](sp_transaction_pool::TransactionStatus) for details on transaction
|
||||
/// lifecycle.
|
||||
/// life cycle.
|
||||
#[pubsub(
|
||||
subscription = "author_extrinsicUpdate",
|
||||
subscribe,
|
||||
|
||||
@@ -20,7 +20,7 @@ pub fn internal<E: ::std::fmt::Debug>(e: E) -> jsonrpc_core::Error {
|
||||
warn!("Unknown error: {:?}", e);
|
||||
jsonrpc_core::Error {
|
||||
code: jsonrpc_core::ErrorCode::InternalError,
|
||||
message: "Unknown error occured".into(),
|
||||
message: "Unknown error occurred".into(),
|
||||
data: Some(format!("{:?}", e).into()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ impl Subscriptions {
|
||||
|
||||
/// Borrows the internal task executor.
|
||||
///
|
||||
/// This can be used to spawn additional tasks on the underyling event loop.
|
||||
/// This can be used to spawn additional tasks on the underlying event loop.
|
||||
pub fn executor(&self) -> &TaskExecutor {
|
||||
&self.executor
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ where
|
||||
E: IntoPoolError + From<sp_transaction_pool::error::Error>,
|
||||
{
|
||||
pool.ready()
|
||||
.filter(|t| t.is_propagateable())
|
||||
.filter(|t| t.is_propagable())
|
||||
.map(|t| {
|
||||
let hash = t.hash().clone();
|
||||
let ex: B::Extrinsic = t.data().clone();
|
||||
|
||||
@@ -498,7 +498,7 @@ pub fn consensus<G, E, Fb, F, Lb, L>(
|
||||
const NUM_FULL_NODES: usize = 10;
|
||||
const NUM_LIGHT_NODES: usize = 10;
|
||||
const NUM_BLOCKS: usize = 10; // 10 * 2 sec block production time = ~20 seconds
|
||||
let temp = tempdir_with_prefix("substrate-conensus-test");
|
||||
let temp = tempdir_with_prefix("substrate-consensus-test");
|
||||
let mut network = TestNet::new(
|
||||
&temp,
|
||||
spec.clone(),
|
||||
|
||||
@@ -1192,7 +1192,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
// NOTE: we're setting the finalized block as best block, this might
|
||||
// be slightly inaccurate since we might have a "better" block
|
||||
// further along this chain, but since best chain selection logic is
|
||||
// pluggable we cannot make a better choice here. usages that need
|
||||
// plugable we cannot make a better choice here. usages that need
|
||||
// an accurate "best" block need to go through `SelectChain`
|
||||
// instead.
|
||||
operation.op.mark_head(BlockId::Hash(block))?;
|
||||
@@ -3041,7 +3041,7 @@ pub(crate) mod tests {
|
||||
.unwrap().build().unwrap().block;
|
||||
|
||||
// we will finalize A2 which should make it impossible to import a new
|
||||
// B3 at the same height but that doesnt't include it
|
||||
// B3 at the same height but that doesn't include it
|
||||
ClientExt::finalize_block(&client, BlockId::Hash(a2.hash()), None).unwrap();
|
||||
|
||||
let import_err = client.import(BlockOrigin::Own, b3).err().unwrap();
|
||||
|
||||
@@ -102,7 +102,7 @@ impl<E: fmt::Debug> fmt::Debug for Error<E> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
Error::Db(e) => e.fmt(f),
|
||||
Error::Decoding(e) => write!(f, "Error decoding slicable value: {}", e.what()),
|
||||
Error::Decoding(e) => write!(f, "Error decoding sliceable value: {}", e.what()),
|
||||
Error::InvalidBlock => write!(f, "Trying to canonicalize invalid block"),
|
||||
Error::InvalidBlockNumber => write!(f, "Trying to insert block with invalid number"),
|
||||
Error::InvalidParent => write!(f, "Trying to insert block with unknown parent"),
|
||||
|
||||
@@ -106,7 +106,7 @@ fn discard_descendants<BlockHash: Hash, Key: Hash>(
|
||||
// save to be discarded later.
|
||||
pinned_insertions.insert(overlay.hash.clone(), overlay.inserted);
|
||||
} else {
|
||||
// discard immediatelly.
|
||||
// discard immediately.
|
||||
parents.remove(&overlay.hash);
|
||||
discard_values(&mut values, overlay.inserted);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub struct RefWindow<BlockHash: Hash, Key: Hash> {
|
||||
death_rows: VecDeque<DeathRow<BlockHash, Key>>,
|
||||
/// An index that maps each key from `death_rows` to block number.
|
||||
death_index: HashMap<Key, u64>,
|
||||
/// Block number that corresponts to the front of `death_rows`
|
||||
/// Block number that corresponds to the front of `death_rows`.
|
||||
pending_number: u64,
|
||||
/// Number of call of `note_canonical` after
|
||||
/// last call `apply_pending` or `revert_pending`
|
||||
@@ -348,7 +348,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reinserted_survivew_pending() {
|
||||
fn reinserted_survive_pending() {
|
||||
let mut db = make_db(&[1, 2, 3]);
|
||||
let mut pruning: RefWindow<H256, H256> = RefWindow::new(&db).unwrap();
|
||||
let mut commit = make_commit(&[], &[2]);
|
||||
|
||||
@@ -126,7 +126,7 @@ pub struct Telemetry {
|
||||
|
||||
/// Behind the `Mutex` in `Telemetry`.
|
||||
///
|
||||
/// Note that ideally we wouldn't have to make the `Telemetry` clonable, as that would remove the
|
||||
/// Note that ideally we wouldn't have to make the `Telemetry` cloneable, as that would remove the
|
||||
/// need for a `Mutex`. However there is currently a weird hack in place in `sc-service`
|
||||
/// where we extract the telemetry registration so that it continues running during the shutdown
|
||||
/// process.
|
||||
@@ -195,7 +195,7 @@ impl Stream for Telemetry {
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
let before = Instant::now();
|
||||
|
||||
// Because the `Telemetry` is clonable, we need to put the actual fields behind a `Mutex`.
|
||||
// Because the `Telemetry` is cloneable, we need to put the actual fields behind a `Mutex`.
|
||||
// However, the user is only ever supposed to poll from one instance of `Telemetry`, while
|
||||
// the other instances are used only for RAII purposes.
|
||||
// We assume that the user is following this advice and therefore that the `Mutex` is only
|
||||
|
||||
@@ -138,7 +138,7 @@ impl<Hash, Extrinsic> InPoolTransaction for Transaction<Hash, Extrinsic> {
|
||||
&self.provides
|
||||
}
|
||||
|
||||
fn is_propagateable(&self) -> bool {
|
||||
fn is_propagable(&self) -> bool {
|
||||
self.propagate
|
||||
}
|
||||
}
|
||||
@@ -1058,7 +1058,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
|
||||
requires: vec![vec![3], vec![2]],
|
||||
provides: vec![vec![4]],
|
||||
propagate: true,
|
||||
}.is_propagateable(), true);
|
||||
}.is_propagable(), true);
|
||||
|
||||
assert_eq!(Transaction {
|
||||
data: vec![4u8],
|
||||
@@ -1069,7 +1069,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
|
||||
requires: vec![vec![3], vec![2]],
|
||||
provides: vec![vec![4]],
|
||||
propagate: false,
|
||||
}.is_propagateable(), false);
|
||||
}.is_propagable(), false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1126,7 +1126,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_accept_future_transactions_when_explcitly_asked_to() {
|
||||
fn should_accept_future_transactions_when_explicitly_asked_to() {
|
||||
// given
|
||||
let mut pool = pool();
|
||||
pool.reject_future_transactions = true;
|
||||
|
||||
@@ -58,7 +58,7 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
|
||||
|
||||
/// Creates a new watcher for given verified extrinsic.
|
||||
///
|
||||
/// The watcher can be used to subscribe to lifecycle events of that extrinsic.
|
||||
/// The watcher can be used to subscribe to life-cycle events of that extrinsic.
|
||||
pub fn create_watcher(&mut self, hash: H) -> watcher::Watcher<H, BlockHash<C>> {
|
||||
let sender = self.watchers.entry(hash.clone()).or_insert_with(watcher::Sender::default);
|
||||
sender.new_watcher(hash)
|
||||
|
||||
@@ -308,7 +308,7 @@ impl<B: ChainApi> Pool<B> {
|
||||
|
||||
let reverified_transactions = self.verify(at, pruned_transactions, false).await?;
|
||||
|
||||
log::trace!(target: "txpool", "Prunning at {:?}. Resubmitting transactions.", at);
|
||||
log::trace!(target: "txpool", "Pruning at {:?}. Resubmitting transactions.", at);
|
||||
// And finally - submit reverified transactions back to the pool
|
||||
|
||||
self.validated_pool.resubmit_pruned(
|
||||
|
||||
@@ -222,7 +222,7 @@ fn should_revalidate_during_maintenance() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_resubmit_from_retracted_during_maintaince() {
|
||||
fn should_resubmit_from_retracted_during_maintenance() {
|
||||
let xt = uxt(Alice, 209);
|
||||
let retracted_hash = Hash::random();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Examples of unacceptable behavior by participants include:
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
=== Facilitation, Not Strongarming
|
||||
=== Facilitation, Not Strong Arming
|
||||
|
||||
We recognize that this software is merely a tool for users to create and maintain their blockchain of preference. We see that blockchains are naturally community platforms with users being the ultimate decision makers. We assert that good software will maximize user agency by facilitate user-expression on the network. As such:
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ If your PR changes the external APIs or interfaces used by Polkadot, **a corresp
|
||||
|
||||
To update a corresponding Polkadot PR:
|
||||
|
||||
0. Pull lastet Polkadot master (or clone it, if you haven't yet).
|
||||
0. Pull latest Polkadot master (or clone it, if you haven't yet).
|
||||
1. Replace `polkadot-master` in all `Cargo.toml` with the name of the PR-branch - e.g. by running `find . -name "Cargo.toml" -exec sed -i "s/polkadot-master/PR_BRANCH/g" {}` (and to your repo, if the branch is not on mainline); Commit this change.
|
||||
2. Make the changes required to pass the build again.
|
||||
3. Submit all this as a PR against the Polkadot Repo, link that new PR in the existing substrate PR for reference
|
||||
|
||||
@@ -24,13 +24,13 @@ Substrate is designed for use in one of three ways:
|
||||
|
||||
**1. Trivial**: By running the Substrate binary `substrate` and configuring it with a genesis block that includes the current demonstration runtime. In this case, you just build Substrate, configure a JSON file, and launch your own blockchain. This affords you the least amount of customizability, primarily allowing you to change the genesis parameters of the various included runtime modules such as balances, staking, block-period, fees, and governance.
|
||||
|
||||
**2. Modular**: By hacking together pallets built with Substrate FRAME into a new runtime and possibly altering or reconfiguring the Substrate client's block authoring logic. This affords you a very large amount of freedom over your blockchain's logic, letting you change datatypes, add or remove modules, and crucially, add your own modules. Much can be changed without touching the block authoring logic (since it is generic). If this is the case, then the existing Substrate binary can be used for block authoring and syncing. If the block authoring logic needs to be tweaked, then a new, altered block authoring binary must be built as a separate project and used by validators. This is how the Polkadot relay chain is built and should suffice for almost all circumstances in the near to mid-term.
|
||||
**2. Modular**: By hacking together pallets built with Substrate FRAME into a new runtime and possibly altering or reconfiguring the Substrate client's block authoring logic. This affords you a very large amount of freedom over your blockchain's logic, letting you change data types, add or remove modules, and crucially, add your own modules. Much can be changed without touching the block authoring logic (since it is generic). If this is the case, then the existing Substrate binary can be used for block authoring and syncing. If the block authoring logic needs to be tweaked, then a new, altered block authoring binary must be built as a separate project and used by validators. This is how the Polkadot relay chain is built and should suffice for almost all circumstances in the near to mid-term.
|
||||
|
||||
**3. Generic**: The entire SRML can be ignored and the entire runtime designed and implemented from scratch. If desired, this can be done in a language other than Rust, provided it can target WebAssembly. If the runtime can be made compatible with the existing client's block authoring logic, then you can simply construct a new genesis block from your Wasm blob and launch your chain with the existing Rust-based Substrate client. If not, then you'll need to alter the client's block authoring logic accordingly. This is probably a useless option for most projects right now, but provides complete flexibility allowing for a long-term, far-reaching upgrade path for the Substrate paradigm.
|
||||
|
||||
=== The Basics of Substrate
|
||||
|
||||
Substrate is a blockchain platform with a completely generic state transition function. That said, it does come with both standards and conventions (particularly regarding the Runtime Module Library) regarding underlying data structures. Roughly speaking, these core datatypes correspond to +trait+s in terms of the actual non-negotiable standard and generic +struct+s in terms of the convention.
|
||||
Substrate is a blockchain platform with a completely generic state transition function. That said, it does come with both standards and conventions (particularly regarding the Runtime Module Library) regarding underlying data structures. Roughly speaking, these core data types correspond to +trait+s in terms of the actual non-negotiable standard and generic +struct+s in terms of the convention.
|
||||
|
||||
```
|
||||
Header := Parent + ExtrinsicsRoot + StorageRoot + Digest
|
||||
|
||||
@@ -36,7 +36,7 @@ Responsible investigation and reporting includes, but isn't limited to, the foll
|
||||
|
||||
## Bug Bounty Program
|
||||
|
||||
Our Bug Bounty Program allows us to recognise and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html).
|
||||
Our Bug Bounty Program allows us to recognize and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html).
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ There are a few crates with the `frame-` prefix. These do not contain domain-spe
|
||||
** only helpers may be published
|
||||
** purely testing crates must be `publish = false`
|
||||
|
||||
All tests that have to pull (dev)-dependencies out of their subtree and would thus break the dependency rules are considered intergration tests and should be stored in here. Only helper-crates in here shall be published, everything else is expected to be non-publish.
|
||||
All tests that have to pull (dev)-dependencies out of their subtree and would thus break the dependency rules are considered integration tests and should be stored in here. Only helper-crates in here shall be published, everything else is expected to be non-publish.
|
||||
|
||||
=== Binaries and template
|
||||
|
||||
|
||||
@@ -1224,7 +1224,7 @@ impl<T: Trait<I>, I: Instance> ReservableCurrency<T::AccountId> for Module<T, I>
|
||||
let actual = cmp::min(account.reserved, value);
|
||||
account.reserved -= actual;
|
||||
// defensive only: this can never fail since total issuance which is at least free+reserved
|
||||
// fits into the same datatype.
|
||||
// fits into the same data type.
|
||||
account.free = account.free.saturating_add(actual);
|
||||
value - actual
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Collective system: Members of a set of account IDs can make their collective feelings known
|
||||
//! through dispatched calls from one of two specialised origins.
|
||||
//! through dispatched calls from one of two specialized origins.
|
||||
//!
|
||||
//! The membership can be provided in one of two ways: either directly, using the Root-dispatchable
|
||||
//! function `set_members`, or indirectly, through implementing the `ChangeMembers`
|
||||
|
||||
@@ -141,7 +141,7 @@ Note that in case of storage modification we need to construct a key in the unde
|
||||
- then perform `blake2_256` hashing of the storage key.
|
||||
- concatenation of these hashes will constitute the key in the underlying storage.
|
||||
|
||||
There is also a special case to think of: if the balance of some account goes below `existential_deposit`, then all storage entries of that account will be erased, which requires time proprotional to the number of storage entries that account has.
|
||||
There is also a special case to think of: if the balance of some account goes below `existential_deposit`, then all storage entries of that account will be erased, which requires time proportional to the number of storage entries that account has.
|
||||
|
||||
**complexity**: `N` inserts into a `Map` or eventually into the storage (if committed). Every deleted account will induce removal of all its storage which is proportional to the number of storage entries that account has.
|
||||
|
||||
@@ -236,7 +236,7 @@ This function takes the code of the constructor and input data. Instantiation of
|
||||
|
||||
**Note** that the complexity of executing the constructor code should be considered separately.
|
||||
|
||||
**Note** that the complexity of `DetermineContractAddress` hook should be considered separately as well. Most likely it will use some kind of hashing over the code of the constructor and input data. The default `SimpleAddressDeterminator` does precisely that.
|
||||
**Note** that the complexity of `DetermineContractAddress` hook should be considered separately as well. Most likely it will use some kind of hashing over the code of the constructor and input data. The default `SimpleAddressDeterminer` does precisely that.
|
||||
|
||||
**Note** that the constructor returns code in the owned form and it's obtained via return facilities, which should have take fee for the return value.
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! A crate that hosts a common definitions that are relevent for the pallet-contracts.
|
||||
//! A crate that hosts a common definitions that are relevant for the pallet-contracts.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ sp_api::decl_runtime_apis! {
|
||||
|
||||
/// Returns the projected time a given contract will be able to sustain paying its rent.
|
||||
///
|
||||
/// The returned projection is relevent for the current block, i.e. it is as if the contract
|
||||
/// The returned projection is relevant for the current block, i.e. it is as if the contract
|
||||
/// was accessed at the current block.
|
||||
///
|
||||
/// Returns `Err` if the contract is in a tombstone state or doesn't exist.
|
||||
|
||||
@@ -138,7 +138,7 @@ pub trait ContractsApi<BlockHash, BlockNumber, AccountId, Balance> {
|
||||
|
||||
/// Returns the projected time a given contract will be able to sustain paying its rent.
|
||||
///
|
||||
/// The returned projection is relevent for the given block, i.e. it is as if the contract was
|
||||
/// The returned projection is relevant for the given block, i.e. it is as if the contract was
|
||||
/// accessed at the beginning of that block.
|
||||
///
|
||||
/// Returns `None` if the contract is exempted from rent.
|
||||
|
||||
@@ -1122,7 +1122,7 @@ mod tests {
|
||||
);
|
||||
});
|
||||
|
||||
// This test sends 50 units of currency as an endownment to a newly
|
||||
// This test sends 50 units of currency as an endowment to a newly
|
||||
// instantiated contract.
|
||||
ExtBuilder::default().existential_deposit(15).build().execute_with(|| {
|
||||
let mut loader = MockLoader::empty();
|
||||
|
||||
@@ -143,7 +143,7 @@ pub trait ComputeDispatchFee<Call, Balance> {
|
||||
fn compute_dispatch_fee(call: &Call) -> Balance;
|
||||
}
|
||||
|
||||
/// Information for managing an acocunt and its sub trie abstraction.
|
||||
/// Information for managing an account and its sub trie abstraction.
|
||||
/// This is the required info to cache for an account
|
||||
#[derive(Encode, Decode, RuntimeDebug)]
|
||||
pub enum ContractInfo<T: Trait> {
|
||||
@@ -432,8 +432,8 @@ pub trait Trait: frame_system::Trait {
|
||||
/// and the account id that requested the account creation.
|
||||
///
|
||||
/// Formula: `blake2_256(blake2_256(code) + blake2_256(data) + origin)`
|
||||
pub struct SimpleAddressDeterminator<T: Trait>(PhantomData<T>);
|
||||
impl<T: Trait> ContractAddressFor<CodeHash<T>, T::AccountId> for SimpleAddressDeterminator<T>
|
||||
pub struct SimpleAddressDeterminer<T: Trait>(PhantomData<T>);
|
||||
impl<T: Trait> ContractAddressFor<CodeHash<T>, T::AccountId> for SimpleAddressDeterminer<T>
|
||||
where
|
||||
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>
|
||||
{
|
||||
@@ -494,7 +494,7 @@ decl_module! {
|
||||
/// The minimum amount required to generate a tombstone.
|
||||
const TombstoneDeposit: BalanceOf<T> = T::TombstoneDeposit::get();
|
||||
|
||||
/// Size of a contract at the time of instantiaion. This is a simple way to ensure that
|
||||
/// Size of a contract at the time of instantiation. This is a simple way to ensure that
|
||||
/// empty contracts eventually gets deleted.
|
||||
const StorageSizeOffset: u32 = T::StorageSizeOffset::get();
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ pub fn snitch_contract_should_be_evicted<T: Trait>(
|
||||
}
|
||||
|
||||
/// Returns the projected time a given contract will be able to sustain paying its rent. The
|
||||
/// returned projection is relevent for the current block, i.e. it is as if the contract was
|
||||
/// returned projection is relevant for the current block, i.e. it is as if the contract was
|
||||
/// accessed at the beginning of the current block. Returns `None` in case if the contract was
|
||||
/// evicted before or as a result of the rent collection.
|
||||
///
|
||||
|
||||
@@ -597,7 +597,7 @@ fn dispatch_call() {
|
||||
topics: vec![],
|
||||
},
|
||||
|
||||
// Event emited as a result of dispatch.
|
||||
// Event emitted as a result of dispatch.
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: MetaEvent::contracts(RawEvent::Dispatched(BOB, true)),
|
||||
@@ -1052,7 +1052,7 @@ fn claim_surcharge_malus() {
|
||||
}
|
||||
|
||||
/// Claim surcharge with the given trigger_call at the given blocks.
|
||||
/// if removes is true then assert that the contract is a tombstonedead
|
||||
/// If `removes` is true then assert that the contract is a tombstone.
|
||||
fn claim_surcharge(blocks: u64, trigger_call: impl Fn() -> bool, removes: bool) {
|
||||
let (wasm, code_hash) = compile_module::<Test>(CODE_SET_RENT).unwrap();
|
||||
|
||||
@@ -2119,11 +2119,11 @@ const CODE_SELF_DESTRUCT: &str = r#"
|
||||
;; Read own address into memory.
|
||||
(call $ext_scratch_read
|
||||
(i32.const 16) ;; Pointer to write address to
|
||||
(i32.const 0) ;; Offset into scrach buffer
|
||||
(i32.const 0) ;; Offset into scratch buffer
|
||||
(i32.const 8) ;; Length of encoded address
|
||||
)
|
||||
|
||||
;; Recursively call self with empty imput data.
|
||||
;; Recursively call self with empty input data.
|
||||
(call $assert
|
||||
(i32.eq
|
||||
(call $ext_call
|
||||
@@ -2155,7 +2155,7 @@ const CODE_SELF_DESTRUCT: &str = r#"
|
||||
;; Read balance into memory.
|
||||
(call $ext_scratch_read
|
||||
(i32.const 8) ;; Pointer to write balance to
|
||||
(i32.const 0) ;; Offset into scrach buffer
|
||||
(i32.const 0) ;; Offset into scratch buffer
|
||||
(i32.const 8) ;; Length of encoded balance
|
||||
)
|
||||
|
||||
@@ -2484,7 +2484,7 @@ const CODE_SELF_DESTRUCTING_CONSTRUCTOR: &str = r#"
|
||||
;; Read balance into memory.
|
||||
(call $ext_scratch_read
|
||||
(i32.const 8) ;; Pointer to write balance to
|
||||
(i32.const 0) ;; Offset into scrach buffer
|
||||
(i32.const 0) ;; Offset into scratch buffer
|
||||
(i32.const 8) ;; Length of encoded balance
|
||||
)
|
||||
|
||||
|
||||
@@ -716,10 +716,10 @@ define_env!(Env, <E: Ext>,
|
||||
// Record a request to restore the caller contract to the specified contract.
|
||||
//
|
||||
// At the finalization stage, i.e. when all changes from the extrinsic that invoked this
|
||||
// contract are commited, this function will compute a tombstone hash from the caller's
|
||||
// contract are committed, this function will compute a tombstone hash from the caller's
|
||||
// storage and the given code hash and if the hash matches the hash found in the tombstone at
|
||||
// the specified address - kill the caller contract and restore the destination contract and set
|
||||
// the specified `rent_allowance`. All caller's funds are transfered to the destination.
|
||||
// the specified `rent_allowance`. All caller's funds are transferred to the destination.
|
||||
//
|
||||
// This function doesn't perform restoration right away but defers it to the end of the
|
||||
// transaction. If there is no tombstone in the destination address or if the hashes don't match
|
||||
|
||||
@@ -2066,7 +2066,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// If transactor already voted, delegated vote is overwriten.
|
||||
/// If transactor already voted, delegated vote is overwritten.
|
||||
fn single_proposal_should_work_with_vote_and_delegation() {
|
||||
new_test_ext().execute_with(|| {
|
||||
System::set_block_number(0);
|
||||
@@ -2121,7 +2121,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// If transactor voted, delegated vote is overwriten.
|
||||
/// If transactor voted, delegated vote is overwritten.
|
||||
fn single_proposal_should_work_with_delegation_and_vote() {
|
||||
new_test_ext().execute_with(|| {
|
||||
System::set_block_number(0);
|
||||
|
||||
@@ -81,7 +81,7 @@ mod tests;
|
||||
|
||||
// for B blocks following, there's a counting period whereby each of the candidates that believe
|
||||
// they fall in the top K+C voted can present themselves. they get the total stake
|
||||
// recorded (based on the snapshot); an ordered list is maintained (the leaderboard). Noone may
|
||||
// recorded (based on the snapshot); an ordered list is maintained (the leaderboard). No one may
|
||||
// present themselves that, if elected, would result in being included twice in the collective
|
||||
// (important since existing members will have their approval votes as it may be that they
|
||||
// don't get removed), nor if existing presenters would mean they're not in the top K+C.
|
||||
|
||||
@@ -29,7 +29,7 @@ pub struct Log {
|
||||
pub address: H160,
|
||||
/// Topics of the log.
|
||||
pub topics: Vec<H256>,
|
||||
/// Bytearray data of the log.
|
||||
/// Byte array data of the log.
|
||||
pub data: Vec<u8>,
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ decl_module! {
|
||||
|
||||
fn deposit_event() = default;
|
||||
|
||||
/// Despoit balance from currency/balances module into EVM.
|
||||
/// Deposit balance from currency/balances module into EVM.
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(10_000)]
|
||||
fn deposit_balance(origin, value: BalanceOf<T>) {
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//! not the internals of the module implementation. Only state inputs,
|
||||
//! outputs, and a brief description that mentions whether calling it
|
||||
//! requires root, but without repeating the source code details.
|
||||
//! Capitalise the first word of each documentation comment and end it with
|
||||
//! Capitalize the first word of each documentation comment and end it with
|
||||
//! a full stop. See
|
||||
//! <a href="https://github.com/paritytech/substrate#72-contributing-to-documentation-for-substrate-packages"
|
||||
//! target="_blank"> Generic example of annotating source code with documentation comments</a></li>
|
||||
@@ -383,7 +383,7 @@ decl_event!(
|
||||
// - Unsigned calls that can be of two kinds:
|
||||
// * "Inherent extrinsics" that are opinions generally held by the block
|
||||
// authors that build child blocks.
|
||||
// * Unsigned Transactions that are of intrinsic recognisable utility to the
|
||||
// * Unsigned Transactions that are of intrinsic recognizable utility to the
|
||||
// network, and are validated by the runtime.
|
||||
//
|
||||
// Information about where this dispatch initiated from is provided as the first argument
|
||||
@@ -572,7 +572,7 @@ impl<T: Trait> Module<T> {
|
||||
// method. This example will not cover this type of extension. See `CheckRuntime` in system module
|
||||
// for an example.
|
||||
//
|
||||
// Using the extension, you can add some hooks to the lifecycle of each transaction. Note that by
|
||||
// Using the extension, you can add some hooks to the life cycle of each transaction. Note that by
|
||||
// default, an extension is applied to all `Call` functions (i.e. all transactions). the `Call` enum
|
||||
// variant is given to each function of `SignedExtension`. Hence, you can filter based on module or
|
||||
// a particular call if needed.
|
||||
|
||||
@@ -208,7 +208,7 @@ impl<T: Trait> Subtrait for T {
|
||||
/// Asset creation options.
|
||||
#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)]
|
||||
pub struct AssetOptions<Balance: HasCompact, AccountId> {
|
||||
/// Initial issuance of this asset. All deposit to the creater of the asset.
|
||||
/// Initial issuance of this asset. All deposit to the creator of the asset.
|
||||
#[codec(compact)]
|
||||
pub initial_issuance: Balance,
|
||||
/// Which accounts are allowed to possess this asset.
|
||||
@@ -898,7 +898,7 @@ pub trait AssetIdProvider {
|
||||
fn asset_id() -> Self::AssetId;
|
||||
}
|
||||
|
||||
// wrapping these imbalanes in a private module is necessary to ensure absolute privacy
|
||||
// wrapping these imbalances in a private module is necessary to ensure absolute privacy
|
||||
// of the inner member.
|
||||
mod imbalances {
|
||||
use super::{
|
||||
|
||||
@@ -440,7 +440,7 @@ fn reserve_should_not_moves_amount_from_balance_to_reserved_balance() {
|
||||
// Then
|
||||
// - unreserved should return 20.
|
||||
#[test]
|
||||
fn unreserve_should_return_substratced_value_from_unreserved_amount_by_actual_acount_balance() {
|
||||
fn unreserve_should_return_subtracted_value_from_unreserved_amount_by_actual_account_balance() {
|
||||
ExtBuilder::default().free_balance((1, 0, 100)).build().execute_with(|| {
|
||||
GenericAsset::set_reserved_balance(&1, &0, 100);
|
||||
assert_eq!(GenericAsset::unreserve(&1, &0, 120), 20);
|
||||
@@ -553,7 +553,7 @@ fn slash_reserved_should_return_none() {
|
||||
// Then
|
||||
// - Should not return None.
|
||||
#[test]
|
||||
fn repatriate_reserved_return_amount_substracted_by_slash_amount() {
|
||||
fn repatriate_reserved_return_amount_subtracted_by_slash_amount() {
|
||||
ExtBuilder::default().build().execute_with(|| {
|
||||
GenericAsset::set_reserved_balance(&1, &0, 100);
|
||||
assert_eq!(GenericAsset::repatriate_reserved(&1, &0, &1, 130, BalanceStatus::Free), 30);
|
||||
|
||||
@@ -154,7 +154,7 @@ decl_storage! {
|
||||
/// DEPRECATED
|
||||
///
|
||||
/// This used to store the current authority set, which has been migrated to the well-known
|
||||
/// GRANDPA_AUTHORITES_KEY unhashed key.
|
||||
/// GRANDPA_AUTHORITIES_KEY unhashed key.
|
||||
#[cfg(feature = "migrate-authorities")]
|
||||
pub(crate) Authorities get(fn authorities): AuthorityList;
|
||||
|
||||
@@ -435,7 +435,7 @@ impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T>
|
||||
where I: Iterator<Item=(&'a T::AccountId, AuthorityId)>
|
||||
{
|
||||
// Always issue a change if `session` says that the validators have changed.
|
||||
// Even if their session keys are the same as before, the underyling economic
|
||||
// Even if their session keys are the same as before, the underlying economic
|
||||
// identities have changed.
|
||||
let current_set_id = if changed {
|
||||
let next_authorities = validators.map(|(_, k)| (k, 1)).collect::<Vec<_>>();
|
||||
|
||||
@@ -627,7 +627,7 @@ decl_module! {
|
||||
/// - `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:
|
||||
///
|
||||
/// ```nocompile
|
||||
/// Self::registrars(reg_index).uwnrap().fee
|
||||
/// Self::registrars(reg_index).unwrap().fee
|
||||
/// ```
|
||||
///
|
||||
/// Emits `JudgementRequested` if successful.
|
||||
|
||||
@@ -233,7 +233,7 @@ pub trait Trait: frame_system::Trait + pallet_session::historical::Trait {
|
||||
/// An expected duration of the session.
|
||||
///
|
||||
/// This parameter is used to determine the longevity of `heartbeat` transaction
|
||||
/// and a rough time when we should start considering sending hearbeats,
|
||||
/// and a rough time when we should start considering sending heartbeats,
|
||||
/// since the workers avoids sending them at the very beginning of the session, assuming
|
||||
/// there is a chance the authority will produce a block and they won't be necessary.
|
||||
type SessionDuration: Get<Self::BlockNumber>;
|
||||
@@ -369,7 +369,7 @@ decl_module! {
|
||||
type OffchainResult<T, A> = Result<A, OffchainErr<<T as frame_system::Trait>::BlockNumber>>;
|
||||
|
||||
/// Keep track of number of authored blocks per authority, uncles are counted as
|
||||
/// well since they're a valid proof of onlineness.
|
||||
/// well since they're a valid proof of being online.
|
||||
impl<T: Trait + pallet_authorship::Trait> pallet_authorship::EventHandler<T::ValidatorId, T::BlockNumber> for Module<T> {
|
||||
fn note_author(author: T::ValidatorId) {
|
||||
Self::note_authorship(author);
|
||||
@@ -576,7 +576,7 @@ impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
{
|
||||
// Tell the offchain worker to start making the next session's heartbeats.
|
||||
// Since we consider producing blocks as being online,
|
||||
// the heartbeat is defered a bit to prevent spaming.
|
||||
// the heartbeat is deferred a bit to prevent spamming.
|
||||
let block_number = <frame_system::Module<T>>::block_number();
|
||||
let half_session = T::SessionDuration::get() / 2.into();
|
||||
<HeartbeatAfter<T>>::put(block_number + half_session);
|
||||
|
||||
@@ -328,7 +328,7 @@ fn should_not_send_a_report_if_already_online() {
|
||||
|
||||
// then
|
||||
let transaction = pool_state.write().transactions.pop().unwrap();
|
||||
// All validators have `0` as their session key, but we should only produce 1 hearbeat.
|
||||
// All validators have `0` as their session key, but we should only produce 1 heartbeat.
|
||||
assert_eq!(pool_state.read().transactions.len(), 0);
|
||||
// check stuff about the transaction.
|
||||
let ex: Extrinsic = Decode::decode(&mut &*transaction).unwrap();
|
||||
|
||||
@@ -130,7 +130,7 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Assign an index already owned by the sender to another account. The balance reservation
|
||||
/// is effectively transfered to the new account.
|
||||
/// is effectively transferred to the new account.
|
||||
///
|
||||
/// The dispatch origin for this call must be _Signed_.
|
||||
///
|
||||
|
||||
@@ -233,7 +233,7 @@ mod tests {
|
||||
};
|
||||
use sp_core::H256;
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
||||
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, testing::Header};
|
||||
use frame_system::EnsureSignedBy;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use sp_core::RuntimeDebug;
|
||||
#[cfg(feature = "std")]
|
||||
type StringBuf = String;
|
||||
|
||||
/// Curent prefix of metadata
|
||||
/// Current prefix of metadata
|
||||
pub const META_RESERVED: u32 = 0x6174656d; // 'meta' warn endianness
|
||||
|
||||
/// On `no_std` we do not support `Decode` and thus `StringBuf` is just `&'static str`.
|
||||
|
||||
@@ -104,7 +104,7 @@ decl_error! {
|
||||
TooShort,
|
||||
/// A name is too long.
|
||||
TooLong,
|
||||
/// An account in't named.
|
||||
/// An account isn't named.
|
||||
Unnamed,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ struct TriageOutcome<T: Trait> {
|
||||
concurrent_offenders: Vec<OffenceDetails<T::AccountId, T::IdentificationTuple>>,
|
||||
}
|
||||
|
||||
/// An auxilary struct for working with storage of indexes localized for a specific offence
|
||||
/// An auxiliary struct for working with storage of indexes localized for a specific offence
|
||||
/// kind (specified by the `O` type parameter).
|
||||
///
|
||||
/// This struct is responsible for aggregating storage writes and the underlying storage should not
|
||||
|
||||
@@ -98,7 +98,7 @@ fn should_report_in_different_time_slot() {
|
||||
});
|
||||
|
||||
// when
|
||||
// reportfor the second time
|
||||
// report for the second time
|
||||
offence.time_slot += 1;
|
||||
Offences::report_offence(vec![], offence);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ impl<T: Trait> Randomness<T::Hash> for Module<T> {
|
||||
|
||||
let hash_series = <RandomMaterial<T>>::get();
|
||||
if !hash_series.is_empty() {
|
||||
// Always the case after block 1 is initialised.
|
||||
// Always the case after block 1 is initialized.
|
||||
hash_series.iter()
|
||||
.cycle()
|
||||
.skip(index)
|
||||
@@ -231,7 +231,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_random_material_parital() {
|
||||
fn test_random_material_partial() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let genesis_hash = System::parent_hash();
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
//! the number of friends chosen. This deposit is returned in full when the account
|
||||
//! owner removes their recovery configuration.
|
||||
//!
|
||||
//! ### Recovery Lifecycle
|
||||
//! ### Recovery Life Cycle
|
||||
//!
|
||||
//! The intended lifecycle of a successful recovery takes the following steps:
|
||||
//! The intended life cycle of a successful recovery takes the following steps:
|
||||
//! 1. The account owner calls `create_recovery` to set up a recovery configuration
|
||||
//! for their account.
|
||||
//! 2. At some later time, the account owner loses access to their account and wants
|
||||
|
||||
@@ -56,7 +56,7 @@ fn set_recovered_works() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recovery_lifecycle_works() {
|
||||
fn recovery_life_cycle_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let friends = vec![2, 3, 4];
|
||||
let threshold = 3;
|
||||
|
||||
@@ -22,7 +22,7 @@ use std::cell::RefCell;
|
||||
use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types};
|
||||
use sp_core::H256;
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
||||
use sp_runtime::{
|
||||
Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user