Search in sources :

Example 1 with MutableStore

use of tech.pegasys.teku.spec.datastructures.forkchoice.MutableStore in project teku by ConsenSys.

the class ForkChoiceUtilTest method onTick_shouldExitImmediatelyWhenCurrentTimeIsBeforeGenesisTime.

@Test
void onTick_shouldExitImmediatelyWhenCurrentTimeIsBeforeGenesisTime() {
    final MutableStore store = mock(MutableStore.class);
    when(store.getGenesisTime()).thenReturn(UInt64.valueOf(3000));
    when(store.getTime()).thenReturn(UInt64.ZERO);
    forkChoiceUtil.onTick(store, UInt64.valueOf(2000));
    verify(store, never()).setTime(any());
}
Also used : MutableStore(tech.pegasys.teku.spec.datastructures.forkchoice.MutableStore) Test(org.junit.jupiter.api.Test)

Example 2 with MutableStore

use of tech.pegasys.teku.spec.datastructures.forkchoice.MutableStore in project teku by ConsenSys.

the class ForkChoiceUtilTest method onTick_shouldExitImmediatelyWhenCurrentTimeIsBeforeStoreTime.

@Test
void onTick_shouldExitImmediatelyWhenCurrentTimeIsBeforeStoreTime() {
    final MutableStore store = mock(MutableStore.class);
    when(store.getGenesisTime()).thenReturn(UInt64.valueOf(3000));
    when(store.getTime()).thenReturn(UInt64.valueOf(5000));
    forkChoiceUtil.onTick(store, UInt64.valueOf(4000));
    verify(store, never()).setTime(any());
}
Also used : MutableStore(tech.pegasys.teku.spec.datastructures.forkchoice.MutableStore) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 MutableStore (tech.pegasys.teku.spec.datastructures.forkchoice.MutableStore)2