@@ -38,6 +38,16 @@ pub enum BatchHeaderV {
3838 V7_8 ( BatchHeaderV7 ) ,
3939}
4040
41+ impl core:: fmt:: Display for BatchHeaderV {
42+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
43+ match self {
44+ BatchHeaderV :: V6 ( _) => write ! ( f, "V6" ) ,
45+ BatchHeaderV :: V7_8 ( _) => write ! ( f, "V7_8" ) ,
46+ BatchHeaderV :: Validium ( _) => write ! ( f, "Validium" ) ,
47+ }
48+ }
49+ }
50+
4151impl BatchHeaderV {
4252 pub fn batch_hash ( & self ) -> B256 {
4353 match self {
@@ -50,28 +60,28 @@ impl BatchHeaderV {
5060 pub fn must_v6_header ( & self ) -> & BatchHeaderV6 {
5161 match self {
5262 BatchHeaderV :: V6 ( h) => h,
53- _ => panic ! ( "try to pick other header type" ) ,
63+ _ => unreachable ! ( "A header of {} is considered to be v6" , self ) ,
5464 }
5565 }
5666
5767 pub fn must_v7_header ( & self ) -> & BatchHeaderV7 {
5868 match self {
5969 BatchHeaderV :: V7_8 ( h) => h,
60- _ => panic ! ( "try to pick other header type" ) ,
70+ _ => unreachable ! ( "A header of {} is considered to be v7" , self ) ,
6171 }
6272 }
6373
6474 pub fn must_v8_header ( & self ) -> & BatchHeaderV8 {
6575 match self {
6676 BatchHeaderV :: V7_8 ( h) => h,
67- _ => panic ! ( "try to pick other header type" ) ,
77+ _ => unreachable ! ( "A header of {} is considered to be v8" , self ) ,
6878 }
6979 }
7080
7181 pub fn must_validium_header ( & self ) -> & BatchHeaderValidium {
7282 match self {
7383 BatchHeaderV :: Validium ( h) => & h. header ,
74- _ => panic ! ( "try to pick other header type" ) ,
84+ _ => unreachable ! ( "A header of {} is considered to be validium" , self ) ,
7585 }
7686 }
7787}
0 commit comments