Struct vapcore::miner::Miner [−][src]
Keeps track of transactions using priority queue and holds currently mined block. Handles preparing work for “work sealing” or seals “internally” if Engine does not require work.
Implementations
impl Miner
[src]
pub fn pending_transactions_receiver(&self) -> UnboundedReceiver<Arc<Vec<H256>>>
[src]
Set a callback to be notified about imported transactions’ hashes.
pub fn full_transactions_receiver(
&self
) -> UnboundedReceiver<Arc<Vec<(H256, TxStatus)>>>
[src]
&self
) -> UnboundedReceiver<Arc<Vec<(H256, TxStatus)>>>
Set a callback to be notified about imported transactions’ hashes.
pub fn new<A: LocalAccounts + 'static>(
options: MinerOptions,
gas_pricer: GasPricer,
spec: &Spec,
accounts: A
) -> Self
[src]
options: MinerOptions,
gas_pricer: GasPricer,
spec: &Spec,
accounts: A
) -> Self
Creates new instance of miner Arc.
pub fn new_for_tests(spec: &Spec, accounts: Option<HashSet<Address>>) -> Miner
[src]
Creates new instance of miner with given spec and accounts.
NOTE This should be only used for tests.
pub fn new_for_tests_force_sealing(
spec: &Spec,
accounts: Option<HashSet<Address>>,
force_sealing: bool
) -> Miner
[src]
spec: &Spec,
accounts: Option<HashSet<Address>>,
force_sealing: bool
) -> Miner
Creates new instance of miner with given spec and accounts.
NOTE This should be only used for tests.
pub fn set_io_channel(&self, io_channel: IoChannel<ClientIoMessage<Client>>)
[src]
Sets IoChannel
pub fn set_in_chain_checker<C>(&self, chain: &Arc<C>) where
C: TransactionInfo + Send + Sync + 'static,
[src]
C: TransactionInfo + Send + Sync + 'static,
Sets in-blockchain checker for transactions.
pub fn clear(&self)
[src]
Clear all pending block states
pub fn update_transaction_queue_limits(&self, block_gas_limit: U256)
[src]
Updates transaction queue verification limits.
Limits consist of current block gas limit and minimal gas price.
pub fn service_transaction_checker(&self) -> Option<ServiceTransactionChecker>
[src]
Returns ServiceTransactionChecker
Trait Implementations
impl MinerService for Miner
[src]
type State = State<StateDB>
Type representing chain state
fn authoring_params(&self) -> AuthoringParams
[src]
fn set_gas_range_target(&self, gas_range_target: (U256, U256))
[src]
fn set_extra_data(&self, extra_data: Bytes)
[src]
fn set_author<T: Into<Option<Author>>>(&self, author: T)
[src]
fn sensible_gas_price(&self) -> U256
[src]
fn sensible_gas_limit(&self) -> U256
[src]
fn set_minimal_gas_price(&self, new_price: U256) -> Result<bool, &str>
[src]
fn import_external_transactions<C: BlockChainClient>(
&self,
chain: &C,
transactions: Vec<UnverifiedTransaction>
) -> Vec<Result<(), Error>>
[src]
&self,
chain: &C,
transactions: Vec<UnverifiedTransaction>
) -> Vec<Result<(), Error>>
fn import_own_transaction<C: BlockChainClient>(
&self,
chain: &C,
pending: PendingTransaction
) -> Result<(), Error>
[src]
&self,
chain: &C,
pending: PendingTransaction
) -> Result<(), Error>
fn import_claimed_local_transaction<C: BlockChainClient>(
&self,
chain: &C,
pending: PendingTransaction,
trusted: bool
) -> Result<(), Error>
[src]
&self,
chain: &C,
pending: PendingTransaction,
trusted: bool
) -> Result<(), Error>
fn local_transactions(&self) -> BTreeMap<H256, Status>
[src]
fn queued_transactions(&self) -> Vec<Arc<VerifiedTransaction>>
[src]
fn queued_transaction_hashes(&self) -> Vec<H256>
[src]
fn pending_transaction_hashes<C>(&self, chain: &C) -> BTreeSet<H256> where
C: ChainInfo + Sync,
[src]
C: ChainInfo + Sync,
fn ready_transactions<C>(
&self,
chain: &C,
max_len: usize,
ordering: PendingOrdering
) -> Vec<Arc<VerifiedTransaction>> where
C: ChainInfo + Nonce + Sync,
[src]
&self,
chain: &C,
max_len: usize,
ordering: PendingOrdering
) -> Vec<Arc<VerifiedTransaction>> where
C: ChainInfo + Nonce + Sync,
fn ready_transactions_filtered<C>(
&self,
chain: &C,
max_len: usize,
filter: Option<FilterOptions>,
ordering: PendingOrdering
) -> Vec<Arc<VerifiedTransaction>> where
C: ChainInfo + Nonce + Sync,
[src]
&self,
chain: &C,
max_len: usize,
filter: Option<FilterOptions>,
ordering: PendingOrdering
) -> Vec<Arc<VerifiedTransaction>> where
C: ChainInfo + Nonce + Sync,
fn next_nonce<C>(&self, chain: &C, address: &Address) -> U256 where
C: Nonce + Sync,
[src]
C: Nonce + Sync,
fn transaction(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>>
[src]
fn remove_transaction(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>>
[src]
fn queue_status(&self) -> QueueStatus
[src]
fn pending_receipts(&self, best_block: BlockNumber) -> Option<Vec<RichReceipt>>
[src]
fn update_sealing<C>(&self, chain: &C, force: ForceUpdateSealing) where
C: BlockChain + CallContract + BlockProducer + SealedBlockImporter + Nonce + Sync,
[src]
C: BlockChain + CallContract + BlockProducer + SealedBlockImporter + Nonce + Sync,
Update sealing if required. Prepare the block and work if the Engine does not seal internally.
fn is_currently_sealing(&self) -> bool
[src]
fn work_package<C>(&self, chain: &C) -> Option<(H256, BlockNumber, u64, U256)> where
C: BlockChain + CallContract + BlockProducer + SealedBlockImporter + Nonce + Sync,
[src]
C: BlockChain + CallContract + BlockProducer + SealedBlockImporter + Nonce + Sync,
fn submit_seal(
&self,
block_hash: H256,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
[src]
&self,
block_hash: H256,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
fn chain_new_blocks<C>(
&self,
chain: &C,
imported: &[H256],
_invalid: &[H256],
enacted: &[H256],
retracted: &[H256],
is_internal_import: bool
) where
C: BlockChainClient,
[src]
&self,
chain: &C,
imported: &[H256],
_invalid: &[H256],
enacted: &[H256],
retracted: &[H256],
is_internal_import: bool
) where
C: BlockChainClient,
fn pending_state(&self, latest_block_number: BlockNumber) -> Option<Self::State>
[src]
fn pending_block_header(
&self,
latest_block_number: BlockNumber
) -> Option<Header>
[src]
&self,
latest_block_number: BlockNumber
) -> Option<Header>
fn pending_block(&self, latest_block_number: BlockNumber) -> Option<Block>
[src]
fn pending_transactions(
&self,
latest_block_number: BlockNumber
) -> Option<Vec<SignedTransaction>>
[src]
&self,
latest_block_number: BlockNumber
) -> Option<Vec<SignedTransaction>>
fn pending_receipt(
&self,
best_block: BlockNumber,
hash: &H256
) -> Option<RichReceipt>
[src]
&self,
best_block: BlockNumber,
hash: &H256
) -> Option<RichReceipt>
Auto Trait Implementations
impl !RefUnwindSafe for Miner
impl Send for Miner
impl Sync for Miner
impl Unpin for Miner
impl !UnwindSafe for Miner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,