From ed87329f1985527b2b7b6595c2cbe3c6c100ff2d Mon Sep 17 00:00:00 2001 From: Luka Borkovic Date: Thu, 3 Nov 2022 10:11:37 +0100 Subject: [PATCH 1/2] Change block number type from u64 to u32 in kate::recovery. --- kate/recovery/src/com.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kate/recovery/src/com.rs b/kate/recovery/src/com.rs index 12c54e0e..e9738280 100644 --- a/kate/recovery/src/com.rs +++ b/kate/recovery/src/com.rs @@ -518,7 +518,7 @@ pub struct Position { impl Position { /// Refrence in format `block_number:column_number:row_number` - pub fn reference(&self, block_number: u64) -> String { + pub fn reference(&self, block_number: u32) -> String { format!("{}:{}:{}", block_number, self.col, self.row) } } @@ -542,7 +542,7 @@ pub struct Cell { } impl Cell { - pub fn reference(&self, block: u64) -> String { self.position.reference(block) } + pub fn reference(&self, block: u32) -> String { self.position.reference(block) } pub fn data(&self) -> [u8; 32] { self.content[48..].try_into().expect("content is 80 bytes") } From 5dff0bcddee467e01a5e3ef935305ccb65b3835c Mon Sep 17 00:00:00 2001 From: Luka Borkovic Date: Thu, 3 Nov 2022 11:17:27 +0100 Subject: [PATCH 2/2] Change thiserror with the normal version. --- Cargo.lock | 4 ++-- kate/recovery/Cargo.toml | 4 ++-- kate/recovery/src/com.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf1dcfa9..49940787 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1687,7 +1687,7 @@ dependencies = [ [[package]] name = "kate-recovery" -version = "0.1.2" +version = "0.2.0" dependencies = [ "dusk-bytes", "dusk-plonk", @@ -1696,7 +1696,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "serde", - "thiserror-no-std", + "thiserror", ] [[package]] diff --git a/kate/recovery/Cargo.toml b/kate/recovery/Cargo.toml index 3bc75dd9..40394865 100644 --- a/kate/recovery/Cargo.toml +++ b/kate/recovery/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kate-recovery" -version = "0.1.2" +version = "0.2.0" authors = ["Denis Ermolin "] edition = "2018" @@ -10,7 +10,7 @@ dusk-bytes = "0.1.6" dusk-plonk = { git = "https://github.com/maticnetwork/plonk.git", tag = "v0.12.0-polygon-1" } getrandom = { version = "0.2", features = ["js"] } serde = { version = "1.0", features = ["derive"] } -thiserror-no-std = "2.0.2" +thiserror = "1.0.37" [dev-dependencies] rand = "0.8.4" diff --git a/kate/recovery/src/com.rs b/kate/recovery/src/com.rs index e9738280..86425253 100644 --- a/kate/recovery/src/com.rs +++ b/kate/recovery/src/com.rs @@ -9,7 +9,7 @@ use codec::Decode; use dusk_bytes::Serializable; use dusk_plonk::{fft::EvaluationDomain, prelude::BlsScalar}; use serde::{Deserialize, Serialize}; -use thiserror_no_std::Error; +use thiserror::Error; // TODO: Constants are copy from kate crate, we should move them to common place pub const CHUNK_SIZE: usize = 32;