Skip to content

Commit

Permalink
extend IridiumClient constructor to allow passing a custom HttpClient…
Browse files Browse the repository at this point in the history
…, e.g for adding custom http headers
  • Loading branch information
danielclasen committed May 22, 2018
1 parent 4ff8021 commit 0865313
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/cash/ird/walletd/IridiumClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import cash.ird.walletd.model.request.BlockRange;
import cash.ird.walletd.model.request.Key;
import cash.ird.walletd.model.response.*;
import cash.ird.walletd.rpc.HttpClient;
import cash.ird.walletd.rpc.WalletdClient;
import cash.ird.walletd.rpc.exception.IridiumWalletdException;
import cash.ird.walletd.rpc.method.RequestMethod;
Expand Down Expand Up @@ -33,6 +34,10 @@ public IridiumClient(String url) {
this.walletdClient = new WalletdClient(url);
}

public IridiumClient(String url, HttpClient httpClient) {
this.walletdClient = new WalletdClient(url, httpClient);
}

@Override
public boolean reset() throws IridiumWalletdException {
return this.walletdClient.doRequest(RequestMethod.RESET, NoopResponse.class) != null;
Expand Down

0 comments on commit 0865313

Please sign in to comment.