Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add API to report transactions #2294

Conversation

marcio-diaz
Copy link
Contributor

@marcio-diaz marcio-diaz commented Apr 16, 2019

PR for issue #2181
There will be follow up PRs

@marcio-diaz marcio-diaz added the A3-in_progress Pull request is in progress. No review needed at this stage. label Apr 16, 2019
@@ -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;
Copy link
Contributor

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

Copy link
Contributor

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)

@marcio-diaz marcio-diaz force-pushed the marcio/grandpa-equivocation-slashing-for-the-current-set branch from 04f05a4 to 06e84a3 Compare April 18, 2019 12:09
@marcio-diaz marcio-diaz force-pushed the marcio/grandpa-equivocation-slashing-for-the-current-set branch from 06e84a3 to 8691c8f Compare April 18, 2019 12:28
@marcio-diaz marcio-diaz changed the title init equivocation slashing for grandpa Add API to report transactions Apr 18, 2019
@marcio-diaz marcio-diaz added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. A4-gotissues labels Apr 18, 2019
@@ -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 {
Copy link
Member

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)

@gavofyork gavofyork added A5-grumble and removed A0-please_review Pull request needs code review. labels Apr 23, 2019
use rstd::vec::Vec;

#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)]
pub struct AuraEvidence {}
Copy link
Contributor

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 {}
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@marcio-diaz marcio-diaz deleted the marcio/grandpa-equivocation-slashing-for-the-current-set branch September 16, 2019 01:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants