Skip to content

Commit d33ee6e

Browse files
authored
Merge pull request #106 from cryptape/rc/v0.22.2
Rc/v0.22.2
2 parents 34db086 + afd3668 commit d33ee6e

File tree

15 files changed

+1013
-410
lines changed

15 files changed

+1013
-410
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
All notable changes to this project will be documented in this file.
22

3+
# [v0.22.2](https://github.com/cryptape/cita-sdk-java/compare/v0.22.1...v0.22.2) (2019-04-09)
4+
5+
### Feature
6+
7+
* refactor http json response handle method
8+
39
# [v0.22.1](https://github.com/cryptape/cita-sdk-java/compare/v0.22...v0.22.1) (2019-03-29)
410

511
### Feature

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
cita-sdk-java, originally adapted from Ethereum web3j, is a Java library for working with Smart Contract and integrating with clients on CITA.
1010

11+
For detailed documentation, see [documentation](docs/index.md).
12+
1113
## Features
1214

1315
- Complete implementation of CITA JSON-RPC API over HTTP.
@@ -27,12 +29,12 @@ maven
2729
<dependency>
2830
<groupId>com.cryptape.cita</groupId>
2931
<artifactId>core</artifactId>
30-
<version>0.22.1</version>
32+
<version>0.22.2</version>
3133
</dependency>
3234
```
3335
Gradle
3436
```
35-
compile 'com.cryptape.cita:core:0.22.1'
37+
compile 'com.cryptape.cita:core:0.22.2'
3638
```
3739

3840
Install manually
@@ -144,9 +146,12 @@ Please find complete code in [TokenAccountExample](https://github.com/cryptape/c
144146

145147
## 简介
146148
cita-sdk-java 是对以太坊 Web3j 进行改写,适配 CITA 的一个 Java 开发包。cita-sdk-java 集成了与 CITA 客户端交互的功能,可以用来对 CITA 发送交易,系统配置,信息查询。
149+
150+
开发请参考[详细文档](docs/index.md)
151+
147152
## 特性
148153
- 通过 HTTP 协议,实现了 CITA 所定义的所有 JSON-RPC 方法。
149-
- 可以通过 Solidity 智能合约生成该合约的 Java 类。这个智能合约的 Java 类作为 java 对只能合约的包裹层,可以使开发和通过 java 方便地对智能合约进行部署和合约方法的调用(支持Solidity 和 Truffle 的格式)。
154+
- 可以通过 Solidity 智能合约生成该合约的 Java 类。这个智能合约的 Java 类作为 java 对智能合约的包裹层,可以使开发和通过 java 方便地对智能合约进行部署和合约方法的调用(支持Solidity 和 Truffle 的格式)。
150155
- 适配安卓
151156

152157
## 开始
@@ -161,12 +166,12 @@ Gradle 4.3
161166
<dependency>
162167
<groupId>com.cryptape.cita</groupId>
163168
<artifactId>core</artifactId>
164-
<version>0.22.1</version>
169+
<version>0.22.2</version>
165170
</dependency>
166171
```
167172
Gradle
168173
```
169-
compile 'com.cryptape.cita:core:0.22.1'
174+
compile 'com.cryptape.cita:core:0.22.2'
170175
```
171176

172177
手动安装

core/src/main/java/com/cryptape/cita/protocol/account/Account.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public AppSendTransaction deploy(
5959
version, chainId, value);
6060
}
6161

62-
public Future<AppSendTransaction> deployAsync(
62+
public Flowable<AppSendTransaction> deployAsync(
6363
File contractFile, String nonce, long quota,
6464
int version, BigInteger chainId, String value)
6565
throws IOException, InterruptedException, CompiledContract.ContractCompileError {
@@ -70,7 +70,6 @@ public Future<AppSendTransaction> deployAsync(
7070
version, chainId, value);
7171
}
7272

73-
// eth_call: nonce and quota is null
7473
// sendTransaction: nonce and quota is necessary
7574
public Object callContract(
7675
String contractAddress, String funcName,
@@ -101,7 +100,7 @@ public Object callContract(
101100

102101
Function func;
103102
if (functionAbi.isConstant()) {
104-
// eth_call
103+
// call
105104
List<TypedAbi.ArgRetType> retsType = new ArrayList<>();
106105
List<TypeReference<?>> retsTypeRef = new ArrayList<>();
107106
List<AbiDefinition.NamedType> outputs = functionAbi.getOutputs();
@@ -111,7 +110,7 @@ public Object callContract(
111110
retsTypeRef.add(retType.getTypeReference());
112111
}
113112
func = new Function(functionAbi.getName(), params, retsTypeRef);
114-
return ethCall(contractAddress, func, retsType);
113+
return appCall(contractAddress, func, retsType);
115114
} else {
116115
// send_transaction
117116
func = new Function(functionAbi.getName(), params, Collections.emptyList());
@@ -120,7 +119,7 @@ public Object callContract(
120119
}
121120
}
122121

123-
public Object ethCall(String contractAddress, Function func, List<TypedAbi.ArgRetType> retsType)
122+
public Object appCall(String contractAddress, Function func, List<TypedAbi.ArgRetType> retsType)
124123
throws IOException {
125124
String data = FunctionEncoder.encode(func);
126125
AppCall call = this.service.appCall(new Call(this.transactionManager.getFromAddress(),

0 commit comments

Comments
 (0)