Commit 4b988cb5 authored by inso's avatar inso Committed by Éloïs

Rename duniter-wotb to durs-wot

parent 79bf8071
Pipeline #3412 passed with stages
in 27 minutes and 5 seconds
......@@ -196,7 +196,7 @@ dependencies = [
"duniter-message 0.1.0-a0.1",
"duniter-module 0.1.0-a0.1",
"duniter-network 0.1.0-a0.1",
"duniter-wotb 0.8.0-a0.7",
"durs-wot 0.8.0-a0.8",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pbr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -265,7 +265,7 @@ dependencies = [
"duniter-documents 0.8.0-a0.1",
"duniter-module 0.1.0-a0.1",
"duniter-network 0.1.0-a0.1",
"duniter-wotb 0.8.0-a0.7",
"durs-wot 0.8.0-a0.8",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -357,17 +357,6 @@ dependencies = [
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "duniter-wotb"
version = "0.8.0-a0.7"
dependencies = [
"bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "durs"
version = "0.1.0-a0.1"
......@@ -379,6 +368,17 @@ dependencies = [
"structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "durs-wot"
version = "0.8.0-a0.8"
dependencies = [
"bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "durs-ws2p"
version = "0.1.0-a0.1"
......@@ -425,7 +425,7 @@ dependencies = [
"duniter-message 0.1.0-a0.1",
"duniter-module 0.1.0-a0.1",
"duniter-network 0.1.0-a0.1",
"duniter-wotb 0.8.0-a0.7",
"durs-wot 0.8.0-a0.8",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
......
......@@ -32,7 +32,7 @@ members = [
"module",
"network",
"tui",
"wotb",
"wot",
"ws2p",
"ws2p-messages",
"ws2p-v1-legacy"
......
......@@ -17,7 +17,7 @@ duniter-documents = { path = "../documents" }
duniter-message = { path = "../message" }
duniter-module = { path = "../module" }
duniter-network = { path = "../network" }
duniter-wotb = { path = "../wotb" }
durs-wot = { path = "../wot" }
log = "0.4.*"
num_cpus = "1.8.*"
pbr = "1.0.*"
......
......@@ -22,8 +22,8 @@ use duniter_documents::blockchain::v10::documents::transaction::{TxAmount, TxBas
use duniter_documents::blockchain::v10::documents::BlockDocument;
use duniter_documents::blockchain::Document;
use duniter_documents::BlockId;
use duniter_wotb::data::{NewLinkResult, RemLinkResult};
use duniter_wotb::{NodeId, WebOfTrust};
use durs_wot::data::{NewLinkResult, RemLinkResult};
use durs_wot::{NodeId, WebOfTrust};
use std::collections::{HashMap, HashSet};
#[derive(Debug)]
......@@ -63,7 +63,7 @@ pub fn apply_valid_block<W: WebOfTrust>(
let pubkey = joiner.clone().issuers()[0];
if let Some(idty_doc) = identities.get(&pubkey) {
// Newcomer
let wotb_id = NodeId(
let wot_id = NodeId(
wot_db
.read(|db| db.size())
.expect("Fatal error : fail to read WotDB !"),
......@@ -73,9 +73,9 @@ pub fn apply_valid_block<W: WebOfTrust>(
db.add_node();
})
.expect("Fail to write in WotDB");
wot_index.insert(pubkey, wotb_id);
wot_index.insert(pubkey, wot_id);
wot_dbs_requests.push(WotsDBsWriteQuery::CreateIdentity(
wotb_id,
wot_id,
current_blockstamp,
block.median_time,
Box::new(idty_doc.clone()),
......@@ -83,15 +83,15 @@ pub fn apply_valid_block<W: WebOfTrust>(
));
} else {
// Renewer
let wotb_id = wot_index[&joiner.issuers()[0]];
let wot_id = wot_index[&joiner.issuers()[0]];
wot_db
.write(|db| {
db.set_enabled(wotb_id, true);
db.set_enabled(wot_id, true);
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::RenewalIdentity(
joiner.issuers()[0],
wotb_id,
wot_id,
block.median_time,
joiner.blockstamp().id,
));
......@@ -100,15 +100,15 @@ pub fn apply_valid_block<W: WebOfTrust>(
for active in block.actives.clone() {
let pubkey = active.issuers()[0];
if !identities.contains_key(&pubkey) {
let wotb_id = wot_index[&pubkey];
let wot_id = wot_index[&pubkey];
wot_db
.write(|db| {
db.set_enabled(wotb_id, true);
db.set_enabled(wot_id, true);
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::RenewalIdentity(
pubkey,
wotb_id,
wot_id,
block.median_time,
active.blockstamp().id,
));
......@@ -151,24 +151,24 @@ pub fn apply_valid_block<W: WebOfTrust>(
for certification in block.certifications.clone() {
trace!("stack_up_valid_block: apply cert...");
let compact_cert = certification.to_compact_document();
let wotb_node_from = wot_index[&compact_cert.issuer];
let wotb_node_to = wot_index[&compact_cert.target];
let wot_node_from = wot_index[&compact_cert.issuer];
let wot_node_to = wot_index[&compact_cert.target];
wot_db
.write(|db| {
let result = db.add_link(wotb_node_from, wotb_node_to);
let result = db.add_link(wot_node_from, wot_node_to);
match result {
NewLinkResult::Ok(_) => {}
_ => panic!(
"Fail to add_link {}->{} : {:?}",
wotb_node_from.0, wotb_node_to.0, result
wot_node_from.0, wot_node_to.0, result
),
}
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::CreateCert(
compact_cert.issuer,
wotb_node_from,
wotb_node_to,
wot_node_from,
wot_node_to,
compact_cert.block_number,
block.median_time,
));
......@@ -198,8 +198,8 @@ pub fn apply_valid_block<W: WebOfTrust>(
.read(|db| db.get_enabled())
.expect("Fail to read WotDB");
let mut members_pubkeys = Vec::new();
for (pubkey, wotb_id) in wot_index {
if members_wot_ids.contains(wotb_id) {
for (pubkey, wot_id) in wot_index {
if members_wot_ids.contains(wot_id) {
members_pubkeys.push(*pubkey);
}
}
......
......@@ -58,7 +58,7 @@ pub fn check_and_apply_block<W: WebOfTrust>(
certs_db: &BinDB<CertsExpirV10Datas>,
block: &Block,
current_blockstamp: &Blockstamp,
wotb_index: &mut HashMap<PubKey, NodeId>,
wot_index: &mut HashMap<PubKey, NodeId>,
wot_db: &BinDB<W>,
forks_states: &[ForkStatus],
) -> Result<ValidBlockApplyReqs, BlockError> {
......@@ -101,7 +101,7 @@ pub fn check_and_apply_block<W: WebOfTrust>(
};
return Ok(apply_valid_block(
&block_doc,
wotb_index,
wot_index,
wot_db,
&expire_certs,
old_fork_id,
......
......@@ -17,8 +17,8 @@ use duniter_crypto::keys::*;
use duniter_dal::identity::DALIdentity;
use duniter_documents::blockchain::v10::documents::transaction::*;
use duniter_module::DuniterConf;
use duniter_wotb::data::rusty::RustyWebOfTrust;
use duniter_wotb::operations::distance::{DistanceCalculator, WotDistance, WotDistanceParameters};
use durs_wot::data::rusty::RustyWebOfTrust;
use durs_wot::operations::distance::{DistanceCalculator, WotDistance, WotDistanceParameters};
use std::time::*;
use *;
......@@ -140,7 +140,7 @@ pub fn dbex_wot<DC: DuniterConf>(profile: &str, conf: &DC, csv: bool, query: &DB
.expect("Fail to parse currency params !");
// get wot_index
let wot_index = DALIdentity::get_wotb_index(&wot_databases.identities_db).expect("DALError");
let wot_index = DALIdentity::get_wot_index(&wot_databases.identities_db).expect("DALError");
// get wot_reverse_index
let wot_reverse_index: HashMap<NodeId, &PubKey> =
......
......@@ -40,7 +40,7 @@ extern crate duniter_documents;
extern crate duniter_message;
extern crate duniter_module;
extern crate duniter_network;
extern crate duniter_wotb;
extern crate durs_wot;
extern crate serde;
extern crate serde_json;
extern crate sqlite;
......@@ -78,9 +78,9 @@ use duniter_module::*;
use duniter_network::{
NetworkBlock, NetworkDocument, NetworkEvent, NetworkResponse, NodeFullId, OldNetworkRequest,
};
use duniter_wotb::data::rusty::RustyWebOfTrust;
use duniter_wotb::operations::distance::RustyDistanceCalculator;
use duniter_wotb::{NodeId, WebOfTrust};
use durs_wot::data::rusty::RustyWebOfTrust;
use durs_wot::operations::distance::RustyDistanceCalculator;
use durs_wot::{NodeId, WebOfTrust};
/// The blocks are requested by packet groups. This constant sets the block packet size.
pub static CHUNK_SIZE: &'static u32 = &50;
......@@ -304,7 +304,7 @@ impl BlockchainModule {
&mut self,
network_documents: &[NetworkDocument],
current_blockstamp: &Blockstamp,
wotb_index: &mut HashMap<PubKey, NodeId>,
wot_index: &mut HashMap<PubKey, NodeId>,
wot_db: &BinDB<W>,
) -> Blockstamp {
let mut blockchain_documents = Vec::new();
......@@ -320,7 +320,7 @@ impl BlockchainModule {
&self.wot_databases.certs_db,
&Block::NetworkBlock(network_block),
&current_blockstamp,
wotb_index,
wot_index,
wot_db,
&self.forks_states,
) {
......@@ -439,7 +439,7 @@ impl BlockchainModule {
&mut self,
blocks_in_box: &[Box<NetworkBlock>],
current_blockstamp: &Blockstamp,
wotb_index: &mut HashMap<PubKey, NodeId>,
wot_index: &mut HashMap<PubKey, NodeId>,
wot: &BinDB<W>,
) -> Blockstamp {
debug!("BlockchainModule : receive_blocks()");
......@@ -455,7 +455,7 @@ impl BlockchainModule {
&self.wot_databases.certs_db,
&Block::NetworkBlock(block),
&current_blockstamp,
wotb_index,
wot_index,
wot,
&self.forks_states,
) {
......@@ -508,10 +508,10 @@ impl BlockchainModule {
// Get dbs path
let dbs_path = duniter_conf::get_blockchain_db_path(self.profile.as_str(), &self.currency);
// Get wotb index
let mut wotb_index: HashMap<PubKey, NodeId> =
DALIdentity::get_wotb_index(&self.wot_databases.identities_db)
.expect("Fatal eror : get_wotb_index : Fail to read blockchain databases");
// Get wot index
let mut wot_index: HashMap<PubKey, NodeId> =
DALIdentity::get_wot_index(&self.wot_databases.identities_db)
.expect("Fatal eror : get_wot_index : Fail to read blockchain databases");
// Open wot file
let wot_db = open_wot_db::<RustyWebOfTrust>(Some(&dbs_path)).expect("Fail to open WotDB !");
......@@ -629,7 +629,7 @@ impl BlockchainModule {
let new_current_blockstamp = self.receive_network_documents(
network_docs,
&current_blockstamp,
&mut wotb_index,
&mut wot_index,
&wot_db,
);
current_blockstamp = new_current_blockstamp;
......@@ -665,7 +665,7 @@ impl BlockchainModule {
);
revert_block::revert_block(
&last_dal_block,
&mut wotb_index,
&mut wot_index,
&wot_db,
Some(free_fork_id),
&self
......@@ -686,7 +686,7 @@ impl BlockchainModule {
let new_current_blockstamp = self.receive_blocks(
blocks,
&current_blockstamp,
&mut wotb_index,
&mut wot_index,
&wot_db,
);
if current_blockstamp != new_current_blockstamp {
......@@ -748,7 +748,7 @@ impl BlockchainModule {
&self.wot_databases.certs_db,
&Block::LocalBlock(&stackable_block.block),
&current_blockstamp,
&mut wotb_index,
&mut wot_index,
&wot_db,
&self.forks_states,
) {
......
......@@ -22,8 +22,8 @@ use duniter_dal::{BinDB, ForkId, TxV10Datas};
use duniter_documents::blockchain::v10::documents::block::TxDocOrTxHash;
use duniter_documents::blockchain::v10::documents::transaction::{TxAmount, TxBase};
use duniter_documents::blockchain::Document;
use duniter_wotb::data::{NewLinkResult, RemLinkResult};
use duniter_wotb::{NodeId, WebOfTrust};
use durs_wot::data::{NewLinkResult, RemLinkResult};
use durs_wot::{NodeId, WebOfTrust};
use std::collections::HashMap;
#[derive(Debug)]
......@@ -85,8 +85,8 @@ pub fn revert_block<W: WebOfTrust>(
.read(|db| db.get_enabled())
.expect("Fail to read WotDB");
let mut members_pubkeys = Vec::new();
for (pubkey, wotb_id) in wot_index.iter() {
if members_wot_ids.contains(wotb_id) {
for (pubkey, wot_id) in wot_index.iter() {
if members_wot_ids.contains(wot_id) {
members_pubkeys.push(*pubkey);
}
}
......@@ -122,24 +122,24 @@ pub fn revert_block<W: WebOfTrust>(
for certification in block.certifications.clone() {
trace!("stack_up_valid_block: apply cert...");
let compact_cert = certification.to_compact_document();
let wotb_node_from = wot_index[&compact_cert.issuer];
let wotb_node_to = wot_index[&compact_cert.target];
let wot_node_from = wot_index[&compact_cert.issuer];
let wot_node_to = wot_index[&compact_cert.target];
wot_db
.write(|db| {
let result = db.rem_link(wotb_node_from, wotb_node_to);
let result = db.rem_link(wot_node_from, wot_node_to);
match result {
RemLinkResult::Removed(_) => {}
_ => panic!(
"Fail to rem_link {}->{} : {:?}",
wotb_node_from.0, wotb_node_to.0, result
wot_node_from.0, wot_node_to.0, result
),
}
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::RevertCert(
compact_cert,
wotb_node_from,
wotb_node_to,
wot_node_from,
wot_node_to,
));
trace!("stack_up_valid_block: apply cert...success.");
}
......@@ -188,15 +188,15 @@ pub fn revert_block<W: WebOfTrust>(
for active in block.actives.clone() {
let pubkey = active.issuers()[0];
if !identities.contains_key(&pubkey) {
let wotb_id = wot_index[&pubkey];
let wot_id = wot_index[&pubkey];
wot_db
.write(|db| {
db.set_enabled(wotb_id, true);
db.set_enabled(wot_id, true);
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::RevertRenewalIdentity(
pubkey,
wotb_id,
wot_id,
block.median_time,
active.blockstamp().id,
));
......@@ -216,15 +216,15 @@ pub fn revert_block<W: WebOfTrust>(
wot_dbs_requests.push(WotsDBsWriteQuery::RevertCreateIdentity(pubkey));
} else {
// Renewer
let wotb_id = wot_index[&joiner.issuers()[0]];
let wot_id = wot_index[&joiner.issuers()[0]];
wot_db
.write(|db| {
db.set_enabled(wotb_id, true);
db.set_enabled(wot_id, true);
})
.expect("Fail to write in WotDB");
wot_dbs_requests.push(WotsDBsWriteQuery::RevertRenewalIdentity(
joiner.issuers()[0],
wotb_id,
wot_id,
block.median_time,
joiner.blockstamp().id,
));
......
......@@ -27,7 +27,7 @@ use duniter_dal::writers::requests::*;
use duniter_dal::ForkId;
use duniter_documents::{BlockHash, BlockId};
use duniter_network::NetworkBlock;
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use std::collections::{HashMap, VecDeque};
use std::fs;
use std::ops::Deref;
......@@ -279,10 +279,10 @@ pub fn sync_ts<DC: DuniterConf>(
return;
}
// Get wotb index
let mut wotb_index: HashMap<PubKey, NodeId> =
DALIdentity::get_wotb_index(&wot_databases.identities_db)
.expect("Fatal eror : get_wotb_index : Fail to read blockchain databases");
// Get wot index
let mut wot_index: HashMap<PubKey, NodeId> =
DALIdentity::get_wot_index(&wot_databases.identities_db)
.expect("Fatal eror : get_wot_index : Fail to read blockchain databases");
// Start sync
let sync_start_time = SystemTime::now();
......@@ -535,7 +535,7 @@ pub fn sync_ts<DC: DuniterConf>(
if let Ok(ValidBlockApplyReqs(block_req, wot_db_reqs, currency_db_reqs)) =
apply_valid_block::<RustyWebOfTrust>(
&block_doc,
&mut wotb_index,
&mut wot_index,
&wot_db,
&expire_certs,
None,
......@@ -624,7 +624,7 @@ pub fn sync_ts<DC: DuniterConf>(
currency_params_db.save().expect("Fail to save params db");
// Save wot file
wot_db.save().expect("Fail to save wotb db");
wot_db.save().expect("Fail to save wot db");
let main_job_duration =
SystemTime::now().duration_since(main_job_begin).unwrap() - all_wait_duration;
......
......@@ -13,7 +13,7 @@ duniter-crypto = { path = "../crypto" }
duniter-documents = { path = "../documents" }
duniter-module = { path = "../module" }
duniter-network = { path = "../network" }
duniter-wotb = { path = "../wotb" }
durs-wot = { path = "../wot" }
lazy_static = "1.0.*"
log = "0.4.*"
rand = "0.4.*"
......
......@@ -18,7 +18,7 @@ use duniter_crypto::keys::*;
use duniter_documents::blockchain::v10::documents::BlockDocument;
use duniter_documents::blockchain::Document;
use duniter_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp};
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use std::collections::HashMap;
use *;
......
......@@ -14,10 +14,10 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
extern crate duniter_documents;
extern crate duniter_wotb;
extern crate durs_wot;
use duniter_documents::BlockId;
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use std::collections::HashMap;
use {BinDB, CertsExpirV10Datas, DALError};
......
......@@ -17,7 +17,7 @@ use currency_params::CurrencyParameters;
use duniter_crypto::keys::*;
use duniter_documents::blockchain::v10::documents::IdentityDocument;
use duniter_documents::{BlockId, Blockstamp};
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use std::collections::HashMap;
use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas};
......@@ -129,16 +129,16 @@ impl DALIdentity {
}
/// Get wot_id index
pub fn get_wotb_index(
pub fn get_wot_index(
identities_db: &BinDB<IdentitiesV10Datas>,
) -> Result<HashMap<PubKey, NodeId>, DALError> {
Ok(identities_db.read(|db| {
let mut wotb_index: HashMap<PubKey, NodeId> = HashMap::new();
let mut wot_index: HashMap<PubKey, NodeId> = HashMap::new();
for (pubkey, member_datas) in db {
let wotb_id = member_datas.wot_id;
wotb_index.insert(*pubkey, wotb_id);
let wot_id = member_datas.wot_id;
wot_index.insert(*pubkey, wot_id);
}
wotb_index
wot_index
})?)
}
......
......@@ -39,7 +39,7 @@ extern crate serde_derive;
extern crate duniter_crypto;
extern crate duniter_documents;
extern crate duniter_wotb;
extern crate durs_wot;
extern crate rustbreak;
extern crate serde;
......@@ -85,7 +85,7 @@ use duniter_documents::blockchain::v10::documents::block::BlockV10Parameters;
use duniter_documents::blockchain::v10::documents::transaction::*;
use duniter_documents::CurrencyName;
use duniter_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp};
use duniter_wotb::{NodeId, WebOfTrust};
use durs_wot::{NodeId, WebOfTrust};
use rustbreak::backend::{FileBackend, MemoryBackend};
use rustbreak::error::{RustbreakError, RustbreakErrorKind};
use rustbreak::{deser::Bincode, Database, FileDatabase, MemoryDatabase};
......@@ -478,7 +478,7 @@ pub fn open_db<D: Serialize + DeserializeOwned + Debug + Default + Clone + Send>
}
}
/// Open wot db (cf. duniter-wot crate)
/// Open wot db (cf. durs-wot crate)
pub fn open_wot_db<W: WebOfTrust>(dbs_folder_path: Option<&PathBuf>) -> Result<BinDB<W>, DALError> {
if let Some(dbs_folder_path) = dbs_folder_path {
Ok(BinDB::File(open_db::<W>(dbs_folder_path, "wot.db")?))
......
......@@ -13,15 +13,13 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
extern crate duniter_wotb;
extern crate durs_wot;
use duniter_wotb::operations::centrality::{
CentralitiesCalculator, UlrikBrandesCentralityCalculator,
};
use duniter_wotb::operations::distance::{
use durs_wot::operations::centrality::{CentralitiesCalculator, UlrikBrandesCentralityCalculator};
use durs_wot::operations::distance::{
DistanceCalculator, RustyDistanceCalculator, WotDistance, WotDistanceParameters,
};
use duniter_wotb::{NodeId, WebOfTrust};
use durs_wot::{NodeId, WebOfTrust};
/// CENTRALITY_CALCULATOR
pub static CENTRALITY_CALCULATOR: UlrikBrandesCentralityCalculator =
......
......@@ -20,7 +20,7 @@ use currency_params::CurrencyParameters;
use duniter_crypto::keys::*;
use duniter_documents::blockchain::v10::documents::certification::CompactCertificationDocument;
use duniter_documents::BlockId;
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use {BinDB, CertsExpirV10Datas, DALError, IdentitiesV10Datas};
/// Apply "certification" event in databases
......
......@@ -18,7 +18,7 @@ use duniter_crypto::keys::PubKey;
use duniter_documents::blockchain::v10::documents::IdentityDocument;
use duniter_documents::blockchain::Document;
use duniter_documents::{BlockId, Blockstamp};
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use identity::{DALIdentity, DALIdentityState};
use {BinDB, DALError, IdentitiesV10Datas, MsExpirV10Datas};
......
......@@ -22,7 +22,7 @@ use duniter_crypto::keys::PubKey;
use duniter_documents::blockchain::v10::documents::certification::CompactCertificationDocument;
use duniter_documents::blockchain::v10::documents::identity::IdentityDocument;
use duniter_documents::Blockstamp;
use duniter_wotb::NodeId;
use durs_wot::NodeId;
use identity::DALIdentity;
use sources::SourceAmount;
use std::ops::Deref;
......@@ -89,9 +89,9 @@ impl BlocksDBsWriteQuery {
#[derive(Debug, Clone)]
/// Contain a pending write request for wots databases
pub enum WotsDBsWriteQuery {
/// Newcomer (wotb_id, blockstamp, current_bc_time, idty_doc, ms_created_block_id)
/// Newcomer (wot_id, blockstamp, current_bc_time, idty_doc, ms_created_block_id)
CreateIdentity(NodeId, Blockstamp, u64, Box<IdentityDocument>, BlockId),
/// Revert newcomer event (wotb_id, blockstamp, current_bc_time, idty_doc, ms_created_block_id)
/// Revert newcomer event (wot_id, blockstamp, current_bc_time, idty_doc, ms_created_block_id)
RevertCreateIdentity(PubKey),
/// Active (pubKey, idty_wot_id, current_bc_time, ms_created_block_id)
RenewalIdentity(PubKey, NodeId, u64, BlockId),
......@@ -124,7 +124,7 @@ impl WotsDBsWriteQuery {
) -> Result<(), DALError> {
match *self {
WotsDBsWriteQuery::CreateIdentity(
ref wotb_id,
ref wot_id,
ref blockstamp,
ref current_bc_time,
ref idty_doc,
......@@ -136,7 +136,7 @@ impl WotsDBsWriteQuery {
&databases.ms_db,
idty_doc.deref(),
*ms_created_block_id,
*wotb_id,
*wot_id,
*blockstamp,
*current_bc_time,
)?;
......
[package]
name = "duniter-wotb"
version = "0.8.0-a0.7"
name = "durs-wot"
version = "0.8.0-a0.8"
authors = ["nanocryk <nanocryk@duniter.org>", "elois <elois@duniter.org>"]
description = "Makes Web of Trust computations for the Duniter project."
repository = "https://git.duniter.org/nodes/rust/duniter-rs"
readme = "README.md"
keywords = ["duniter", "wot", "wotb", "web", "trust"]
keywords = ["duniter", "wot", "wot", "web", "trust"]
license = "AGPL-3.0"
[lib]
......
# wotb
# wot
`wotb` is a crate making "Web of Trust" computations for
`wot` is a crate making "Web of Trust" computations for
the [Duniter] project.
[Duniter]: https://duniter.org/en/
## How to use it
You can add `duniter-wotb` as a `cargo` dependency in your Rust project.
\ No newline at end of file
You can add `durs-wot` as a `cargo` dependency in your Rust project.
\ No newline at end of file
......@@ -13,7 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! `wotb` is a crate making "Web of Trust" computations for
//! `wot` is a crate making "Web of Trust" computations for
//! the [Duniter] project.
//!
//! [Duniter]: https://duniter.org/
......@@ -22,9 +22,9 @@
//!
//! It also contains an "legacy" implementation translated from the original C++ code.
//!
//! Web of Trust tests are translated from [duniter/wotb Javascript test][js-tests].
//! Web of Trust tests are translated from [duniter/wot Javascript test][js-tests].
//!
//! [js-tests]: https://github.com/duniter/wotb/blob/master/wotcpp/webOfTrust.cpp
//! [js-tests]: https://github.com/duniter/wot/blob/master/wotcpp/webOfTrust.cpp
#![cfg_attr(feature = "strict", deny(warnings))]
#![deny(
......@@ -60,7 +60,7 @@ mod tests {
use operations::file::*;
use operations::path::*;
/// Test translated from https://github.com/duniter/wotb/blob/master/tests/test.js
/// Test translated from https://github.com/duniter/wot/blob/master/tests/test.js
///
/// Clone and file tests are not included in this generic test and should be done in
/// the implementation test.
......
......@@ -87,7 +87,7 @@ impl FileFormater for BinaryFileFormater {
) -> Result<(T, Vec<u8>), WotParseError> {
let mut wot = T::new(max_links);
let file_size = fs::metadata(path).expect("fail to read wotb file !").len();
let file_size = fs::metadata(path).expect("fail to read wot file !").len();
let mut file_pointing_to_blockstamp_size: Vec<u8> = vec![0; file_size as usize];
match File::open(path) {
Ok(mut file) => {
......
......@@ -17,7 +17,7 @@ duniter-documents = { path = "../documents" }
duniter-message = { path = "../message" }
duniter-module = { path = "../module" }
duniter-network = { path = "../network" }
duniter-wotb = { path = "../wotb" }
durs-wot = { path = "../wot" }
lazy_static = "1.0.*"
log = "0.4.*"