use of org.aion.rpc.types.RPCTypes.AddressParams in project aion by aionnetwork.
the class MiningRPCImplTest method testGetMinerStatsMock.
@Test
public void testGetMinerStatsMock() {
MinerStats minerStats = execute(buildRequest("getMinerStatistics", AddressParamsConverter.encode(new AddressParams(AddressConverter.decode("0xa0c5bf6c4779bf8c2e0a3ff71353d09b066db2b5876ee2345efb836510b3126b")))), MinerStatsConverter::decode);
assertNotNull(minerStats);
assertEquals("1", minerStats.minerHashrate);
assertEquals("1", minerStats.minerHashrateShare);
assertEquals("1", minerStats.networkHashRate);
}
use of org.aion.rpc.types.RPCTypes.AddressParams in project aion by aionnetwork.
the class OpsRPCImplTest method testOps_getAccountState.
@Test
public void testOps_getAccountState() {
AionAddress aionAddress = new AionAddress(ByteUtil.hexStringToBytes("a07913c03686c9659c1b614d098fd1db380a52b71fd58526b53d8107f7b355d5"));
Request request = new Request(idGenerator.generateID(), getAccountStateMethod, AddressParamsConverter.encode(new AddressParams(aionAddress)), VersionType.Version2);
final RPCTypes.AccountState result = execute(request, AccountStateConverter::decode);
assertNotNull(result);
assertEquals(aionAddress, result.address);
assertEquals(BigInteger.TEN, result.balance);
assertEquals(BigInteger.TEN, result.nonce);
}
Aggregations