Skip to content

Commit

Permalink
Merge branch 'l-monninger/gas-upgrades-beta-fixes' of https://github.…
Browse files Browse the repository at this point in the history
…com/movementlabsxyz/movement into l-monninger/gas-upgrades-beta-fixes
  • Loading branch information
l-monninger committed Feb 26, 2025
2 parents c7dc78a + b63dbfc commit c73de9f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ where
let blobs = request.into_inner().blobs;
for data in blobs {
let blob = InnerSignedBlobV1Data::now(data.data)
.map_err(|e| tonic::Status::internal(format!("Failed to create blob data: {}", e)))?
.try_to_sign(&self.signer)
.await
.map_err(|e| tonic::Status::internal(format!("Failed to sign blob: {}", e)))?;
Expand Down
1 change: 1 addition & 0 deletions protocol-units/da/movement/protocol/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ movement-da-light-node-signer = { workspace = true }
movement-signer = { workspace = true }
movement-signer-loader = { workspace = true }
movement-types = { workspace = true }
chrono = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
Expand Down
16 changes: 8 additions & 8 deletions protocol-units/da/movement/protocol/util/src/blob/ir/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ where
Self { blob, timestamp, __curve_marker: std::marker::PhantomData }
}

pub fn now(blob: Vec<u8>) -> Result<Self, anyhow::Error> {
Ok(Self::new(
blob,
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH)?.as_secs(),
))
pub fn now(blob: Vec<u8>) -> Self {
// mark the timestamp as now in milliseconds
let timestamp = chrono::Utc::now().timestamp_micros() as u64;

Self::new(blob, timestamp)
}

/// Gets an owned copy of the bytes to be signed
Expand Down Expand Up @@ -76,7 +76,7 @@ pub mod block {

fn try_from(block: block::Block) -> Result<Self, Self::Error> {
let blob = bcs::to_bytes(&block)?;
Self::now(blob)
Ok(Self::now(blob))
}
}

Expand All @@ -88,7 +88,7 @@ pub mod block {

fn try_from(id: block::Id) -> Result<Self, Self::Error> {
let blob = id.as_bytes().to_vec();
Self::now(blob)
Ok(Self::now(blob))
}
}

Expand All @@ -100,7 +100,7 @@ pub mod block {

fn try_from(ids: Vec<block::Id>) -> Result<Self, Self::Error> {
let blob = bcs::to_bytes(&ids)?;
Self::now(blob)
Ok(Self::now(blob))
}
}
}

0 comments on commit c73de9f

Please sign in to comment.