pub struct Block {
    pub height: u64,
    pub time: u64,
    /* private fields */
}

Fields

height: u64time: u64

Implementations

Will increase the block height by height and block time by height * time for each increment.

This is the default strategy.

Will increase the block height by a number within the range of height and block time by that same height * time for each increment.

Will stop incrementing blocks on each message execution and calling next and increment will have no effect.

Will resume incrementing blocks on each message execution.

Increments the block height and time by the amount configured - once.

Examples
use fadroma::ensemble::Block;
 
let mut block = Block::default();
block.exact_increments(1, 5);
 
let old_height = block.height;
let old_time = block.time;
 
block.next();
 
assert_eq!(block.height - old_height, 1);
assert_eq!(block.time - old_time, 5);
 

Increments the block height and time by the amount configured, multiplied by the times parameter.

Examples
use fadroma::ensemble::Block;

let mut block = Block::default();
block.exact_increments(1, 5);

let old_height = block.height;
let old_time = block.time;

block.increment(3);

assert_eq!(block.height - old_height, 3);
assert_eq!(block.time - old_time, 15);

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.