Renaming and documentation for ApplyResult, ApplyOutcome and et al (#4134)

* Remove superflous errors from the system module

* Rename and document InclusionOutcome

* Rename InclusionError

* Remove unused inclusion errors.

I left the enumeration though since other elements might be used some day.

* Rename and document DispatchOutcome

* Apply suggestions from code review

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* TransactionValidityError instead of InclusionError

* Rename InclusionOutcome to ApplyExtrinsicResult

* Update docs.

* Update lib.rs

should be → is

* Bump the block builder API version.

* Fix the should_return_runtime_version test

* Clean the evidence
This commit is contained in:
Sergei Pepyakin
2019-11-22 17:15:58 +01:00
committed by GitHub
parent 86b6ac5571
commit 68351da29b
19 changed files with 186 additions and 129 deletions
@@ -754,7 +754,7 @@ pub trait SignedExtension: Codec + Debug + Sync + Send + Clone + Eq + PartialEq
call: &Self::Call,
info: Self::DispatchInfo,
len: usize,
) -> Result<Self::Pre, crate::ApplyError> {
) -> Result<Self::Pre, TransactionValidityError> {
self.validate(who, call, info.clone(), len)
.map(|_| Self::Pre::default())
.map_err(Into::into)
@@ -788,7 +788,7 @@ pub trait SignedExtension: Codec + Debug + Sync + Send + Clone + Eq + PartialEq
call: &Self::Call,
info: Self::DispatchInfo,
len: usize,
) -> Result<Self::Pre, crate::ApplyError> {
) -> Result<Self::Pre, TransactionValidityError> {
Self::validate_unsigned(call, info.clone(), len)
.map(|_| Self::Pre::default())
.map_err(Into::into)
@@ -835,7 +835,7 @@ impl<AccountId, Call, Info: Clone> SignedExtension for Tuple {
}
fn pre_dispatch(self, who: &Self::AccountId, call: &Self::Call, info: Self::DispatchInfo, len: usize)
-> Result<Self::Pre, crate::ApplyError>
-> Result<Self::Pre, TransactionValidityError>
{
Ok(for_tuples!( ( #( Tuple.pre_dispatch(who, call, info.clone(), len)? ),* ) ))
}
@@ -854,7 +854,7 @@ impl<AccountId, Call, Info: Clone> SignedExtension for Tuple {
call: &Self::Call,
info: Self::DispatchInfo,
len: usize,
) -> Result<Self::Pre, crate::ApplyError> {
) -> Result<Self::Pre, TransactionValidityError> {
Ok(for_tuples!( ( #( Tuple::pre_dispatch_unsigned(call, info.clone(), len)? ),* ) ))
}
@@ -912,7 +912,7 @@ pub trait Applyable: Sized + Send + Sync {
self,
info: Self::DispatchInfo,
len: usize,
) -> crate::ApplyResult;
) -> crate::ApplyExtrinsicResult;
}
/// Auxiliary wrapper that holds an api instance and binds it to the given lifetime.
@@ -992,7 +992,7 @@ pub trait ValidateUnsigned {
/// this function again to make sure we never include an invalid transaction.
///
/// Changes made to storage WILL be persisted if the call returns `Ok`.
fn pre_dispatch(call: &Self::Call) -> Result<(), crate::ApplyError> {
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError> {
Self::validate_unsigned(call)
.map(|_| ())
.map_err(Into::into)