Skip to content

Commit

Permalink
feat: CKB 0.42.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjianhui committed Jun 26, 2021
1 parent 1fc25a9 commit 28b9138
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ hs_err_pid*
/out
*/build/
*/out/
*/build**/

gradle.properties
local.properties
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [v0.41.0](https://github.com/nervosnetwork/ckb-sdk-java/compare/v0.41.0...v0.41.1) (2021-06-12)
# [v0.42.0](https://github.com/nervosnetwork/ckb-sdk-java/compare/v0.41.1...v0.42.0) (2021-06-25)

### BreakingChanges
* Remove `get_peers_state` rpc
* Remove `get_cellbase_output_capacity_details` rpc

# [v0.41.1](https://github.com/nervosnetwork/ckb-sdk-java/compare/v0.41.0...v0.41.1) (2021-06-12)

### Bugfix
* Fix JDK version 15 to 8
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ allprojects {
targetCompatibility = 1.8

group 'org.nervos.ckb'
version '0.41.1'
version '0.42.0'
apply plugin: 'java'

repositories {
Expand Down Expand Up @@ -112,7 +112,7 @@ configure(subprojects.findAll { it.name != 'tests' }) {
publications {
mavenJava(MavenPublication) {
groupId 'org.nervos.ckb'
version '0.41.1'
version '0.42.0'
from components.java
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package model.resp;

import com.google.gson.annotations.SerializedName;

public class GetBalanceResponse {

@SerializedName("owned")
public String unconstrained;

@SerializedName("claimable")
public String fleeting;

@SerializedName("locked")
public String locked;
}
15 changes: 0 additions & 15 deletions ckb/src/main/java/org/nervos/ckb/service/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ public String getBlockHash(String blockNumber) throws IOException {
String.class);
}

@Deprecated
public CellbaseOutputCapacity getCellbaseOutputCapacityDetails(String blockHash)
throws IOException {
return rpcService.post(
"get_cellbase_output_capacity_details",
Collections.singletonList(blockHash),
CellbaseOutputCapacity.class);
}

public BlockEconomicState getBlockEconomicState(String blockHash) throws IOException {
return rpcService.post(
"get_block_economic_state", Collections.singletonList(blockHash), BlockEconomicState.class);
Expand Down Expand Up @@ -128,12 +119,6 @@ public BlockchainInfo getBlockchainInfo() throws IOException {
return rpcService.post("get_blockchain_info", Collections.emptyList(), BlockchainInfo.class);
}

@Deprecated
public List<PeerState> getPeersState() throws IOException {
return rpcService.post(
"get_peers_state", Collections.emptyList(), new TypeToken<List<PeerState>>() {}.getType());
}

/** Pool RPC */
public TxPoolInfo txPoolInfo() throws IOException {
return rpcService.post("tx_pool_info", Collections.emptyList(), TxPoolInfo.class);
Expand Down
13 changes: 0 additions & 13 deletions ckb/src/test/java/service/ApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ public void testGetBlockHashByNumber() throws IOException {
Assertions.assertNotNull(blockHash);
}

@Test
public void testGetCellbaseOutputCapacityDetails() throws IOException {
String blockHash = api.getBlockHash("0x1");
CellbaseOutputCapacity cellbaseOutputCapacity = api.getCellbaseOutputCapacityDetails(blockHash);
Assertions.assertNotNull(cellbaseOutputCapacity);
}

@Test
public void testGetBlockEconomicState() throws IOException {
String blockHash = api.getBlockHash("0x2");
Expand Down Expand Up @@ -250,12 +243,6 @@ public void testGetBlockchainInfo() throws IOException {
Assertions.assertNotNull(blockchainInfo);
}

@Test
public void testGetPeersState() throws IOException {
List<PeerState> peerStates = api.getPeersState();
Assertions.assertNotNull(peerStates);
}

@Test
public void testGetLiveCell() throws IOException {
CellWithStatus cellWithStatus =
Expand Down

0 comments on commit 28b9138

Please sign in to comment.