diff --git a/crates/op-test-vectors/Cargo.toml b/crates/op-test-vectors/Cargo.toml index 882e9d2..0a7bd88 100644 --- a/crates/op-test-vectors/Cargo.toml +++ b/crates/op-test-vectors/Cargo.toml @@ -25,6 +25,8 @@ alloy-consensus.workspace = true op-alloy-rpc-types.workspace = true op-alloy-consensus.workspace = true +# Kona +kona-primitives.workspace = true + [dev-dependencies] serde_json.workspace = true -kona-primitives.workspace = true diff --git a/crates/op-test-vectors/src/faultproof.rs b/crates/op-test-vectors/src/faultproof.rs index 0bd1e63..c74ac51 100644 --- a/crates/op-test-vectors/src/faultproof.rs +++ b/crates/op-test-vectors/src/faultproof.rs @@ -2,7 +2,7 @@ use alloy_primitives::{BlockHash, BlockNumber, Bytes, B256}; use hashbrown::HashMap; -use kona_derive::types::RollupConfig; +use kona_primitives::RollupConfig; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -54,9 +54,29 @@ pub enum FaultProofStatus { Unknown, } +impl TryFrom for FaultProofStatus { + type Error = String; + + fn try_from(value: u8) -> Result { + match value { + 0 => Ok(FaultProofStatus::Valid), + 1 => Ok(FaultProofStatus::Invalid), + 2 => Ok(FaultProofStatus::Panic), + 3 => Ok(FaultProofStatus::Unfinished), + _ => Ok(FaultProofStatus::Unknown), + } + } +} + +impl From for u8 { + fn from(status: FaultProofStatus) -> u8 { + status as u8 + } +} + #[cfg(test)] mod tests { - use kona_derive::types::BASE_MAINNET_CONFIG; + use kona_primitives::BASE_MAINNET_CONFIG; use super::*; @@ -112,7 +132,7 @@ mod tests { rollup_config: BASE_MAINNET_CONFIG, }, expected_status: FaultProofStatus::Valid, - witness_data: witness_data, + witness_data, }; let serialized_fixture =