Skip to content
Snippets Groups Projects
Commit 781131b0 authored by Éloïs's avatar Éloïs
Browse files

[ref] rename crate duniter_dbs_read_ops -> duniter-bc-reader

parent e8a7e0ca
No related branches found
No related tags found
No related merge requests found
Showing with 28 additions and 34 deletions
......@@ -1062,6 +1062,17 @@ dependencies = [
"serde",
]
[[package]]
name = "duniter-bc-reader"
version = "0.1.0"
dependencies = [
"anyhow",
"dubp",
"duniter-dbs",
"resiter",
"smallvec",
]
[[package]]
name = "duniter-conf"
version = "0.1.0"
......@@ -1118,17 +1129,6 @@ dependencies = [
"zerocopy",
]
[[package]]
name = "duniter-dbs-read-ops"
version = "0.1.0"
dependencies = [
"anyhow",
"dubp",
"duniter-dbs",
"resiter",
"smallvec",
]
[[package]]
name = "duniter-dbs-write-ops"
version = "0.1.0"
......@@ -1156,7 +1156,6 @@ dependencies = [
"dubp",
"duniter-conf",
"duniter-dbs",
"duniter-dbs-read-ops",
"duniter-gva-dbs-reader",
"duniter-gva-gql",
"duniter-gva-indexer",
......@@ -1199,9 +1198,9 @@ dependencies = [
"async-graphql",
"async-trait",
"dubp",
"duniter-bc-reader",
"duniter-conf",
"duniter-dbs",
"duniter-dbs-read-ops",
"duniter-gva-dbs-reader",
"duniter-mempools",
"duniter-module",
......@@ -1236,9 +1235,9 @@ version = "0.1.0"
dependencies = [
"anyhow",
"dubp",
"duniter-bc-reader",
"duniter-conf",
"duniter-dbs",
"duniter-dbs-read-ops",
"duniter-dbs-write-ops",
"duniter-mempools",
"duniter-module",
......@@ -1273,8 +1272,8 @@ name = "duniter-mempools"
version = "0.1.0"
dependencies = [
"dubp",
"duniter-bc-reader",
"duniter-dbs",
"duniter-dbs-read-ops",
"duniter-dbs-write-ops",
"log",
"thiserror",
......@@ -1302,9 +1301,9 @@ dependencies = [
"anyhow",
"cfg-if 1.0.0",
"dubp",
"duniter-bc-reader",
"duniter-conf",
"duniter-dbs",
"duniter-dbs-read-ops",
"duniter-dbs-write-ops",
"duniter-gva",
"duniter-mempools",
......
......@@ -36,7 +36,7 @@ members = [
"rust-libs/dubp-wot",
"rust-libs/duniter-conf",
"rust-libs/duniter-dbs",
"rust-libs/duniter-dbs-read-ops",
"rust-libs/duniter-bc-reader",
"rust-libs/duniter-dbs-write-ops",
"rust-libs/duniter-mempools",
"rust-libs/duniter-module",
......
[package]
name = "duniter-dbs-read-ops"
name = "duniter-bc-reader"
version = "0.1.0"
authors = ["elois <elois@duniter.org>"]
description = "Duniter DBs read operations"
......
......@@ -14,7 +14,7 @@ path = "src/lib.rs"
[dependencies]
dubp = { version = "0.34.0" }
duniter-dbs = { path = "../duniter-dbs" }
duniter-dbs-read-ops = { path = "../duniter-dbs-read-ops" }
duniter-bc-reader = { path = "../duniter-bc-reader" }
duniter-dbs-write-ops = { path = "../duniter-dbs-write-ops" }
log = "0.4.11"
thiserror = "1.0.20"
......
......@@ -71,7 +71,7 @@ impl TxsMempool {
tx: TransactionDocumentV10,
txs_mp_db_ro: &TxsMpDb,
) -> Result<(), TxMpError> {
if duniter_dbs_read_ops::tx_exist(bc_db_ro, tx.get_hash())? {
if duniter_bc_reader::tx_exist(bc_db_ro, tx.get_hash())? {
Err(TxMpError::TxAlreadyWritten)
} else if tx.issuers().contains(&server_pubkey)
|| txs_mp_db_ro.txs().count()? < self.max_size
......@@ -89,7 +89,7 @@ impl TxsMempool {
txs_mp_db: &TxsMpV2Db<B>,
tx: &TransactionDocumentV10,
) -> Result<(), TxMpError> {
if duniter_dbs_read_ops::tx_exist(bc_db_ro, tx.get_hash())? {
if duniter_bc_reader::tx_exist(bc_db_ro, tx.get_hash())? {
Err(TxMpError::TxAlreadyWritten)
} else if tx.issuers().contains(&server_pubkey) {
duniter_dbs_write_ops::txs_mp::add_pending_tx(
......
......@@ -11,7 +11,7 @@ cfg-if = "1.0.0"
dubp = { version = "0.34.0" }
duniter-conf = { path = "../duniter-conf" }
duniter-dbs = { path = "../duniter-dbs" }
duniter-dbs-read-ops = { path = "../duniter-dbs-read-ops" }
duniter-bc-reader = { path = "../duniter-bc-reader" }
duniter-dbs-write-ops = { path = "../duniter-dbs-write-ops" }
duniter-gva = { path = "../modules/gva", optional = true }
duniter-mempools = { path = "../duniter-mempools" }
......
......@@ -108,7 +108,7 @@ impl DuniterServer {
shared_dbs.dunp_db.heads_old_write().clear()?; // Clear WS2Pv1 HEADs
duniter_dbs_write_ops::cm::init(&bc_db, &shared_dbs.cm_db)?;
log::info!("Databases successfully opened.");
let current = duniter_dbs_read_ops::get_current_block_meta(&shared_dbs.cm_db)
let current = duniter_bc_reader::get_current_block_meta(&shared_dbs.cm_db)
.context("Fail to get current")?;
if let Some(current) = current {
log::info!("Current block: #{}-{}", current.number, current.hash);
......
......@@ -14,7 +14,6 @@ async-trait = "0.1.41"
dubp = { version = "0.34.0" }
duniter-conf = { path = "../../duniter-conf" }
duniter-dbs = { path = "../../duniter-dbs" }
duniter-dbs-read-ops = { path = "../../duniter-dbs-read-ops" }
duniter-gva-dbs-reader = { path = "./dbs-reader" }
duniter-gva-indexer = { path = "./indexer" }
duniter-gva-gql = { path = "./gql" }
......
......@@ -13,7 +13,7 @@ async-trait = "0.1.41"
dubp = { version = "0.34.0" }
duniter-conf = { path = "../../../duniter-conf" }
duniter-dbs = { path = "../../../duniter-dbs" }
duniter-dbs-read-ops = { path = "../../../duniter-dbs-read-ops" }
duniter-bc-reader = { path = "../../../duniter-bc-reader" }
duniter-gva-dbs-reader = { path = "../dbs-reader" }
duniter-mempools = { path = "../../../duniter-mempools" }
duniter-module = { path = "../../../duniter-module" }
......
......@@ -118,8 +118,7 @@ impl GenTxsQuery {
let (current_block, (inputs, inputs_sum)) = data
.dbs_pool
.execute(move |dbs| {
if let Some(current_block) =
duniter_dbs_read_ops::get_current_block_meta(&dbs.cm_db)?
if let Some(current_block) = duniter_bc_reader::get_current_block_meta(&dbs.cm_db)?
{
Ok((
current_block,
......@@ -193,8 +192,7 @@ impl GenTxsQuery {
let (current_block, issuers_inputs_with_sum) = data
.dbs_pool
.execute(move |dbs| {
if let Some(current_block) =
duniter_dbs_read_ops::get_current_block_meta(&dbs.cm_db)?
if let Some(current_block) = duniter_bc_reader::get_current_block_meta(&dbs.cm_db)?
{
let mut issuers_inputs_with_sum = Vec::new();
for issuer in issuers {
......
......@@ -66,8 +66,7 @@ impl UdsQuery {
) = data
.dbs_pool
.execute(move |dbs| {
if let Some(current_block) =
duniter_dbs_read_ops::get_current_block_meta(&dbs.cm_db)?
if let Some(current_block) = duniter_bc_reader::get_current_block_meta(&dbs.cm_db)?
{
let paged_data = match filter {
UdsFilter::All => {
......
......@@ -49,8 +49,7 @@ impl UtxosQuery {
) = data
.dbs_pool
.execute(move |dbs| {
if let Some(current_block) =
duniter_dbs_read_ops::get_current_block_meta(&dbs.cm_db)?
if let Some(current_block) = duniter_bc_reader::get_current_block_meta(&dbs.cm_db)?
{
let paged_data = db_reader.find_script_utxos(
&dbs.txs_mp_db,
......
......@@ -10,7 +10,7 @@ anyhow = "1.0.34"
dubp = { version = "0.34.0" }
duniter-conf = { path = "../../duniter-conf" }
duniter-dbs = { path = "../../duniter-dbs" }
duniter-dbs-read-ops = { path = "../../duniter-dbs-read-ops" }
duniter-bc-reader = { path = "../../duniter-bc-reader" }
duniter-dbs-write-ops = { path = "../../duniter-dbs-write-ops" }
duniter-mempools = { path = "../../duniter-mempools" }
duniter-module = { path = "../../duniter-module" }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment