@Test public void equals_shouldBNotBeEqualWhenBlocksDiffer() { final SignedBlockAndState block = dataStructureUtil.randomSignedBlockAndState(UInt64.ONE); final SignedBlockAndState otherBlock = dataStructureUtil.randomSignedBlockAndState(UInt64.ONE); assertThat(block).isNotEqualTo(otherBlock); final UInt64 forkChoiceSlot = UInt64.valueOf(1L); final ChainHead chainHead = ChainHead.create(block, forkChoiceSlot); final ChainHead otherChainHead = ChainHead.create(otherBlock, forkChoiceSlot); assertThat(chainHead).isNotEqualTo(otherChainHead); }
public static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot) { return new ChainHead(blockAndState.getBlock(), blockAndState.getState(), forkChoiceSlot); }
ChainHead extends SignedBlockAndState { public static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot) { return new ChainHead(blockAndState.getBlock(), blockAndState.getState(), forkChoiceSlot); } }
ChainHead extends SignedBlockAndState { public static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot) { return new ChainHead(blockAndState.getBlock(), blockAndState.getState(), forkChoiceSlot); } ChainHead(SignedBeaconBlock block, BeaconState state, UInt64 forkChoiceSlot); }
ChainHead extends SignedBlockAndState { public static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot) { return new ChainHead(blockAndState.getBlock(), blockAndState.getState(), forkChoiceSlot); } ChainHead(SignedBeaconBlock block, BeaconState state, UInt64 forkChoiceSlot); static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot); UInt64 getForkChoiceSlot(); UInt64 findCommonAncestor(final ChainHead other); @Override boolean equals(final Object o); @Override int hashCode(); }
ChainHead extends SignedBlockAndState { public static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot) { return new ChainHead(blockAndState.getBlock(), blockAndState.getState(), forkChoiceSlot); } ChainHead(SignedBeaconBlock block, BeaconState state, UInt64 forkChoiceSlot); static ChainHead create(SignedBlockAndState blockAndState, UInt64 forkChoiceSlot); UInt64 getForkChoiceSlot(); UInt64 findCommonAncestor(final ChainHead other); @Override boolean equals(final Object o); @Override int hashCode();  }