Skip to content
Permalink
Browse files

Fix a few comments and docs

  • Loading branch information...
Samm Desmond
Samm Desmond committed Mar 26, 2019
1 parent 838c7f6 commit f5e2e6d7e337034ebb7562b518e492e3901f0754
@@ -71,7 +71,7 @@ Or use `Nodesmith <https://nodesmith.io/>`_, which provides **free API endpoints

.. code-block:: java
Web3j web3 = Web3j.build(new HttpService("https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc?apiKey=YOUR_KEY"));
Web3j web3 = Web3j.build(new NodesmithHttpService("https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc?apiKey=YOUR_KEY"));
For further information refer to :doc:`nodesmith`.

@@ -27,7 +27,7 @@ See `Rate Limiting <https://beta.docs.nodesmith.io/#/ethereum/rateLimiting>`_ fo

If you want to test a number of the JSON RPC calls against Nodesmith, update the integration test
`CoreIT <https://github.com/web3j/web3j/blob/master/integration-tests/src/test/java/org/web3j/protocol/core/CoreIT.java>`_
with your Infura URL & run it.
with your Nodesmith URL & run it.

Sending Transactions
--------------------
@@ -44,6 +44,14 @@ public Instant getWindowResetTime() {
return this.resetTime;
}
/**
* Tries to create a new instance of the RateLimitInfo class from the headers passed in.
* If successful, it returns the instance wrapped in Optional, otherwise Optional.empty().
* @param limitValue The x-ratelimit-limit header value.
* @param remainingValue The x-ratelimit-remaining header value.
* @param resetTimeValue The x-ratelimit-reset header value.
* @return If successful, RateLimitInfo wrapped in Optional, otherwise Optional.empty().
*/
public static Optional<RateLimitInfo> createFromHeaders(
String limitValue, String remainingValue, String resetTimeValue) {
@@ -54,7 +62,6 @@ public Instant getWindowResetTime() {
Instant resetTime = Instant.ofEpochSecond(resetEpochSeconds);
return Optional.of(new RateLimitInfo(limit, remaining, resetTime));
} catch (NumberFormatException ex) {
// TODO - log
return Optional.empty();
}
}

0 comments on commit f5e2e6d

Please sign in to comment.
You can’t perform that action at this time.