Skip to content

Commit

Permalink
temp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0rek committed Jan 5, 2024
1 parent 8252770 commit 2282960
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion types/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
fn index_calculation() {
let height = 100;
let shares = vec![vec![0; SHARE_SIZE]; 8 * 8];
let eds = ExtendedDataSquare::new(shares, 8);
let eds = ExtendedDataSquare::new(shares, "".to_string());

Row::new(1, &eds, height).unwrap();
Row::new(7, &eds, height).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions types/src/rsmt2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ impl TryFrom<u8> for AxisType {
pub struct ExtendedDataSquare {
#[serde(with = "tendermint_proto::serializers::bytes::vec_base64string")]
pub data_square: Vec<Vec<u8>>,
pub square_len: usize,
pub codec: String,
}

impl ExtendedDataSquare {
pub fn new(shares: Vec<Vec<u8>>, square_len: usize) -> Self {
pub fn new(shares: Vec<Vec<u8>>, codec: String) -> Self {
// TODO: validation
Self {
data_square: shares,
square_len,
codec,
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ impl ExtendedDataSquare {
}

pub fn square_len(&self) -> usize {
self.square_len
f64::sqrt(self.data_square.len() as f64) as usize + 1
}

pub fn get_namespaced_data(
Expand Down

0 comments on commit 2282960

Please sign in to comment.