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
}
}
Aggregations