Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Add fn to TestMinerService
Browse files Browse the repository at this point in the history
  • Loading branch information
XertroV committed Jun 15, 2018
1 parent 7a54866 commit c92845b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rpc/src/v1/tests/helpers/miner_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ impl MinerService for TestMinerService {
Ok(())
}

/// Imports transactions to queue - treats as local based on config and tx source
fn import_claimed_local_transaction<C: Nonce + Sync>(&self, chain: &C, pending: PendingTransaction)
-> Result<(), transaction::Error> {

// keep the pending nonces up to date
let sender = pending.transaction.sender();
let nonce = self.next_nonce(chain, &sender);
self.next_nonces.write().insert(sender, nonce);

// lets assume that all txs are valid
self.imported_transactions.lock().push(pending.transaction);

Ok(())
}

/// Called when blocks are imported to chain, updates transactions queue.
fn chain_new_blocks<C>(&self, _chain: &C, _imported: &[H256], _invalid: &[H256], _enacted: &[H256], _retracted: &[H256], _is_internal: bool) {
unimplemented!();
Expand Down

0 comments on commit c92845b

Please sign in to comment.