Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #460 from nervosnetwork/rc/0.4.4
Browse files Browse the repository at this point in the history
chore: release mercury v0.4.4 version
  • Loading branch information
EthanYuan authored Oct 8, 2022
2 parents 0331ef9 + 9fdbbe4 commit 93082ff
Show file tree
Hide file tree
Showing 28 changed files with 208 additions and 42 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [v0.4.4](https://github.com/nervosnetwork/mercury/compare/v0.4.3...v0.4.4) (2022-10-08)

## 🚀 Features

- feat(rpc): add `extra` para in rpc `get_balance` (#450)

# [v0.4.3](https://github.com/nervosnetwork/mercury/compare/v0.4.2...v0.4.3) (2022-09-19)

## 🐛 Bug Fixes
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mercury"
description = "Mercury is a tool that handles application development on CKB."
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "common"
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion core/ckb-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-ckb-client"
version = "0.4.3"
version = "0.4.4"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion core/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-cli"
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
9 changes: 7 additions & 2 deletions core/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ The error code ranges are as follows:
- `item`: [`JsonItem`](#type-jsonitem)
- `asset_infos`: `Array<`[`AssetInfo`](#type-assetinfo)`>`
- `tip_block_number`: [`BlockNumber`](#type-blocknumber)`|null`
- `extra`: `"Dao"|"Cellbase"|null`
- result
- `tip_block_number`: [`BlockNumber`](#type-blocknumber)
- `balances`: `Array<`[`Balance`](#type-balance)`>`
Expand All @@ -135,6 +136,10 @@ To return the balance of specified assets for the given item.
- If `tip_block_number` is not null, the query is based on the historical blockchain with the specified tip.
- `asset_infos` - Specify a set of asset types for the query.
- If `asset_infos` is empty, the query returns the balance of any asset matching the query parameters.
- `extra` - Specify the filter applying to the querying.
- If `extra` is null, the query does not apply extra filter.
- If `extra` is `Dao`, the query will filter and keep the balance of cells that satisfy `type script` as `Dao`.
- If `extra` is `Cellbase`, the query will filter and keep the balance of cells satisfying `Cellbase`.

**Returns**

Expand Down Expand Up @@ -1793,7 +1798,7 @@ echo '{
{
"jsonrpc": "2.0",
"result": {
"mercury_version": "0.4.3",
"mercury_version": "0.4.4",
"ckb_node_version": "0.104.0 (4dd90d4 2022-07-19)",
"network_type": "Testnet",
"enabled_extensions": [ ]
Expand Down Expand Up @@ -1837,7 +1842,7 @@ echo '{
{
"jsonrpc": "2.0",
"result": {
"version": "0.4.3",
"version": "0.4.4",
"db": "PostgreSQL",
"conn_size": 100,
"center_id": 0,
Expand Down
2 changes: 1 addition & 1 deletion core/rpc/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-rpc"
version = "0.4.3"
version = "0.4.4"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion core/rpc/core/src/impl/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<C: CkbRpc> MercuryRpcImpl<C> {
payload.tip_block_number.map(Into::into),
tip_epoch_number.clone(),
None,
None,
payload.extra,
&mut PaginationRequest::default(),
)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion core/rpc/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-rpc-types"
version = "0.4.3"
version = "0.4.4"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
1 change: 1 addition & 0 deletions core/rpc/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ pub struct BurnInfo {
pub struct GetBalancePayload {
pub item: JsonItem,
pub asset_infos: HashSet<AssetInfo>,
pub extra: Option<ExtraType>,
pub tip_block_number: Option<BlockNumber>,
}

Expand Down
2 changes: 1 addition & 1 deletion core/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-service"
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion core/storage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-storage"
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
10 changes: 0 additions & 10 deletions core/storage/src/relational/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ pub const BLAKE_160_HSAH_LEN: usize = 20;
pub const IO_TYPE_INPUT: u8 = 0;
pub const IO_TYPE_OUTPUT: u8 = 1;

#[macro_export]
macro_rules! save_batch_slice {
($tx: expr$ (, $table: expr)*) => {{
$(if $tx.save_batch_slice(&$table, BATCH_SIZE_THRESHOLD, &[]).await.is_err() {
$tx.rollback().await?;
return Ok(());
})*
}};
}

impl RelationalStorage {
pub(crate) async fn insert_block_table(
&self,
Expand Down
2 changes: 1 addition & 1 deletion core/synchronization/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "core-synchronization"
version = "0.4.3"
version = "0.4.4"
authors = ["Nervos Network"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
mercury:
container_name: mercury
restart: always
image: nervos/mercury:v0.4.3
image: nervos/mercury:v0.4.4
ports:
- 8116:8116
volumes:
Expand Down
4 changes: 4 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Migration instruction

## 0.4.4 Release

No migration matters.

## 0.4.3 Release

No migration matters.
Expand Down
6 changes: 3 additions & 3 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Clone the repository and checkout the tag of the version you intend to use. Usin
```sh
git clone https://github.com/nervosnetwork/mercury.git
cd mercury
git checkout v0.4.3
git checkout v0.4.4
```

### Step 3: Build Mercury
Expand Down Expand Up @@ -55,13 +55,13 @@ We will not be building from source, but there are still some valuable files. Cl
```sh
git clone https://github.com/nervosnetwork/mercury.git
cd mercury
git checkout v0.4.3
git checkout v0.4.4
```

### Step 3: Download and Extract a Precompiled Binary

```sh
wget https://github.com/nervosnetwork/mercury/releases/download/v0.4.3/mercury-x86_64-unknown-linux-gnu.tar.gz
wget https://github.com/nervosnetwork/mercury/releases/download/v0.4.4/mercury-x86_64-unknown-linux-gnu.tar.gz
tar xzf mercury-x86_64-unknown-linux-gnu.tar.gz
```

Expand Down
6 changes: 3 additions & 3 deletions integration/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions integration/src/tests/build_adjust_account_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fn test_adjust_account() {
let payload = GetBalancePayload {
item: JsonItem::Address(acp_address.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let response = mercury_client.get_balance(payload.clone()).unwrap();
Expand Down Expand Up @@ -79,6 +80,7 @@ fn test_adjust_account_pw_lock() {
let payload = GetBalancePayload {
item: JsonItem::Address(pw_lock_address.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let response = mercury_client.get_balance(payload.clone()).unwrap();
Expand Down Expand Up @@ -144,6 +146,7 @@ fn test_adjust_account_from_multi() {
let payload = GetBalancePayload {
item: JsonItem::Address(acp_address.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let response = mercury_client.get_balance(payload.clone()).unwrap();
Expand Down
4 changes: 4 additions & 0 deletions integration/src/tests/build_dao_related_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn test_dao_by_address() {
let balance_payload = GetBalancePayload {
item: JsonItem::Address(address.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let balance = mercury_client.get_balance(balance_payload.clone()).unwrap();
Expand Down Expand Up @@ -193,6 +194,7 @@ fn test_dao_pool_money() {
let balance_payload = GetBalancePayload {
item: JsonItem::Address(address.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let balance = mercury_client.get_balance(balance_payload).unwrap();
Expand Down Expand Up @@ -257,6 +259,7 @@ fn test_dao_by_out_point() {
let balance_payload_1 = GetBalancePayload {
item: JsonItem::Address(address_1.to_string()),
asset_infos: asset_infos.clone(),
extra: None,
tip_block_number: None,
};
let balance = mercury_client
Expand All @@ -270,6 +273,7 @@ fn test_dao_by_out_point() {
let balance_payload_2 = GetBalancePayload {
item: JsonItem::Address(address_2.to_string()),
asset_infos,
extra: None,
tip_block_number: None,
};
let balance = mercury_client
Expand Down
Loading

0 comments on commit 93082ff

Please sign in to comment.