Trait linera_chain::test::BlockTestExt

source ·
pub trait BlockTestExt: Sized {
    // Required methods
    fn with_authenticated_signer(
        self,
        authenticated_signer: Option<Owner>,
    ) -> Self;
    fn with_operation(self, operation: impl Into<Operation>) -> Self;
    fn with_transfer(
        self,
        owner: Option<Owner>,
        recipient: Recipient,
        amount: Amount,
    ) -> Self;
    fn with_simple_transfer(self, chain_id: ChainId, amount: Amount) -> Self;
    fn with_incoming_bundle(self, incoming_bundle: IncomingBundle) -> Self;
    fn with_timestamp(self, timestamp: impl Into<Timestamp>) -> Self;
    fn with_epoch(self, epoch: impl Into<Epoch>) -> Self;
    fn into_proposal_with_round(
        self,
        key_pair: &AccountSecretKey,
        round: Round,
    ) -> BlockProposal;

    // Provided method
    fn into_first_proposal(self, key_pair: &AccountSecretKey) -> BlockProposal { ... }
}
Expand description

A helper trait to simplify constructing blocks for tests.

Required Methods§

source

fn with_authenticated_signer(self, authenticated_signer: Option<Owner>) -> Self

Returns the block with the given authenticated signer.

source

fn with_operation(self, operation: impl Into<Operation>) -> Self

Returns the block with the given operation appended at the end.

source

fn with_transfer( self, owner: Option<Owner>, recipient: Recipient, amount: Amount, ) -> Self

Returns the block with a transfer operation appended at the end.

source

fn with_simple_transfer(self, chain_id: ChainId, amount: Amount) -> Self

Returns the block with a simple transfer operation appended at the end.

source

fn with_incoming_bundle(self, incoming_bundle: IncomingBundle) -> Self

Returns the block with the given message appended at the end.

source

fn with_timestamp(self, timestamp: impl Into<Timestamp>) -> Self

Returns the block with the specified timestamp.

source

fn with_epoch(self, epoch: impl Into<Epoch>) -> Self

Returns the block with the specified epoch.

source

fn into_proposal_with_round( self, key_pair: &AccountSecretKey, round: Round, ) -> BlockProposal

Returns a block proposal without any hashed certificate values or validated block.

Provided Methods§

source

fn into_first_proposal(self, key_pair: &AccountSecretKey) -> BlockProposal

Returns a block proposal in the first round in a default ownership configuration (Round::MultiLeader(0)) without any hashed certificate values or validated block.

Object Safety§

This trait is not object safe.

Implementors§