Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
antiochp committed Jun 28, 2019
1 parent 91d862b commit d19b3b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pool/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ pub enum TxSource {
Deaggregate,
}

impl TxSource {
/// Convenience fn for checking if this tx was sourced via the push api.
pub fn is_pushed(&self) -> bool {
match self {
TxSource::PushApi => true,
_ => false,
}
}
}

/// Possible errors when interacting with the transaction pool.
#[derive(Debug, Fail, PartialEq)]
pub enum PoolError {
Expand Down
2 changes: 1 addition & 1 deletion pool/tests/transaction_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use self::core::core::{transaction, Block, BlockHeader, Weighting};
use self::core::libtx;
use self::core::pow::Difficulty;
use self::keychain::{ExtKeychain, Keychain};
use self::pool::TxSource;
use self::util::RwLock;
use crate::common::*;
use self::pool::TxSource;
use grin_core as core;
use grin_keychain as keychain;
use grin_pool as pool;
Expand Down

0 comments on commit d19b3b3

Please sign in to comment.