Trait validator_set::ValidatorSet [−][src]
A validator set.
Required methods
fn default_caller(&self, block_id: BlockId) -> Box<Call<'_>>
[src]
Get the default “Call” helper, for use in general operation.
fn is_epoch_end(&self, first: bool, chain_head: &Header) -> Option<Vec<u8>>
[src]
Whether this block is the last one in its epoch.
Indicates that the validator set changed at the given block in a manner that doesn’t require finality.
first
is true if this is the first block in the set.
fn signals_epoch_end(
&self,
first: bool,
header: &Header,
aux: AuxiliaryData<'_>
) -> EpochChange
[src]
&self,
first: bool,
header: &Header,
aux: AuxiliaryData<'_>
) -> EpochChange
Whether the given block signals the end of an epoch, but change won’t take effect until finality.
Engine should set first
only if the header is genesis. Multiplexing validator
sets can set first
to internal changes.
fn epoch_set(
&self,
first: bool,
mashina: &Machine,
number: BlockNumber,
proof: &[u8]
) -> Result<(SimpleList, Option<H256>), VapcoreError>
[src]
&self,
first: bool,
mashina: &Machine,
number: BlockNumber,
proof: &[u8]
) -> Result<(SimpleList, Option<H256>), VapcoreError>
Recover the validator set from the given proof, the block number, and whether this header is first in its set.
May fail if the given header doesn’t kick off an epoch or the proof is invalid.
Returns the set, along with a flag indicating whether finality of a specific hash should be proven.
fn contains_with_caller(
&self,
parent_block_hash: &H256,
address: &Address,
caller: &Call<'_>
) -> bool
[src]
&self,
parent_block_hash: &H256,
address: &Address,
caller: &Call<'_>
) -> bool
Checks if a given address is a validator, with the given function for executing synchronous calls to contracts.
fn get_with_caller(
&self,
parent_block_hash: &H256,
nonce: usize,
caller: &Call<'_>
) -> Address
[src]
&self,
parent_block_hash: &H256,
nonce: usize,
caller: &Call<'_>
) -> Address
Draws an validator nonce modulo number of validators.
fn count_with_caller(
&self,
parent_block_hash: &H256,
caller: &Call<'_>
) -> usize
[src]
&self,
parent_block_hash: &H256,
caller: &Call<'_>
) -> usize
Returns the current number of validators.
Provided methods
fn contains(&self, parent: &H256, address: &Address) -> bool
[src]
Checks if a given address is a validator, using underlying, default call mechanism.
fn get(&self, parent: &H256, nonce: usize) -> Address
[src]
Draws an validator nonce modulo number of validators.
fn count(&self, parent: &H256) -> usize
[src]
Returns the current number of validators.
fn on_epoch_begin(
&self,
_first: bool,
_header: &Header,
_call: &mut SystemCall<'_>
) -> Result<(), VapcoreError>
[src]
&self,
_first: bool,
_header: &Header,
_call: &mut SystemCall<'_>
) -> Result<(), VapcoreError>
Signalling that a new epoch has begun.
All calls here will be from the SYSTEM_ADDRESS
: 2^160 - 2
and will have an effect on the block’s state.
The caller provided here may not generate proofs.
first
is true if this is the first block in the set.
fn genesis_epoch_data(
&self,
_header: &Header,
_call: &Call<'_>
) -> Result<Vec<u8>, String>
[src]
&self,
_header: &Header,
_call: &Call<'_>
) -> Result<Vec<u8>, String>
Extract genesis epoch data from the genesis state and header.
fn report_malicious(
&self,
_validator: &Address,
_set_block: BlockNumber,
_block: BlockNumber,
_proof: Bytes
)
[src]
&self,
_validator: &Address,
_set_block: BlockNumber,
_block: BlockNumber,
_proof: Bytes
)
Notifies about malicious behaviour.
fn report_benign(
&self,
_validator: &Address,
_set_block: BlockNumber,
_block: BlockNumber
)
[src]
&self,
_validator: &Address,
_set_block: BlockNumber,
_block: BlockNumber
)
Notifies about benign misbehaviour.
fn register_client(&self, _client: Weak<dyn EngineClient>)
[src]
Allows blockchain state access.
Trait Implementations
impl AsRef<dyn ValidatorSet + 'static> for SimpleList
[src]
fn as_ref(&self) -> &dyn ValidatorSet
[src]
Implementors
impl ValidatorSet for SimpleList
[src]
fn default_caller(&self, _block_id: BlockId) -> Box<Call<'_>>
[src]
fn is_epoch_end(&self, first: bool, _chain_head: &Header) -> Option<Vec<u8>>
[src]
fn signals_epoch_end(
&self,
_: bool,
_: &Header,
_: AuxiliaryData<'_>
) -> EpochChange
[src]
&self,
_: bool,
_: &Header,
_: AuxiliaryData<'_>
) -> EpochChange
fn epoch_set(
&self,
_first: bool,
_: &Machine,
_: BlockNumber,
_: &[u8]
) -> Result<(SimpleList, Option<H256>), VapcoreError>
[src]
&self,
_first: bool,
_: &Machine,
_: BlockNumber,
_: &[u8]
) -> Result<(SimpleList, Option<H256>), VapcoreError>
fn contains_with_caller(
&self,
_bh: &H256,
address: &Address,
_: &Call<'_>
) -> bool
[src]
&self,
_bh: &H256,
address: &Address,
_: &Call<'_>
) -> bool