Search in sources :

Example 1 with BlockSpecifierParams

use of org.aion.rpc.types.RPCTypes.BlockSpecifierParams 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));
}
Also used : BlockSpecifierUnion(org.aion.rpc.types.RPCTypes.BlockSpecifierUnion) BlockSpecifierParams(org.aion.rpc.types.RPCTypes.BlockSpecifierParams) Request(org.aion.rpc.types.RPCTypes.Request) Test(org.junit.Test)

Aggregations

BlockSpecifierParams (org.aion.rpc.types.RPCTypes.BlockSpecifierParams)1 BlockSpecifierUnion (org.aion.rpc.types.RPCTypes.BlockSpecifierUnion)1 Request (org.aion.rpc.types.RPCTypes.Request)1 Test (org.junit.Test)1