Skip to content

Commit c54237a

Browse files
author
UDLD
authored
Merge pull request #152 from cryptape/release/v1.0.0
Release/v1.0.0
2 parents 7fe7cf4 + 523bcba commit c54237a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1146
-728
lines changed

.travis.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,30 @@ language: java
55
jdk:
66
- oraclejdk8
77

8-
sudo: false # as per http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/
8+
env:
9+
- TEST_TYPE=UT
10+
- CITA_DOCKER_IMAGE_TAG_NAME=sha3 TEST_TYPE=ST TEST_CITA_VERSION=CITA1.0
11+
- CITA_DOCKER_IMAGE_TAG_NAME=sha3_88b90bb TEST_TYPE=ST TEST_CITA_VERSION=CITA0.25
12+
- CITA_DOCKER_IMAGE_TAG_NAME=sha3_1f10bc8 TEST_TYPE=ST TEST_CITA_VERSION=CITA0.24
13+
- CITA_DOCKER_IMAGE_TAG_NAME=sha3_b1e3048 TEST_TYPE=ST TEST_CITA_VERSION=CITA0.23.1
14+
15+
sudo: true # as per http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/
916

1017
# Avoid uploading cache after every build with Gradle - see https://docs.travis-ci.com/user/languages/java/#Caching
1118
before_cache:
1219
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1320
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
21+
1422
cache:
1523
directories:
16-
- $HOME/.gradle/caches/
17-
- $HOME/.gradle/wrapper/
24+
- $HOME/.gradle/caches/
25+
- $HOME/.gradle/wrapper/
26+
27+
before_script:
28+
# upgrade gradle to 5.0
29+
- wget http://services.gradle.org/distributions/gradle-5.0-all.zip > debug.log
30+
- unzip gradle-5.0-all.zip > debug.log
31+
- ./gradle-5.0/bin/gradle -v
1832

19-
# Add --info to view details of test failures
20-
script: ./gradlew --info check jacocoRootTestReport
33+
script: bash ./scripts/run.sh
2134

