Allow runtime to return transaction validation error codes (#1534)

* Allow runtime to return more detailed transaction validation errors.

* Re-use ApplyError codes and update test-runtime.

* Fix pool tests.

* Revert using Compact for validity.
This commit is contained in:
Tomasz Drwięga
2019-01-29 19:06:05 +01:00
committed by Gav Wood
parent 473721f959
commit d2cfd7b9dc
9 changed files with 36 additions and 26 deletions
@@ -33,7 +33,7 @@ pub type TransactionTag = Vec<u8>;
#[cfg_attr(feature = "std", derive(Debug))]
pub enum TransactionValidity {
/// Transaction is invalid. Details are described by the error code.
Invalid,
Invalid(i8),
/// Transaction is valid.
Valid {
/// Priority of the transaction.
@@ -60,5 +60,5 @@ pub enum TransactionValidity {
longevity: TransactionLongevity,
},
/// Transaction validity can't be determined.
Unknown,
Unknown(i8),
}