@Test void testGetBalance() { Provider provider = mock(Provider.class); Address address = new Address("hx4873b94352c8c1f3b2f09aaeccea31ce9e90bd31"); IconService iconService = new IconService(provider); iconService.getBalance(address); HashMap<String, RpcValue> params = new HashMap<>(); params.put("address", new RpcValue(address)); verify(provider).request( argThat(request -> isRequestMatches(request, "icx_getBalance", params)), argThat(Objects::nonNull)); }
public Request<BigInteger> getBalance(Address address) { long requestId = System.currentTimeMillis(); RpcObject params = new RpcObject.Builder() .put("address", new RpcValue(address)) .build(); foundation.icon.icx.transport.jsonrpc.Request request = new foundation.icon.icx.transport.jsonrpc.Request( requestId, "icx_getBalance", params); return provider.request(request, findConverter(BigInteger.class)); }
IconService { public Request<BigInteger> getBalance(Address address) { long requestId = System.currentTimeMillis(); RpcObject params = new RpcObject.Builder() .put("address", new RpcValue(address)) .build(); foundation.icon.icx.transport.jsonrpc.Request request = new foundation.icon.icx.transport.jsonrpc.Request( requestId, "icx_getBalance", params); return provider.request(request, findConverter(BigInteger.class)); } }
IconService { public Request<BigInteger> getBalance(Address address) { long requestId = System.currentTimeMillis(); RpcObject params = new RpcObject.Builder() .put("address", new RpcValue(address)) .build(); foundation.icon.icx.transport.jsonrpc.Request request = new foundation.icon.icx.transport.jsonrpc.Request( requestId, "icx_getBalance", params); return provider.request(request, findConverter(BigInteger.class)); } @SuppressWarnings("unchecked")  IconService(Provider provider); }
IconService { public Request<BigInteger> getBalance(Address address) { long requestId = System.currentTimeMillis(); RpcObject params = new RpcObject.Builder() .put("address", new RpcValue(address)) .build(); foundation.icon.icx.transport.jsonrpc.Request request = new foundation.icon.icx.transport.jsonrpc.Request( requestId, "icx_getBalance", params); return provider.request(request, findConverter(BigInteger.class)); } @SuppressWarnings("unchecked")  IconService(Provider provider); Request<BigInteger> getTotalSupply(); Request<BigInteger> getBalance(Address address); Request<Block> getBlock(BigInteger height); Request<Block> getBlock(Bytes hash); Request<Block> getLastBlock(); @SuppressWarnings("unchecked") Request<List<ScoreApi>> getScoreApi(Address scoreAddress); Request<ConfirmedTransaction> getTransaction(Bytes hash); Request<TransactionResult> getTransactionResult(Bytes hash); Request<T> call(Call<T> call); Request<Bytes> sendTransaction(SignedTransaction signedTransaction); Request<BigInteger> estimateStep(Transaction transaction); void addConverterFactory(RpcConverterFactory factory); }
IconService { public Request<BigInteger> getBalance(Address address) { long requestId = System.currentTimeMillis(); RpcObject params = new RpcObject.Builder() .put("address", new RpcValue(address)) .build(); foundation.icon.icx.transport.jsonrpc.Request request = new foundation.icon.icx.transport.jsonrpc.Request( requestId, "icx_getBalance", params); return provider.request(request, findConverter(BigInteger.class)); } @SuppressWarnings("unchecked")  IconService(Provider provider); Request<BigInteger> getTotalSupply(); Request<BigInteger> getBalance(Address address); Request<Block> getBlock(BigInteger height); Request<Block> getBlock(Bytes hash); Request<Block> getLastBlock(); @SuppressWarnings("unchecked") Request<List<ScoreApi>> getScoreApi(Address scoreAddress); Request<ConfirmedTransaction> getTransaction(Bytes hash); Request<TransactionResult> getTransactionResult(Bytes hash); Request<T> call(Call<T> call); Request<Bytes> sendTransaction(SignedTransaction signedTransaction); Request<BigInteger> estimateStep(Transaction transaction); void addConverterFactory(RpcConverterFactory factory);  }