epoch

Function epoch 

Source
pub fn epoch(epoch_length: u64, height: u64) -> Epoch
Expand description

Returns the epoch the given height belongs to.

Epochs are organized as follows:

0: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1: [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
2: [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
...

Epoch length is defined in number of blocks. Panics if epoch_length is zero.