Search in sources :

Example 1 with NonBesuBlockHeader

use of org.hyperledger.besu.ethereum.core.NonBesuBlockHeader in project besu by hyperledger.

the class BftQueryServiceImplTest method getSignersThrowsIfBlockIsNotOnTheChain.

@Test
public void getSignersThrowsIfBlockIsNotOnTheChain() {
    final NonBesuBlockHeader header = new NonBesuBlockHeader(Hash.EMPTY, Bytes.EMPTY);
    final BftQueryService service = new BftQueryServiceImpl(bftBlockInterface, blockchain, validatorProvider, null, null);
    assertThatExceptionOfType(NoSuchElementException.class).isThrownBy(() -> service.getSignersFrom(header));
}
Also used : NonBesuBlockHeader(org.hyperledger.besu.ethereum.core.NonBesuBlockHeader) BftQueryService(org.hyperledger.besu.plugin.services.query.BftQueryService) NoSuchElementException(java.util.NoSuchElementException) Test(org.junit.Test)

Example 2 with NonBesuBlockHeader

use of org.hyperledger.besu.ethereum.core.NonBesuBlockHeader in project besu by hyperledger.

the class BftQueryServiceImplTest method getRoundNumberThrowsIfBlockIsNotOnTheChain.

@Test
public void getRoundNumberThrowsIfBlockIsNotOnTheChain() {
    final NonBesuBlockHeader header = new NonBesuBlockHeader(Hash.EMPTY, Bytes.EMPTY);
    final BftQueryService service = new BftQueryServiceImpl(new BftBlockInterface(bftExtraDataCodec), blockchain, validatorProvider, null, null);
    assertThatExceptionOfType(NoSuchElementException.class).isThrownBy(() -> service.getRoundNumberFrom(header));
}
Also used : BftBlockInterface(org.hyperledger.besu.consensus.common.bft.BftBlockInterface) NonBesuBlockHeader(org.hyperledger.besu.ethereum.core.NonBesuBlockHeader) BftQueryService(org.hyperledger.besu.plugin.services.query.BftQueryService) NoSuchElementException(java.util.NoSuchElementException) Test(org.junit.Test)

Aggregations

NoSuchElementException (java.util.NoSuchElementException)2 NonBesuBlockHeader (org.hyperledger.besu.ethereum.core.NonBesuBlockHeader)2 BftQueryService (org.hyperledger.besu.plugin.services.query.BftQueryService)2 Test (org.junit.Test)2 BftBlockInterface (org.hyperledger.besu.consensus.common.bft.BftBlockInterface)1