Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
'cancell' to 'cancel'
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Mar 28, 2019
1 parent f211bc5 commit 5f9eecc
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions core/client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ error_chain! {
display("Remote node has responded with invalid header proof"),
}

/// Remote fetch has been cancelled.
RemoteFetchCancelled {
description("remote fetch cancelled"),
display("Remote data fetch has been cancelled"),
/// Remote fetch has been canceled.
RemoteFetchCanceled {
description("remote fetch canceled"),
display("Remote data fetch has been canceled"),
}

/// Remote fetch has been failed.
Expand Down
2 changes: 1 addition & 1 deletion core/consensus/rhd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ mod tests {
assert!(service.live_agreement.lock().as_ref().unwrap().0 != first);
assert!(service.live_agreement.lock().as_ref().unwrap().0 == second);

// first_bft has been cancelled. need to swap out so we can check it.
// first_bft has been canceled. need to swap out so we can check it.
let (_tx, mut rx) = oneshot::channel();
::std::mem::swap(&mut rx, &mut first_bft.cancel);

Expand Down
2 changes: 1 addition & 1 deletion core/network/src/on_demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<T> Future for RemoteResponse<T> {

fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
self.receiver.poll()
.map_err(|_| ClientErrorKind::RemoteFetchCancelled.into())
.map_err(|_| ClientErrorKind::RemoteFetchCanceled.into())
.and_then(|r| match r {
Async::Ready(Ok(ready)) => Ok(Async::Ready(ready)),
Async::Ready(Err(error)) => Err(error),
Expand Down
2 changes: 1 addition & 1 deletion core/peerset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl PeersetMut {
/// a corresponding `Accept` or `Reject`, except if we were already connected to this peer.
///
/// Note that this mechanism is orthogonal to `Connect`/`Drop`. Accepting an incoming
/// connection implicitely means `Accept`, but incoming connections aren't cancelled by
/// connection implicitely means `Accept`, but incoming connections aren't canceled by
/// `dropped`.
///
/// Because of concurrency issues, it is acceptable to call `incoming` with a `PeerId` the
Expand Down
2 changes: 1 addition & 1 deletion core/rpc/src/subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Subscriptions {
///
/// Second parameter is a function that converts Subscriber sink into a future.
/// This future will be driven to completion bu underlying event loop
/// or will be cancelled in case #cancel is invoked.
/// or will be canceled in case #cancel is invoked.
pub fn add<T, E, G, R, F>(&self, subscriber: Subscriber<T, E>, into_future: G) where
G: FnOnce(Sink<T, E>) -> R,
R: future::IntoFuture<Future=F, Item=(), Error=()>,
Expand Down
2 changes: 1 addition & 1 deletion srml/council/src/seats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ decl_module! {
}
}

/// Remove a voter. All votes are cancelled and the voter deposit is returned.
/// Remove a voter. All votes are canceled and the voter deposit is returned.
fn retract_voter(origin, #[compact] index: u32) {
let who = ensure_signed(origin)?;

Expand Down
26 changes: 13 additions & 13 deletions srml/council/src/voting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ decl_storage! {

decl_event!(
pub enum Event<T> where <T as system::Trait>::Hash {
/// A voting tally has happened for a referendum cancellation vote.
/// A voting tally has happened for a referendum cancelation vote.
/// Last three are yes, no, abstain counts.
TallyCancelation(Hash, u32, u32, u32),
/// A voting tally has happened for a referendum vote.
Expand Down Expand Up @@ -265,16 +265,16 @@ mod tests {
}

#[test]
fn referendum_cancellation_should_work_when_unanimous() {
fn referendum_cancelation_should_work_when_unanimous() {
with_externalities(&mut new_test_ext(true), || {
System::set_block_number(1);
let proposal = set_balance_proposal(42);
assert_ok!(Democracy::internal_start_referendum(proposal.clone(), VoteThreshold::SuperMajorityApprove, 0), 0);
assert_eq!(Democracy::active_referendums(), vec![(0, ReferendumInfo::new(4, proposal, VoteThreshold::SuperMajorityApprove, 0))]);

let cancellation = cancel_referendum_proposal(0);
let hash = cancellation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancellation)));
let cancelation = cancel_referendum_proposal(0);
let hash = cancelation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancelation)));
assert_ok!(CouncilVoting::vote(Origin::signed(2), hash, true));
assert_ok!(CouncilVoting::vote(Origin::signed(3), hash, true));
assert_eq!(CouncilVoting::proposals(), vec![(2, hash)]);
Expand All @@ -288,15 +288,15 @@ mod tests {
}

#[test]
fn referendum_cancellation_should_fail_when_not_unanimous() {
fn referendum_cancelation_should_fail_when_not_unanimous() {
with_externalities(&mut new_test_ext(true), || {
System::set_block_number(1);
let proposal = set_balance_proposal(42);
assert_ok!(Democracy::internal_start_referendum(proposal.clone(), VoteThreshold::SuperMajorityApprove, 0), 0);

let cancellation = cancel_referendum_proposal(0);
let hash = cancellation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancellation)));
let cancelation = cancel_referendum_proposal(0);
let hash = cancelation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancelation)));
assert_ok!(CouncilVoting::vote(Origin::signed(2), hash, true));
assert_ok!(CouncilVoting::vote(Origin::signed(3), hash, false));
assert_ok!(CouncilVoting::end_block(System::block_number()));
Expand All @@ -308,15 +308,15 @@ mod tests {
}

#[test]
fn referendum_cancellation_should_fail_when_abstentions() {
fn referendum_cancelation_should_fail_when_abstentions() {
with_externalities(&mut new_test_ext(true), || {
System::set_block_number(1);
let proposal = set_balance_proposal(42);
assert_ok!(Democracy::internal_start_referendum(proposal.clone(), VoteThreshold::SuperMajorityApprove, 0), 0);

let cancellation = cancel_referendum_proposal(0);
let hash = cancellation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancellation)));
let cancelation = cancel_referendum_proposal(0);
let hash = cancelation.blake2_256().into();
assert_ok!(CouncilVoting::propose(Origin::signed(1), Box::new(cancelation)));
assert_ok!(CouncilVoting::vote(Origin::signed(2), hash, true));
assert_ok!(CouncilVoting::end_block(System::block_number()));

Expand Down
4 changes: 2 additions & 2 deletions srml/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ decl_event!(
Started(ReferendumIndex, VoteThreshold),
Passed(ReferendumIndex),
NotPassed(ReferendumIndex),
Cancelled(ReferendumIndex),
Canceled(ReferendumIndex),
Executed(ReferendumIndex, bool),
Delegated(AccountId, AccountId),
Undelegated(AccountId),
Expand Down Expand Up @@ -347,7 +347,7 @@ impl<T: Trait> Module<T> {

/// Remove a referendum. Can be called directly by the council.
pub fn internal_cancel_referendum(ref_index: ReferendumIndex) {
Self::deposit_event(RawEvent::Cancelled(ref_index));
Self::deposit_event(RawEvent::Canceled(ref_index));
<Module<T>>::clear_referendum(ref_index);
}

Expand Down

0 comments on commit 5f9eecc

Please sign in to comment.