Skip to content

Commit

Permalink
Merge pull request #28 from iotexproject/provider-chainid
Browse files Browse the repository at this point in the history
set provider support chainid
  • Loading branch information
ququzone authored Jul 28, 2022
2 parents df5bd2b + 6777555 commit 2fd194e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ network for IoT powered by scalability- and privacy-centric blockchains. Please
<dependency>
<groupId>com.github.iotexproject</groupId>
<artifactId>iotex-antenna-java</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</dependency>
```

### Install by Gradle

```
implementation 'com.github.iotexproject:iotex-antenna-java:0.6.1'
implementation 'com.github.iotexproject:iotex-antenna-java:0.6.2'
```


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.iotexproject</groupId>
<artifactId>iotex-antenna-java</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
<packaging>jar</packaging>
<name>IoTeX Antenna Java</name>
<description>IoTex java sdk for develop android and java apps.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public RPCMethod currentProvider() {
return this.provider;
}

public void setProvider(String provider) {
setProvider(provider, false);
public void setProvider(String provider, Integer chainID) {
setProvider(provider, false, chainID);
}

public void setProvider(String provider, boolean secure) {
public void setProvider(String provider, boolean secure, Integer chainID) {
if (this.provider != null) {
this.provider.setProvider(provider, secure);
this.provider.setProvider(provider, secure, chainID);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public RPCMethod(String hostname, Boolean secure, Integer chainID) {
this.chainID = chainID;
}

public void setProvider(String hostname) {
setProvider(hostname, false);
public void setProvider(String hostname, Integer chainID) {
setProvider(hostname, false, chainID);
}

public void setProvider(String hostname, boolean secure) {
public void setProvider(String hostname, boolean secure, Integer chainID) {
if (channel != null) {
channel.shutdown();
}
Expand All @@ -45,6 +45,7 @@ public void setProvider(String hostname, boolean secure) {
channel = ManagedChannelBuilder.forTarget(hostname).usePlaintext().build();
}
stub = APIServiceGrpc.newBlockingStub(channel);
this.chainID = chainID;
}

public void close() {
Expand Down

0 comments on commit 2fd194e

Please sign in to comment.