Search in sources :

Example 1 with BlockTemplateNotFoundRPCException

use of org.aion.rpc.errors.RPCExceptions.BlockTemplateNotFoundRPCException in project aion by aionnetwork.

the class StakingRPCImplTest method testSubmitSignature.

@Test
public void testSubmitSignature() {
    assertTrue(execute(new Request(1, "submitsignature", SubmitSignatureParamsConverter.encode(new SubmitSignatureParams(validSignature, validSealHash)), VersionType.Version2), BoolConverter::decode));
    assertFalse(execute(new Request(1, "submitsignature", SubmitSignatureParamsConverter.encode(new SubmitSignatureParams(invalidSignature, invalidSealHash)), VersionType.Version2), BoolConverter::decode));
    try {
        execute(new Request(1, "submitsignature", SubmitSignatureParamsConverter.encode(new SubmitSignatureParams(invalidSignature, missingSealHash)), null), BoolConverter::decode);
        fail();
    } catch (BlockTemplateNotFoundRPCException e) {
    // We expect this exception
    }
}
Also used : SubmitSignatureParams(org.aion.rpc.types.RPCTypes.SubmitSignatureParams) Request(org.aion.rpc.types.RPCTypes.Request) BoolConverter(org.aion.rpc.types.RPCTypesConverter.BoolConverter) BlockTemplateNotFoundRPCException(org.aion.rpc.errors.RPCExceptions.BlockTemplateNotFoundRPCException) Test(org.junit.Test)

Aggregations

BlockTemplateNotFoundRPCException (org.aion.rpc.errors.RPCExceptions.BlockTemplateNotFoundRPCException)1 Request (org.aion.rpc.types.RPCTypes.Request)1 SubmitSignatureParams (org.aion.rpc.types.RPCTypes.SubmitSignatureParams)1 BoolConverter (org.aion.rpc.types.RPCTypesConverter.BoolConverter)1 Test (org.junit.Test)1