Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rust/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ripemd160::Ripemd160;
use sha2::{Digest, Sha256, Sha512, Sha512Trunc256};
use sha3::Sha3_512;
use std::convert::TryInto;
use std::num::TryFromIntError;

use crate::helpers::{Hash, Result};
use crate::ics23::{HashOp, InnerOp, LeafOp, LengthOp};
Expand Down Expand Up @@ -68,7 +69,7 @@ fn do_length(length: LengthOp, data: &[u8]) -> Result<Hash> {
}

fn proto_len(length: usize) -> Result<Hash> {
let size: u64 = length.try_into()?;
let size: u64 = length.try_into().map_err(|e : TryFromIntError | anyhow::anyhow!(e))?;
let mut len = Hash::new();
prost::encoding::encode_varint(size, &mut len);
Ok(len)
Expand Down