This repository was archived by the owner on Jan 31, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ alloy-consensus.workspace = true
2525op-alloy-rpc-types.workspace = true
2626op-alloy-consensus.workspace = true
2727
28+ # Kona
29+ kona-primitives.workspace = true
30+
2831[dev-dependencies ]
2932serde_json.workspace = true
30- kona-primitives.workspace = true
Original file line number Diff line number Diff line change 22
33use alloy_primitives:: { BlockHash , BlockNumber , Bytes , B256 } ;
44use hashbrown:: HashMap ;
5- use kona_derive :: types :: RollupConfig ;
5+ use kona_primitives :: RollupConfig ;
66use serde:: { Deserialize , Serialize } ;
77use serde_repr:: { Deserialize_repr , Serialize_repr } ;
88
@@ -54,9 +54,29 @@ pub enum FaultProofStatus {
5454 Unknown ,
5555}
5656
57+ impl TryFrom < u8 > for FaultProofStatus {
58+ type Error = String ;
59+
60+ fn try_from ( value : u8 ) -> Result < Self , Self :: Error > {
61+ match value {
62+ 0 => Ok ( FaultProofStatus :: Valid ) ,
63+ 1 => Ok ( FaultProofStatus :: Invalid ) ,
64+ 2 => Ok ( FaultProofStatus :: Panic ) ,
65+ 3 => Ok ( FaultProofStatus :: Unfinished ) ,
66+ _ => Ok ( FaultProofStatus :: Unknown ) ,
67+ }
68+ }
69+ }
70+
71+ impl From < FaultProofStatus > for u8 {
72+ fn from ( status : FaultProofStatus ) -> u8 {
73+ status as u8
74+ }
75+ }
76+
5777#[ cfg( test) ]
5878mod tests {
59- use kona_derive :: types :: BASE_MAINNET_CONFIG ;
79+ use kona_primitives :: BASE_MAINNET_CONFIG ;
6080
6181 use super :: * ;
6282
You can’t perform that action at this time.
0 commit comments