@@ -1135,7 +1135,7 @@ mod tests {
11351135 let mut dst = BytesMut :: new ( ) ;
11361136
11371137 // Add context bytes if required
1138- dst. extend_from_slice ( & fork_context. to_context_bytes ( fork_name ) . unwrap ( ) ) ;
1138+ dst. extend_from_slice ( & fork_context. context_bytes ( fork_context . digest_epoch ( ) ) ) ;
11391139
11401140 let mut uvi_codec: Uvi < usize > = Uvi :: default ( ) ;
11411141
@@ -1792,8 +1792,8 @@ mod tests {
17921792 . unwrap ( ) ;
17931793
17941794 let mut wrong_fork_bytes = BytesMut :: new ( ) ;
1795- wrong_fork_bytes
1796- . extend_from_slice ( & fork_context. to_context_bytes ( ForkName :: Altair ) . unwrap ( ) ) ;
1795+ let altair_epoch = chain_spec . altair_fork_epoch . unwrap ( ) ;
1796+ wrong_fork_bytes . extend_from_slice ( & fork_context. context_bytes ( altair_epoch ) ) ;
17971797 wrong_fork_bytes. extend_from_slice ( & encoded_bytes. split_off ( 4 ) ) ;
17981798
17991799 assert ! ( matches!(
@@ -1817,7 +1817,9 @@ mod tests {
18171817 . unwrap ( ) ;
18181818
18191819 let mut wrong_fork_bytes = BytesMut :: new ( ) ;
1820- wrong_fork_bytes. extend_from_slice ( & fork_context. to_context_bytes ( ForkName :: Base ) . unwrap ( ) ) ;
1820+ wrong_fork_bytes. extend_from_slice (
1821+ & fork_context. context_bytes ( chain_spec. genesis_slot . epoch ( Spec :: slots_per_epoch ( ) ) ) ,
1822+ ) ;
18211823 wrong_fork_bytes. extend_from_slice ( & encoded_bytes. split_off ( 4 ) ) ;
18221824
18231825 assert ! ( matches!(
@@ -1833,7 +1835,7 @@ mod tests {
18331835
18341836 // Adding context bytes to Protocols that don't require it should return an error
18351837 let mut encoded_bytes = BytesMut :: new ( ) ;
1836- encoded_bytes. extend_from_slice ( & fork_context. to_context_bytes ( ForkName :: Altair ) . unwrap ( ) ) ;
1838+ encoded_bytes. extend_from_slice ( & fork_context. context_bytes ( altair_epoch ) ) ;
18371839 encoded_bytes. extend_from_slice (
18381840 & encode_response (
18391841 SupportedProtocol :: MetaDataV2 ,
@@ -2034,7 +2036,8 @@ mod tests {
20342036 let mut dst = BytesMut :: with_capacity ( 1024 ) ;
20352037
20362038 // Insert context bytes
2037- dst. extend_from_slice ( & fork_context. to_context_bytes ( ForkName :: Altair ) . unwrap ( ) ) ;
2039+ let altair_epoch = fork_context. spec . altair_fork_epoch . unwrap ( ) ;
2040+ dst. extend_from_slice ( & fork_context. context_bytes ( altair_epoch) ) ;
20382041
20392042 // Insert length-prefix
20402043 uvi_codec
0 commit comments