Skip to content

Commit 5b3e45d

Browse files
authored
Merge pull request #77 from bianjieai/sv/update
fix broadcastTx sync Exception
2 parents c884f27 + d635df7 commit 5b3e45d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.bianjieai</groupId>
88
<artifactId>opb-sdk</artifactId>
9-
<version>0.1.12-rc1</version>
9+
<version>0.1.12-rc2</version>
1010
<url>https://github.com/bianjieai/opb-sdk-java</url>
1111
<name>opb-sdk</name>
1212
<licenses>

src/main/java/irita/sdk/client/RpcClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ private ResultTx checkCommitResultTx(String res) throws IOException {
133133

134134
private ResultTx checkSyncResultTx(String str) throws IOException {
135135
ResultTx resultTx = JsonUtils.readValue(str, ResultTx.class);
136+
if (resultTx.getError() != null) {
137+
throw new IritaSDKException(resultTx.getError().getData());
138+
}
136139

137-
if (resultTx.getResult().getCode() != TxStatus.SUCCESS) {
140+
if (resultTx.getResult() != null && resultTx.getResult().getCode() != TxStatus.SUCCESS) {
138141
throw new IritaSDKException(String.format("log: %s\nhash: %s", resultTx.getResult().getLog(), Optional.of(resultTx).map(ResultTx::getResult).map(Result::getHash).orElse("")));
139142
}
140143
return resultTx;

0 commit comments

Comments
 (0)