Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • develop
  • duniter-v2s-issue-123-industrialize-releases
  • master
  • 1.8.2
  • v1.8.3
5 results

Target

Select target project
  • nodes/rust/duniter-core
  • tuxmain/duniter-core
  • aya/duniter-core
3 results
Select Git revision
  • 1-add_link-is-not-compliant-with-duniter-1-7
  • fix/#1/certification-replay
  • master
3 results
Show changes
Commits on Source (10)
Showing
with 838 additions and 680 deletions
......@@ -4,8 +4,6 @@ stages:
.env:
image: duniter/rust-x64-stable-ci:latest
tags:
- redshift
before_script:
- export PATH="$HOME/.cargo/bin:$PATH"
- rustup show && rustc --version && cargo --version
......@@ -34,7 +32,7 @@ fmt_and_clippy:
stage: quality
script:
- cargo fmt -- --version
- cargo fmt -- --check
- cargo fmt -- --check -l
- cargo clippy -- -V
- cargo clippy --all --tests -- -D warnings --verbose
......
This diff is collapsed.
......@@ -6,7 +6,7 @@ keywords = ["duniter"]
license = "AGPL-3.0"
name = "duniter-core"
repository = "https://git.duniter.org/nodes/rust/duniter-core"
version = "1.8.1"
version = "1.8.3"
[dependencies]
dubp = { version = "0.58.0", features = ["duniter"] }
......
......@@ -113,7 +113,7 @@ fn apply_block_inner(
let block_for_txs_mp = Arc::clone(&block);
// Cm
crate::cm::update_current_meta(&block_for_cm, &global_sender);
crate::cm::update_current_meta(&block_for_cm, global_sender);
//TxsMp
let txs_mp_handle = dbs_pool
......@@ -143,7 +143,7 @@ fn apply_chunk_inner(
// Cm
if let Some(global_sender) = global_sender {
let chunk_len = blocks.len();
crate::cm::update_current_meta(&&blocks.deref()[chunk_len - 1], &global_sender);
crate::cm::update_current_meta(&blocks.deref()[chunk_len - 1], global_sender);
}
//TxsMp
......
......@@ -60,7 +60,7 @@ pub fn apply_block<B: Backend>(
);
}
blocks_meta.upsert(U32BE(block.number().0), block_meta);
identities::update_identities::<B>(&block, &mut identities)?;
identities::update_identities::<B>(block, &mut identities)?;
for idty in block.identities() {
let pubkey = idty.issuers()[0];
let username = idty.username().to_owned();
......@@ -150,7 +150,7 @@ pub fn revert_block<B: Backend>(
&mut uds_reval,
)?;
}
identities::revert_identities::<B>(&block, &mut identities)?;
identities::revert_identities::<B>(block, &mut identities)?;
for idty in block.identities() {
let username = idty.username().to_owned();
uids_index.remove(username);
......
......@@ -21,7 +21,7 @@ pub fn apply_block<B: Backend>(
) -> KvResult<()> {
for tx in block_txs {
// Remove tx from mempool
remove_one_pending_tx(&txs_mp_db, tx.get_hash())?;
remove_one_pending_tx(txs_mp_db, tx.get_hash())?;
}
Ok(())
}
......@@ -135,7 +135,7 @@ pub fn remove_all_pending_txs<B: Backend>(txs_mp_db: &TxsMpV2Db<B>) -> KvResult<
}
pub fn remove_pending_tx_by_hash<B: Backend>(txs_mp_db: &TxsMpV2Db<B>, hash: Hash) -> KvResult<()> {
remove_one_pending_tx(&txs_mp_db, hash)?;
remove_one_pending_tx(txs_mp_db, hash)?;
Ok(())
}
......@@ -155,7 +155,7 @@ pub fn trim_expired_non_written_txs<B: Backend>(
})?;
// For each tx to remove
for (hash, time) in hashs.into_iter().zip(times.into_iter()) {
remove_one_pending_tx(&txs_mp_db, hash)?;
remove_one_pending_tx(txs_mp_db, hash)?;
// Remove txs hashs in col `txs_by_recv_time`
txs_mp_db.txs_by_recv_time_write().remove(time)?;
}
......
......@@ -30,7 +30,7 @@ impl kv_typed::prelude::FromBytes for HashKeyV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let hash_str = std::str::from_utf8(bytes).map_err(|e| CorruptedBytes(e.to_string()))?;
Ok(HashKeyV1(
Hash::from_hex(&hash_str).map_err(|e| CorruptedBytes(e.to_string()))?,
Hash::from_hex(hash_str).map_err(|e| CorruptedBytes(e.to_string()))?,
))
}
}
......
......@@ -43,7 +43,7 @@ impl kv_typed::prelude::FromBytes for PubKeyKeyV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let pubkey_str = std::str::from_utf8(bytes).map_err(|e| CorruptedBytes(e.to_string()))?;
Ok(PubKeyKeyV1(PublicKey::from_base58(&pubkey_str).map_err(
Ok(PubKeyKeyV1(PublicKey::from_base58(pubkey_str).map_err(
|e| CorruptedBytes(format!("{}: {}", e, pubkey_str)),
)?))
}
......
......@@ -76,8 +76,7 @@ impl kv_typed::prelude::FromBytes for BlockDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......@@ -134,7 +133,7 @@ impl kv_typed::prelude::FromBytes for BlockDbV2 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
bincode_db()
.deserialize(&bytes)
.deserialize(bytes)
.map_err(|e| CorruptedBytes(format!("{}: '{:?}'", e, bytes)))
}
}
......
......@@ -63,8 +63,7 @@ impl kv_typed::prelude::FromBytes for BlockHeadDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -31,8 +31,7 @@ impl kv_typed::prelude::FromBytes for BlockNumberArrayV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
//println!("json_str='{}'", &json_str);
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -34,8 +34,7 @@ impl kv_typed::prelude::FromBytes for CIndexDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
//println!("json_str='{}'", &json_str);
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -106,7 +106,7 @@ impl kv_typed::prelude::FromBytes for DunpHeadDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
bincode_db()
.deserialize(&bytes)
.deserialize(bytes)
.map_err(|e| CorruptedBytes(format!("{}: '{:?}'", e, bytes)))
}
}
......
......@@ -31,8 +31,7 @@ impl kv_typed::prelude::FromBytes for IIndexDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
//println!("json_str='{}'", &json_str);
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -33,8 +33,7 @@ impl kv_typed::prelude::FromBytes for KickDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -31,8 +31,7 @@ impl kv_typed::prelude::FromBytes for MIndexDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
//println!("json_str='{}'", &json_str);
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......
......@@ -37,7 +37,7 @@ impl kv_typed::prelude::FromBytes for PeerCardDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
bincode_db()
.deserialize(&bytes)
.deserialize(bytes)
.map_err(|e| CorruptedBytes(format!("{}: '{:?}'", e, bytes)))
}
}
......
......@@ -75,7 +75,7 @@ impl kv_typed::prelude::FromBytes for PublicKeyArrayDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
let vec_pub_str: SmallVec<[String; 8]> = serde_json::from_str(&json_str)
let vec_pub_str: SmallVec<[String; 8]> = serde_json::from_str(json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))?;
Ok(Self(
vec_pub_str
......
......@@ -54,8 +54,7 @@ impl kv_typed::prelude::FromBytes for SIndexDBV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
serde_json::from_str(&json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
serde_json::from_str(json_str).map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))
}
}
......@@ -95,7 +94,7 @@ impl kv_typed::prelude::FromBytes for SourceKeyArrayDbV1 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
let json_str = std::str::from_utf8(bytes).expect("corrupted db : invalid utf8 bytes");
let vec_source_key_str: SmallVec<[String; 8]> = serde_json::from_str(&json_str)
let vec_source_key_str: SmallVec<[String; 8]> = serde_json::from_str(json_str)
.map_err(|e| CorruptedBytes(format!("{}: '{}'", e, json_str)))?;
Ok(Self(
vec_source_key_str
......
......@@ -36,7 +36,7 @@ impl kv_typed::prelude::FromBytes for PendingTxDbV2 {
fn from_bytes(bytes: &[u8]) -> std::result::Result<Self, Self::Err> {
bincode_db()
.deserialize(&bytes)
.deserialize(bytes)
.map_err(|e| CorruptedBytes(format!("{}: '{:?}'", e, bytes)))
}
}
......