Struct tendermint_testgen::light_block::LightBlock

source ·
pub struct LightBlock {
    pub header: Option<Header>,
    pub commit: Option<Commit>,
    pub validators: Option<Vec<Validator>>,
    pub next_validators: Option<Vec<Validator>>,
    pub provider: Option<Id>,
}
Expand description

We use this data structure as a simplistic representation of LightClient’s LightBlock

Fields§

§header: Option<Header>§commit: Option<Commit>§validators: Option<Vec<Validator>>§next_validators: Option<Vec<Validator>>§provider: Option<Id>

Implementations§

source§

impl LightBlock

source

pub fn new(header: Header, commit: Commit) -> Self

Constructs a new Testgen-specific light block

source

pub fn validators(self, validators: &[Validator]) -> Self

source

pub fn next_validators(self, next_validators: &[Validator]) -> Self

source

pub fn provider(self, provider: &str) -> Self

source

pub fn new_default(height: u64) -> Self

source

pub fn new_default_with_time_and_chain_id( chain_id: String, time: Time, height: u64 ) -> Self

source

pub fn new_default_with_header(header: Header) -> Self

source

pub fn next(&self) -> Self

Produces a subsequent, i.e. at (height+1), light block to the supplied one

source

pub fn height(&self) -> u64

returns the height of LightBlock’s header

source

pub fn chain_id(&self) -> String

returns the chain_id of LightBlock’s header

source

pub fn last_block_id_hash(&self) -> Option<Hash>

returns the last_block_id hash of LightBlock’s header

Trait Implementations§

source§

impl Clone for LightBlock

source§

fn clone(&self) -> LightBlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LightBlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for LightBlock

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromStr for LightBlock

§

type Err = SimpleError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Generator<TmLightBlock> for LightBlock

source§

fn merge_with_default(self, default: Self) -> Self

Merge this companion with the another, default one. The options present in this object will override those in the default one.
source§

fn generate(&self) -> Result<TmLightBlock, SimpleError>

Generate the complex object from this companion object.
source§

fn encode(&self) -> Result<String, SimpleError>

Generate and serialize the complex object
source§

impl Options for LightBlock

source§

fn parse<__S: AsRef<str>>(_parser: &mut Parser<'_, __S>) -> Result<Self, Error>

Parses arguments until the given parser is exhausted or until an error is encountered.
source§

fn command(&self) -> Option<&dyn Options>

Returns the subcommand instance, if present. Read more
source§

fn command_name(&self) -> Option<&'static str>

Returns the name of a parsed command, if present. Read more
source§

fn help_requested(&self) -> bool

Returns whether the user supplied a “help” option to request usage information about the program or any contained subcommands. Read more
source§

fn parse_command<__S: AsRef<str>>( name: &str, _parser: &mut Parser<'_, __S> ) -> Result<Self, Error>

Parses options for the named command.
source§

fn usage() -> &'static str

Returns a string showing usage and help for each supported option. Read more
source§

fn self_usage(&self) -> &'static str

Returns a string showing usage and help for this options instance. Read more
source§

fn command_list() -> Option<&'static str>

Returns a string listing available commands and help text. Read more
source§

fn command_usage(_name: &str) -> Option<&'static str>

Returns a usage string for the named command. Read more
source§

fn self_command_list(&self) -> Option<&'static str>

Returns a listing of available commands and help text. Read more
source§

fn parse_args<S>(args: &[S], style: ParsingStyle) -> Result<Self, Error>
where S: AsRef<str>, Self: Sized,

Parses arguments received from the command line. Read more
source§

fn parse_args_or_exit(style: ParsingStyle) -> Self
where Self: Sized,

Parses arguments from the environment. Read more
source§

fn parse_args_default_or_exit() -> Self
where Self: Sized,

Parses arguments from the environment, using the default parsing style. Read more
source§

fn parse_args_default<S>(args: &[S]) -> Result<Self, Error>
where S: AsRef<str>, Self: Sized,

Parses arguments received from the command line, using the default parsing style. Read more
source§

impl Serialize for LightBlock

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,