Create an initial state that looks like it came from a checkpoint at a non-zero height.
(
checkpoint_hash: [u8; 32],
height: u64,
epoch: u64,
epoch_length: NonZeroU64,
)
| 130 | |
| 131 | /// Create an initial state that looks like it came from a checkpoint at a non-zero height. |
| 132 | fn create_checkpoint_initial_state( |
| 133 | checkpoint_hash: [u8; 32], |
| 134 | height: u64, |
| 135 | epoch: u64, |
| 136 | epoch_length: NonZeroU64, |
| 137 | ) -> ConsensusState { |
| 138 | let mut state = create_test_initial_state(checkpoint_hash, epoch_length); |
| 139 | state.set_latest_height(height); |
| 140 | state.set_view(height); |
| 141 | state.set_epoch(epoch); |
| 142 | state.set_forkchoice(ForkchoiceState { |
| 143 | head_block_hash: checkpoint_hash.into(), |
| 144 | safe_block_hash: checkpoint_hash.into(), |
| 145 | finalized_block_hash: checkpoint_hash.into(), |
| 146 | }); |
| 147 | state |
| 148 | } |
| 149 | |
| 150 | fn default_protocol_consts() -> ProtocolConsts { |
| 151 | ProtocolConsts { |
no test coverage detected