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§
sourcefn with_authenticated_signer(self, authenticated_signer: Option<Owner>) -> Self
fn with_authenticated_signer(self, authenticated_signer: Option<Owner>) -> Self
Returns the block with the given authenticated signer.
sourcefn with_operation(self, operation: impl Into<Operation>) -> Self
fn with_operation(self, operation: impl Into<Operation>) -> Self
Returns the block with the given operation appended at the end.
sourcefn with_transfer(
self,
owner: Option<Owner>,
recipient: Recipient,
amount: Amount,
) -> Self
fn with_transfer( self, owner: Option<Owner>, recipient: Recipient, amount: Amount, ) -> Self
Returns the block with a transfer operation appended at the end.
sourcefn with_simple_transfer(self, chain_id: ChainId, amount: Amount) -> Self
fn with_simple_transfer(self, chain_id: ChainId, amount: Amount) -> Self
Returns the block with a simple transfer operation appended at the end.
sourcefn with_incoming_bundle(self, incoming_bundle: IncomingBundle) -> Self
fn with_incoming_bundle(self, incoming_bundle: IncomingBundle) -> Self
Returns the block with the given message appended at the end.
sourcefn with_timestamp(self, timestamp: impl Into<Timestamp>) -> Self
fn with_timestamp(self, timestamp: impl Into<Timestamp>) -> Self
Returns the block with the specified timestamp.
sourcefn with_epoch(self, epoch: impl Into<Epoch>) -> Self
fn with_epoch(self, epoch: impl Into<Epoch>) -> Self
Returns the block with the specified epoch.
sourcefn into_proposal_with_round(
self,
key_pair: &AccountSecretKey,
round: Round,
) -> BlockProposal
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§
sourcefn into_first_proposal(self, key_pair: &AccountSecretKey) -> BlockProposal
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.