Search in sources :

Example 1 with UnsupportedUnityFeatureRPCException

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

the class StakingRPCImplTest method testCallUnityFeatureBeforeFork.

@Test
public void testCallUnityFeatureBeforeFork() {
    chainHolder = spy(new AionChainHolder(AionImpl.instForTest(), accountManager));
    doReturn(false).when(chainHolder).isUnityForkEnabled();
    doCallRealMethod().when(chainHolder).getSeed();
    rpcMethods = new RPCMethods(chainHolder);
    try {
        // This call will throw because a unity feature is requested before
        // The unity fork
        execute(new Request(1, "getseed", VoidParamsConverter.encode(new VoidParams()), VersionType.Version2), RPCTypesConverter.ByteArrayConverter::decode);
        fail();
    } catch (UnsupportedUnityFeatureRPCException e) {
    // pass
    }
}
Also used : UnsupportedUnityFeatureRPCException(org.aion.rpc.errors.RPCExceptions.UnsupportedUnityFeatureRPCException) Request(org.aion.rpc.types.RPCTypes.Request) VoidParams(org.aion.rpc.types.RPCTypes.VoidParams) Test(org.junit.Test)

Aggregations

UnsupportedUnityFeatureRPCException (org.aion.rpc.errors.RPCExceptions.UnsupportedUnityFeatureRPCException)1 Request (org.aion.rpc.types.RPCTypes.Request)1 VoidParams (org.aion.rpc.types.RPCTypes.VoidParams)1 Test (org.junit.Test)1