22-
# Upload code coverage metrics
23-
after_success:
24-
- bash <(curl -s https://codecov.io/bash)

CHANGELOG.md

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

3+
# [v1.0.0](https://github.com/cryptape/cita-sdk-java/compare/v0.25.0...v1.0.0) (2019-08-28)
4+
5+
### Added
6+
7+
* add group manager RPC requests
8+
* add matrix system test in travis
9+
10+
### Fixed
11+
* fix test net url
12+
* fix inPermission method not support function having parameters
13+
* fix unit test in test module
14+
15+
### Documented
16+
* add introduction document
17+
18+
319
# [v0.25.0](https://github.com/cryptape/cita-sdk-java/compare/v0.24.1...v0.25.0) (2019-08-27)
420

521
### Feature

README.md

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ maven
2929
<dependency>
3030
<groupId>com.cryptape.cita</groupId>
3131
<artifactId>core</artifactId>
32-
<version>0.25.0</version>
32+
<version>1.0.0</version>
3333
</dependency>
3434
```
3535
Gradle
3636
```
37-
compile 'com.cryptape.cita:core:0.25.0'
37+
compile 'com.cryptape.cita:core:1.0.0'
3838
```
3939

4040
Install manually
@@ -52,7 +52,7 @@ gradle shadowJar
5252
### CITA Test net
5353

5454
Use CITA test net (recommended):
55-
https://node.cryptape.com is provided as a test net.
55+
https://testnet.citahub.com is provided as a test net.
5656

5757
Or build your own CITA net:
5858
Please find more information in [CITA](https://github.com/cryptape/cita).
@@ -147,6 +147,44 @@ public Object callContract(String contractAddress, AbiDefinition functionAbi, St
147147
While contract file is required when first deploy the contract, cita-sdk-java can get the abi file according to address when call methods in deployed contract.
148148
Please find complete code in [TokenAccountExample](https://github.com/cryptape/cita-sdk-java/blob/master/tests/src/main/java/com/cryptape/cita/tests/TokenAccountExample.java).
149149

150+
## Contributing
151+
152+
### Creating a Bug Report
153+
open a new issue: https://github.com/cryptape/cita-sdk-java/issues/new
154+
155+
with your version info
156+
157+
### Tech Stack
158+
159+
#### Back end
160+
Java
161+
- Version: 8
162+
- Building: gradle-v5.0
163+
164+
### Coding style
165+
coding style guide: Google Shell Style guide:
166+
- https://google.github.io/styleguide/javaguide.html
167+
168+
#### Installing the coding style settings in Intellij
169+
1. Download the intellij-java-google-style.xml file from the http://code.google.com/p/google-styleguide/ repo.
170+
2. go into Preferences -> Editor -> Code Style. Click on Manage and import the downloaded Style Setting file. Select GoogleStyle as new coding style.
171+
172+
#### Installing the coding style settings in Eclipse
173+
1. Download the eclipse-java-google-style.xml file from the http://code.google.com/p/google-styleguide/ repo.
174+
2. Under Window/Preferences select Java/Code Style/Formatter. Import the settings file by selecting Import.
175+
176+
### Commit your changes
177+
178+
#### Workflow
179+
[GitHub Flow](https://help.github.com/en/articles/github-flow), [Understanding the GitHub flow](https://guides.github.com/introduction/flow/)
180+
181+
#### git style guide
182+
use [git-style-guide](https://github.com/agis/git-style-guide) for Branches, Commits,Messages, Merging
183+
184+
## Versioning
185+
vx.y.z
186+
- x.y Follow the version number of CITA
187+
- z Defined by SDK itself:changed by fixing or adding features
150188

151189
## 简介
152190
cita-sdk-java 是对以太坊 Web3j 进行改写,适配 CITA 的一个 Java 开发包。cita-sdk-java 集成了与 CITA 客户端交互的功能,可以用来对 CITA 发送交易,系统配置,信息查询。
@@ -170,12 +208,12 @@ Gradle 5.0
170208
<dependency>
171209
<groupId>com.cryptape.cita</groupId>
172210
<artifactId>core</artifactId>
173-
<version>0.25.0</version>
211+
<version>1.0.0</version>
174212
</dependency>
175213
```
176214
Gradle
177215
```
178-
compile 'com.cryptape.cita:core:0.25.0'
216+
compile 'com.cryptape.cita:core:1.0.0'
179217
```
180218

181219
手动安装
@@ -192,12 +230,13 @@ gradle shadowJar
192230

193231
### CITA 测试网络
194232
使用 CITA 测试网络(推荐):
195-
https://node.cryptape.com
233+
https://testnet.citahub.com
196234

197235
或者可以部署你自己的 CITA:
198236
如果需要了解怎么部署 CITA 网络,请查阅[CITA](https://github.com/cryptape/cita)
199237

200238
### 快速教程
239+
201240
#### 部署智能合约
202241
与以太坊类似,智能合约是通过发送交易来部署的。CITA 交易对象定义在 [Transaction.java](https://github.com/cryptape/cita-sdk-java/blob/master/core/src/main/java/com/cryptape/cita/protocol/core/methods/request/Transaction.java)
203242
在 CITA 交易中,有三个特殊的参数:
@@ -284,3 +323,42 @@ public Object callContract(String contractAddress, AbiDefinition functionAbi, St
284323
```
285324
虽然在第一次部署合约的时候需要提供合约文件,但是在以后调用合约函数的时候 cita-sdk-java 通过 CITA 提供的 getAbi 接口根据合约地址得到对应的 abi。
286325
请在 [TokenAccountExample](https://github.com/cryptape/cita-sdk-java/blob/master/tests/src/main/java/com/cryptape/cita/tests/TokenAccountExample.java) 中查看完整代码。
326+
327+
## 参与贡献
328+
329+
### 报告Bug
330+
提交 issue: https://github.com/cryptape/cita-sdk-java/issues/new
331+
记得声明所使用软件的版本信息
332+
333+
### 技术栈
334+
335+
#### Back end
336+
Java
337+
- Version: 8
338+
- Building: gradle-v5.0
339+
340+
### 编码规范
341+
使用《Google java编程规范》作为我们的编码规范:
342+
- 英文版: https://google.github.io/styleguide/javaguide.html
343+
- 中文版: https://jervyshi.gitbooks.io/google-java-styleguide-zh/content/
344+
345+
#### Installing the coding style settings in Intellij
346+
1. Download the intellij-java-google-style.xml file from the http://code.google.com/p/google-styleguide/ repo.
347+
2. go into Preferences -> Editor -> Code Style. Click on Manage and import the downloaded Style Setting file. Select GoogleStyle as new coding style.
348+
349+
#### Installing the coding style settings in Eclipse
350+
1. Download the eclipse-java-google-style.xml file from the http://code.google.com/p/google-styleguide/ repo.
351+
2. Under Window/Preferences select Java/Code Style/Formatter. Import the settings file by selecting Import.
352+
353+
### 代码提交规范
354+
355+
#### 代码提交流程
356+
[GitHub Flow](https://help.github.com/en/articles/github-flow), [Understanding the GitHub flow](https://guides.github.com/introduction/flow/)
357+
358+
#### git style guide
359+
我们要求遵守 [git-style-guide](https://github.com/agis/git-style-guide) 中的规则来进行分支创建、提交以及合并操作。
360+
361+
## 版本规则
362+
vx.y.z
363+
- x.y 跟随 CITA 的版本号;
364+
- z 由 SDK 自己定义:修复或增加feature 则变化

abi/src/main/java/com/cryptape/cita/abi/FunctionEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static String buildMethodSignature(String methodName, List<Type> parameters) {
8888
return result.toString();
8989
}
9090

91-
static String buildMethodId(String methodSignature) {
91+
public static String buildMethodId(String methodSignature) {
9292
byte[] input = methodSignature.getBytes();
9393
byte[] hash = Hash.sha3(input);
9494
return Numeric.toHexString(hash).substring(0, 10);

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ allprojects {
4949
targetCompatibility = 1.8
5050

5151
group 'com.cryptape.cita'
52-
version '0.25.0'
52+
version '1.0.0'
5353

5454
apply plugin: 'java'
5555
apply plugin: 'jacoco'
@@ -145,7 +145,7 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
145145
publications {
146146
mavenJava(MavenPublication) {
147147
groupId 'com.cryptape.cita'
148-
version '0.25.0'
148+
version '1.0.0'
149149
from components.java
150150

151151
artifact sourcesJar {

core/src/main/java/com/cryptape/cita/protocol/system/CITASystemContract.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public interface CITASystemContract {
8989
String Authorization_MANAGER_CHECK_RESOURCE = "checkResource";
9090

9191
//User manager
92+
String INTRA_GROUP_USER_MANAGEMENT_ADDR = "0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009";
9293
String USER_MANAGER_ADDR = "0xffffffffffffffffffffffffffffffffff02000a";
9394
//User manager manipulation
9495
String USER_MANAGER_NEW_GROUP = "newGroup";
@@ -228,4 +229,4 @@ static AppCall sendCall(String from, String addr,
228229
}
229230

230231
long getQuotaPrice(String from) throws IOException;
231-
}
232+
}

0 commit comments

Comments
 (0)