Skip to content

Commit

Permalink
Merge pull request #392 from nervosnetwork/rc/v0.40.0
Browse files Browse the repository at this point in the history
Rc/v0.40.0
  • Loading branch information
duanyytop authored Mar 8, 2021
2 parents 75fa275 + 2f11ff3 commit adf5cfc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 164 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [v0.40.0](https://github.com/nervosnetwork/ckb-sdk-java/compare/v0.39.1...v0.40.0) (2021-03-08)

### Feature

* Remove indexer module rpc and disable get_cellbase_output_capacity_details rpc([0872f27](https://github.com/nervosnetwork/ckb-sdk-java/commit/0872f279692aac96006474903fe088f9fbeda2b7))

### BreakingChanges

* Remove indexer module rpc
* Add @Deprecated to get_cellbase_output_capacity_details rpc

# [v0.39.1](https://github.com/nervosnetwork/ckb-sdk-java/compare/v0.39.0...v0.39.1) (2021-01-30)

### Feature
Expand Down
13 changes: 6 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {

ext.bouncycastleVersion = '1.65'
ext.rxjavaVersion = '2.2.20'
ext.rxjavaVersion = '2.2.21'
ext.gsonVersion = '2.8.6'
ext.okhttpVersion = '4.9.0'
ext.loggingOkhttpVersion = '4.9.0'
ext.okhttpVersion = '4.9.1'
ext.loggingOkhttpVersion = '4.9.1'
ext.slf4jVersion = '1.7.30'
ext.guavaVersion = '30.1-jre'

ext.junitVersion = '5.7.0'
ext.junitVersion = '5.7.1'

repositories {
jcenter()
Expand Down Expand Up @@ -43,7 +43,7 @@ allprojects {
targetCompatibility = 1.8

group 'org.nervos.ckb'
version '0.39.1'
version '0.40.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.39.1'
version '0.40.0'
from components.java
}
}
Expand All @@ -122,7 +122,6 @@ configure(subprojects.findAll { it.name != 'tests' }) {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(
userName: ossrhUsername,
Expand Down
61 changes: 1 addition & 60 deletions ckb/src/main/java/org/nervos/ckb/service/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import java.util.Collections;
import java.util.List;
import org.nervos.ckb.type.*;
import org.nervos.ckb.type.cell.CellTransaction;
import org.nervos.ckb.type.cell.CellWithStatus;
import org.nervos.ckb.type.cell.LiveCell;
import org.nervos.ckb.type.param.OutputsValidator;
import org.nervos.ckb.type.transaction.Transaction;
import org.nervos.ckb.type.transaction.TransactionWithStatus;
Expand Down Expand Up @@ -52,6 +50,7 @@ public String getBlockHash(String blockNumber) throws IOException {
String.class);
}

@Deprecated
public CellbaseOutputCapacity getCellbaseOutputCapacityDetails(String blockHash)
throws IOException {
return rpcService.post(
Expand Down Expand Up @@ -248,64 +247,6 @@ public String calculateDaoMaximumWithdraw(OutPoint outPoint, String withdrawBloc
"calculate_dao_maximum_withdraw", Arrays.asList(outPoint, withdrawBlockHash), String.class);
}

/* Indexer RPC */

@Deprecated
public LockHashIndexState indexLockHash(String lockHash) throws IOException {
return rpcService.post(
"index_lock_hash", Collections.singletonList(lockHash), LockHashIndexState.class);
}

@Deprecated
public LockHashIndexState indexLockHash(String lockHash, String indexFrom) throws IOException {
return rpcService.post(
"index_lock_hash",
Arrays.asList(lockHash, Numeric.toHexString(indexFrom)),
LockHashIndexState.class);
}

@Deprecated
public List<String> deindexLockHash(String lockHash) throws IOException {
return rpcService.post(
"deindex_lock_hash",
Collections.singletonList(lockHash),
new TypeToken<List<String>>() {}.getType());
}

@Deprecated
public List<LockHashIndexState> getLockHashIndexStates() throws IOException {
return rpcService.post(
"get_lock_hash_index_states",
Collections.emptyList(),
new TypeToken<List<LockHashIndexState>>() {}.getRawType());
}

@Deprecated
public List<LiveCell> getLiveCellsByLockHash(
String lockHash, String page, String pageSize, boolean reverseOrder) throws IOException {
return rpcService.post(
"get_live_cells_by_lock_hash",
Arrays.asList(
lockHash, Numeric.toHexString(page), Numeric.toHexString(pageSize), reverseOrder),
new TypeToken<List<LiveCell>>() {}.getType());
}

@Deprecated
public List<CellTransaction> getTransactionsByLockHash(
String lockHash, String page, String pageSize, boolean reverseOrder) throws IOException {
return rpcService.post(
"get_transactions_by_lock_hash",
Arrays.asList(
lockHash, Numeric.toHexString(page), Numeric.toHexString(pageSize), reverseOrder),
new TypeToken<List<CellTransaction>>() {}.getType());
}

@Deprecated
public LockHashCapacity getCapacityByLockHash(String lockHash) throws IOException {
return rpcService.post(
"get_capacity_by_lock_hash", Collections.singletonList(lockHash), LockHashCapacity.class);
}

/**
* Batch RPC request
*
Expand Down
14 changes: 0 additions & 14 deletions ckb/src/main/java/org/nervos/ckb/type/cell/CellTransaction.java

This file was deleted.

19 changes: 0 additions & 19 deletions ckb/src/main/java/org/nervos/ckb/type/cell/LiveCell.java

This file was deleted.

64 changes: 0 additions & 64 deletions ckb/src/test/java/service/ApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
import org.nervos.ckb.service.Api;
import org.nervos.ckb.service.RpcResponse;
import org.nervos.ckb.type.*;
import org.nervos.ckb.type.cell.CellTransaction;
import org.nervos.ckb.type.cell.CellWithStatus;
import org.nervos.ckb.type.cell.LiveCell;
import org.nervos.ckb.type.param.OutputsValidator;
import org.nervos.ckb.type.transaction.Transaction;

Expand Down Expand Up @@ -377,68 +375,6 @@ public void testComputeTransactionHash() throws IOException {
Assertions.assertNotNull(transactionHash);
}

@Test
public void testIndexLockHash() throws IOException {
LockHashIndexState lockHashIndexState =
api.indexLockHash("0x59d90b1718471f5802de59501604100a5e3b463865cdfe56fa70ed23865ee32e");
Assertions.assertNotNull(lockHashIndexState);
}

@Test
public void testIndexLockHashWithBlockNumber() throws IOException {
LockHashIndexState lockHashIndexState =
api.indexLockHash(
"0x59d90b1718471f5802de59501604100a5e3b463865cdfe56fa70ed23865ee32e", "0");
Assertions.assertNotNull(lockHashIndexState);
}

@Test
public void testDeindexLockHash() throws IOException {
List<String> lockHashs =
api.deindexLockHash("0x59d90b1718471f5802de59501604100a5e3b463865cdfe56fa70ed23865ee32e");
Assertions.assertNull(lockHashs);
}

@Test
public void testGetLockHashIndexStates() throws IOException {
List<LockHashIndexState> lockHashIndexStates = api.getLockHashIndexStates();
Assertions.assertNotNull(lockHashIndexStates);
}

@Test
public void testGetLiveCellsByLockHash() throws IOException {
List<LiveCell> liveCells =
api.getLiveCellsByLockHash(
"0xecaeea8c8581d08a3b52980272001dbf203bc6fa2afcabe7cc90cc2afff488ba",
"0",
"100",
false);
Assertions.assertNotNull(liveCells);
}

@Test
public void testGetTransactionsByLockHash() throws IOException {
List<CellTransaction> cellTransactions =
api.getTransactionsByLockHash(
"0xecaeea8c8581d08a3b52980272001dbf203bc6fa2afcabe7cc90cc2afff488ba",
"0",
"100",
false);
Assertions.assertNotNull(cellTransactions);
}

@Test
public void testGetCapacityByLockHash() throws Exception {
// Call index_lock_hash rpc before calling get_capacity_by_lock_hash and wait some time
// api.indexLockHash("0x1f2615a8dde4e28ca736ff763c2078aff990043f4cbf09eb4b3a58a140a0862d");
LockHashCapacity lockHashCapacity =
api.getCapacityByLockHash(
"0x1f2615a8dde4e28ca736ff763c2078aff990043f4cbf09eb4b3a58a140a0862d");
Assertions.assertNotNull(lockHashCapacity);
Assertions.assertNotNull(lockHashCapacity.capacity);
Assertions.assertNotNull(lockHashCapacity.cellsCount);
}

@Test
public void testBatchRpc() throws IOException {
List<RpcResponse> rpcResponses =
Expand Down

0 comments on commit adf5cfc

Please sign in to comment.