Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7937af9
runtime: refactor Checkable and BlindCheckable traits
snd Jul 5, 2018
cf080b0
fix impl BlindCheckable for Extrinsic
snd Jul 5, 2018
0b2ff34
fix impl Checkable for TestXt
snd Jul 5, 2018
d277169
fix impl Checkable for UncheckedExtrinsic
snd Jul 5, 2018
60a9e0c
fix tabs
snd Jul 5, 2018
02eb103
add ::Address to system::Trait since its no longer in Checkable trait
snd Jul 6, 2018
b42b484
replace tab by space in comment
snd Jul 6, 2018
05fe805
replace occurences of Checkable::check with ::check_with
snd Jul 6, 2018
6a90ab5
tx-pool: replace CheckedIntrinsic type alias since it now would requi…
snd Jul 6, 2018
de69b7a
make more uses of Checkable compile
snd Jul 6, 2018
574b2a8
adapt Executive impl to new Checkable trait
snd Jul 6, 2018
8da0a5a
fix that CheckedExtrinsic takes AccountId not Address as first type p…
snd Jul 6, 2018
7cccc1d
Checkable trait: return error again since it's required in some cases
snd Jul 6, 2018
b147c0a
Checkable: improve docstrings
snd Jul 6, 2018
7642b81
consistent punctuation and capitalization in docstrings
snd Jul 7, 2018
70ab210
Ctx -> Context
snd Jul 9, 2018
f4fcebb
reduce trait bounds for impl Checkable for TestXt
snd Jul 9, 2018
21676fe
use <UncheckedExtrinsic as Checkable>::Checked
snd Jul 9, 2018
2e3e4a8
Revert "add ::Address to system::Trait since its no longer in Checkab…
snd Jul 9, 2018
6e550d8
runtime/executive: properly fix that Address no longer in Checkable
snd Jul 9, 2018
eef85e1
return `Result<Self::Checked, &'static str>` from `Checkable::check`
snd Jul 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tabs
  • Loading branch information
snd committed Jul 5, 2018
commit 60a9e0c6b20190a8edb5db451ddd14bc139f48d0
14 changes: 7 additions & 7 deletions substrate/runtime/primitives/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,27 +373,27 @@ pub type HashingFor<B> = <<B as Block>::Header as Header>::Hashing;
/// check the validity of a piece of extrinsic information, usually by verifying the signature.
/// for things that can be checked by providing additional context `Ctx`
pub trait Checkable<Ctx>: Sized {
Copy link
Member

@gavofyork gavofyork Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid unpronouncable "polish shortforms" like Ctx. Context is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed and fixed paritytech/polkadot@70ab210

type Checked;
type Checked;

fn check_with(self, ctx: Ctx) -> Result<Self::Checked, Self>;
fn check_with(self, ctx: Ctx) -> Result<Self::Checked, Self>;
}

/// A "checkable" piece of information, used by the standard Substrate Executive in order to
/// check the validity of a piece of extrinsic information, usually by verifying the signature.
/// for things that can be checked without additional context.
pub trait BlindCheckable: Sized {
type Checked;
type Checked;

/// gives back in case of an error.
fn check(self) -> Result<Self::Checked, Self>;
/// gives back in case of an error.
fn check(self) -> Result<Self::Checked, Self>;
}

// every BlindCheckable is also a Checkable for arbitrary context `Ctx`
impl<T: BlindCheckable, Ctx> Checkable<Ctx> for T {
type Checked = <Self as BlindCheckable>::Checked;
fn check_with(self, _: Ctx) -> Result<Self::Checked, Self> {
BlindCheckable::check(self)
}
BlindCheckable::check(self)
}
}

/// An "executable" piece of information, used by the standard Substrate Executive in order to
Expand Down