Conversation
| #[derive(Clone, PartialEq, Eq, Encode, Decode)] | ||
| pub enum TransactionValidity { | ||
| Invalid, | ||
| Valid(TransactionPriority, Vec<TransactionTag>, Vec<TransactionTag>), |
There was a problem hiding this comment.
I would actually use a named fields here, cause we might easily forget which one was requires and which one provides.
| /// Information on a transaction's validity and, if valid, on how it relates to other transactions. | ||
| #[derive(Clone, PartialEq, Eq, Encode, Decode)] | ||
| pub enum TransactionValidity { | ||
| Invalid, |
There was a problem hiding this comment.
Should we allow also allow to give an optional reason for this?
There was a problem hiding this comment.
perhaps, but a 'static str/String isn't especially suitable as it's wasm -> runtime.
| /// side-effects; it merely checks whether the transaction would panic if it were included or not. | ||
| /// | ||
| /// Changes made to the storage should be discarded. | ||
| pub fn validate_transaction(uxt: Block::Extrinsic) -> TransactionValidity { |
There was a problem hiding this comment.
Might be easier to have something like Result<..> here and use ? syntax to early exit. Then maybe From<Result<..>> for TransactionValidity
| if xt.index() < &expected_index { | ||
| return TransactionValidity::Invalid | ||
| } | ||
| if *xt.index() > expected_index + As::sa(256) { |
There was a problem hiding this comment.
So this would be specific to runtime, right? The pool should not make any assumptions like this?
There was a problem hiding this comment.
right - this is just a sanity check. the pool should be ignorant of such things and rely on what the runtime is telling it.
…ech#741) * Bumped versions * Bump to latest substrate that exposes load_spec
First part of what described in #728 .
Also: