Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Jan 14, 2025
1 parent 37be403 commit 649f602
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions crates/proof-sdk/proof-interop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ serde.workspace = true
tracing.workspace = true
serde_json.workspace = true

# `std` feature dependencies
tokio = { workspace = true, features = ["full"], optional = true }

# Arbitrary
arbitrary = { version = "1.4", features = ["derive"], optional = true }

Expand All @@ -45,5 +42,4 @@ arbitrary = { version = "1.4", features = ["derive"] }
rand.workspace = true

[features]
std = ["dep:tokio"]
arbitrary = ["dep:arbitrary", "alloy-primitives/arbitrary", "kona-interop/arbitrary"]
5 changes: 2 additions & 3 deletions crates/proof-sdk/proof-interop/src/boot.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! This module contains the prologue phase of the client program, pulling in the boot information
//! through the `PreimageOracle` ABI as local keys.
use kona_proof::errors::OracleProviderError;
use alloy_primitives::{B256, U256};
use kona_preimage::{PreimageKey, PreimageOracleClient};
use op_alloy_genesis::RollupConfig;
use kona_proof::errors::OracleProviderError;
use maili_registry::ROLLUP_CONFIGS;
use op_alloy_genesis::RollupConfig;
use serde::{Deserialize, Serialize};
use tracing::warn;

Expand Down Expand Up @@ -121,4 +121,3 @@ impl BootInfo {
})
}
}

3 changes: 2 additions & 1 deletion crates/proof-sdk/proof-interop/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ pub enum HintType {
L2Code,
/// A hint that specifies the preimage of the agreed upon pre-state claim.
AgreedPreState,
/// A hint that specifies the preimage of an L2 output root within the agreed upon pre-state, by chain ID.
/// A hint that specifies the preimage of an L2 output root within the agreed upon pre-state,
/// by chain ID.
L2OutputRoot,
/// A hint that specifies the state node in the L2 state trie.
L2StateNode,
Expand Down
21 changes: 13 additions & 8 deletions crates/proof-sdk/proof-interop/src/pre_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ pub enum PreState {
impl Encodable for PreState {
fn encode(&self, out: &mut dyn alloy_rlp::BufMut) {
match self {
PreState::SuperRoot(super_root) => {
Self::SuperRoot(super_root) => {
super_root.encode(out);
}
PreState::TransitionState(transition_state) => {
Self::TransitionState(transition_state) => {
transition_state.encode(out);
}
}
Expand All @@ -43,12 +43,12 @@ impl Decodable for PreState {
match buf[0] {
TRANSITION_STATE_VERSION => {
let transition_state = TransitionState::decode(buf)?;
Ok(PreState::TransitionState(transition_state))
Ok(Self::TransitionState(transition_state))
}
SUPER_ROOT_VERSION => {
let super_root =
SuperRoot::decode(buf).map_err(|_| alloy_rlp::Error::UnexpectedString)?;
Ok(PreState::SuperRoot(super_root))
Ok(Self::SuperRoot(super_root))
}
_ => Err(alloy_rlp::Error::Custom("invalid version byte")),
}
Expand All @@ -70,7 +70,11 @@ pub struct TransitionState {

impl TransitionState {
/// Create a new [TransitionState] with the given pre-state, pending progress, and step number.
pub fn new(pre_state: SuperRoot, pending_progress: Vec<OptimisticBlock>, step: u64) -> Self {
pub const fn new(
pre_state: SuperRoot,
pending_progress: Vec<OptimisticBlock>,
step: u64,
) -> Self {
Self { pre_state, pending_progress, step }
}

Expand Down Expand Up @@ -138,8 +142,8 @@ pub struct OptimisticBlock {
}

impl OptimisticBlock {
/// Create a new [OutputRootWithBlockHash] with the given block hash and output root hash.
pub fn new(block_hash: B256, output_root: B256) -> Self {
/// Create a new [OptimisticBlock] with the given block hash and output root hash.
pub const fn new(block_hash: B256, output_root: B256) -> Self {
Self { block_hash, output_root }
}
}
Expand Down Expand Up @@ -177,7 +181,8 @@ mod test {
fn test_arbitrary_pre_state_roundtrip() {
let mut bytes = [0u8; 1024];
rand::thread_rng().fill(bytes.as_mut_slice());
let pre_state = super::PreState::arbitrary(&mut arbitrary::Unstructured::new(&bytes)).unwrap();
let pre_state =
super::PreState::arbitrary(&mut arbitrary::Unstructured::new(&bytes)).unwrap();

let mut rlp_buf = Vec::with_capacity(pre_state.length());
pre_state.encode(&mut rlp_buf);
Expand Down

0 comments on commit 649f602

Please sign in to comment.