-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add API to report transactions #2294
Add API to report transactions #2294
Conversation
core/client/src/runtime_api.rs
Outdated
@@ -139,6 +139,7 @@ decl_runtime_apis! { | |||
pub trait TaggedTransactionQueue { | |||
/// Validate the given transaction. | |||
fn validate_transaction(tx: <Block as BlockT>::Extrinsic) -> TransactionValidity; | |||
fn get_account_nonce(account_id: &sr25519::Public) -> u64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not general enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(i would do the nonce-fetching on a per-runtime basis, but we have designed the abstraction of TaggedTransactionQueue
specifically to avoid nonces in this layer)
04f05a4
to
06e84a3
Compare
06e84a3
to
8691c8f
Compare
srml/system/src/lib.rs
Outdated
@@ -364,6 +364,10 @@ pub fn ensure_inherent<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<(), &'s | |||
} | |||
|
|||
impl<T: Trait> Module<T> { | |||
pub fn get_account_nonce(account: &T::AccountId) -> T::Index { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is exactly equivalent to account_nonce
function (pub AccountNonce get(account_nonce)
creates it)
use rstd::vec::Vec; | ||
|
||
#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)] | ||
pub struct AuraEvidence {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs docs. Also, favor pub struct AuraEvidence;
(braced empty structs should be used in macros only).
@@ -30,6 +30,9 @@ use rstd::vec::Vec; | |||
|
|||
use ed25519::Public as AuthorityId; | |||
|
|||
#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)] | |||
pub struct GrandpaEvidence {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
PR for issue #2181
There will be follow up PRs