@@ -91,21 +91,23 @@ impl BallotBoxWrapper {
9191 reward_token_id,
9292 reward_token_quantity,
9393 pool_box_address_hash,
94+ update_box_creation_height,
9495 } ) = inputs. parameters . vote_parameters . as_ref ( )
9596 {
96- if ergo_box
97+ let register_update_box_creation_height = ergo_box
9798 . get_register ( NonMandatoryRegisterId :: R5 . into ( ) )
9899 . ok_or ( BallotBoxError :: NoUpdateBoxCreationHeightInR5 ) ?
99- . try_extract_into :: < i32 > ( )
100- . is_err ( )
101- {
102- return Err ( BallotBoxError :: NoUpdateBoxCreationHeightInR5 ) ;
100+ . try_extract_into :: < i32 > ( ) ? ;
101+
102+ if register_update_box_creation_height != * update_box_creation_height {
103+ warn ! ( "Update box creation height in R5 register differs to config. Could be due to vote." ) ;
103104 }
104105
105106 let register_pool_box_address_hash = ergo_box
106107 . get_register ( NonMandatoryRegisterId :: R6 . into ( ) )
107108 . ok_or ( BallotBoxError :: NoPoolBoxAddressInR6 ) ?
108109 . try_extract_into :: < Digest32 > ( ) ?;
110+
109111 if * pool_box_address_hash != register_pool_box_address_hash {
110112 warn ! ( "Pool box address in R6 register differs to config. Could be due to vote." ) ;
111113 }
@@ -114,6 +116,7 @@ impl BallotBoxWrapper {
114116 . get_register ( NonMandatoryRegisterId :: R7 . into ( ) )
115117 . ok_or ( BallotBoxError :: NoRewardTokenIdInR7 ) ?
116118 . try_extract_into :: < TokenId > ( ) ?;
119+
117120 if register_reward_token_id != * reward_token_id {
118121 warn ! ( "Reward token id in R7 register differs to config. Could be due to vote." ) ;
119122 }
@@ -177,14 +180,10 @@ impl VoteBallotBoxWrapper {
177180 {
178181 return Err ( BallotBoxError :: NoGroupElementInR4 ) ;
179182 }
180- if ergo_box
183+ let update_box_creation_height = ergo_box
181184 . get_register ( NonMandatoryRegisterId :: R5 . into ( ) )
182185 . ok_or ( BallotBoxError :: NoUpdateBoxCreationHeightInR5 ) ?
183- . try_extract_into :: < i32 > ( )
184- . is_err ( )
185- {
186- return Err ( BallotBoxError :: NoUpdateBoxCreationHeightInR5 ) ;
187- }
186+ . try_extract_into :: < i32 > ( ) ?;
188187
189188 let pool_box_address_hash = ergo_box
190189 . get_register ( NonMandatoryRegisterId :: R6 . into ( ) )
@@ -205,6 +204,7 @@ impl VoteBallotBoxWrapper {
205204 pool_box_address_hash,
206205 reward_token_id,
207206 reward_token_quantity,
207+ update_box_creation_height,
208208 } ;
209209 Ok ( Self {
210210 ergo_box,
0 commit comments