use of org.aion.rpc.types.RPCTypes.BlockSpecifierUnion in project aion by aionnetwork.
the class OpsRPCImplTest method testBlockDetailsEncode.
@Test
public void testBlockDetailsEncode() {
BlockDetailsConverter.encode(opsRPC.ops_getBlockDetails(new BlockSpecifierUnion(1L)));
BlockDetailsConverter.encode(opsRPC.ops_getBlockDetails(new BlockSpecifierUnion(2L)));
BlockDetailsConverter.encode(opsRPC.ops_getBlockDetails(new BlockSpecifierUnion(ByteArray.wrap(emptyPowBlock.getHash()))));
System.out.println(BlockDetailsConverter.encode(opsRPC.ops_getBlockDetails(new BlockSpecifierUnion(ByteArray.wrap(emptyPosBlock.getHash())))));
BlockDetailsConverter.encode(opsRPC.ops_getBlockDetails(new BlockSpecifierUnion(BlockEnum.LATEST)));
}
use of org.aion.rpc.types.RPCTypes.BlockSpecifierUnion in project aion by aionnetwork.
the class OpsRPCImplTest method testOps_getBlockDetails.
@Test
public void testOps_getBlockDetails() {
assertNotNull(execute(new Request(idGenerator.generateID(), "ops_getBlockDetails", BlockSpecifierParamsConverter.encode(new BlockSpecifierParams(new BlockSpecifierUnion(1L))), VersionType.Version2), BlockDetailsConverter::decode));
assertNotNull(execute(new Request(idGenerator.generateID(), "ops_getBlockDetails", BlockSpecifierParamsConverter.encode(BlockSpecifierParamsConverter.decode("[latest]")), VersionType.Version2), BlockDetailsConverter::decode));
assertNotNull(execute(new Request(idGenerator.generateID(), "ops_getBlockDetails", BlockSpecifierParamsConverter.encode(BlockSpecifierParamsConverter.decode("{\"block\": \"" + ByteArray.wrap(emptyPowBlock.getHash()) + "\"}")), VersionType.Version2), BlockDetailsConverter::decode));
}
Aggregations