Skip to content

Commit

Permalink
update the timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed Sep 12, 2023
1 parent 7886aea commit 2059cf3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions light-clients/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ pub fn decode_timestamp_extrinsic(ext: &Vec<u8>) -> Result<u64, anyhow::Error> {
// https://github.com/paritytech/substrate/blob/d602397a0bbb24b5d627795b797259a44a5e29e9/primitives/trie/src/lib.rs#L99-L101
// Decoding from the [2..] because the timestamp inmherent has two extra bytes before the call
// that represents the call length and the extrinsic version.
let (_, _, timestamp): (u8, u8, Compact<u64>) =
codec::Decode::decode(&mut &ext[ext.len() - 7..])
.map_err(|err| anyhow!("Failed to decode extrinsic: {err}"))?;
let ret: Compact<u64> = codec::Decode::decode(&mut &ext[5..])
.map_err(|err| anyhow!("Failed to decode extrinsic: {err}"))?;
Ok(timestamp.into())

Check failure on line 199 in light-clients/common/src/lib.rs

View workflow job for this annotation

GitHub Actions / Linters

cannot find value `timestamp` in this scope
}

Expand Down

0 comments on commit 2059cf3

Please sign in to comment.