@@ -76,7 +76,7 @@ enum Cip36KeyRegistrationKeys {
7676}
7777
7878impl Decode < ' _ , ProblemReport > for Cip36KeyRegistration {
79- fn decode ( d : & mut Decoder , ctx : & mut ProblemReport ) -> Result < Self , decode:: Error > {
79+ fn decode ( d : & mut Decoder , err_report : & mut ProblemReport ) -> Result < Self , decode:: Error > {
8080 let map_len = decode_map_len ( d, "CIP36 Key Registration" ) ?;
8181
8282 let mut cip36_key_registration = Cip36KeyRegistration :: default ( ) ;
@@ -85,24 +85,24 @@ impl Decode<'_, ProblemReport> for Cip36KeyRegistration {
8585 let mut found_keys: Vec < Cip36KeyRegistrationKeys > = Vec :: new ( ) ;
8686
8787 for index in 0 ..map_len {
88- let key: u16 = decode_helper ( d, "key in CIP36 Key Registration" , ctx ) ?;
88+ let key: u16 = decode_helper ( d, "key in CIP36 Key Registration" , err_report ) ?;
8989
9090 if let Some ( key) = Cip36KeyRegistrationKeys :: from_repr ( key) {
91- if check_is_key_exist ( & found_keys, & key, index, ctx ) {
91+ if check_is_key_exist ( & found_keys, & key, index, err_report ) {
9292 continue ;
9393 }
9494 match key {
9595 Cip36KeyRegistrationKeys :: VotingKey => {
96- let ( is_cip36, voting_keys) = decode_voting_key ( d, ctx ) ?;
96+ let ( is_cip36, voting_keys) = decode_voting_key ( d, err_report ) ?;
9797 cip36_key_registration. is_cip36 = is_cip36;
9898 cip36_key_registration. voting_pks = voting_keys;
9999 } ,
100100 Cip36KeyRegistrationKeys :: StakePk => {
101- let stake_pk = decode_stake_pk ( d, ctx ) ?;
101+ let stake_pk = decode_stake_pk ( d, err_report ) ?;
102102 cip36_key_registration. stake_pk = stake_pk;
103103 } ,
104104 Cip36KeyRegistrationKeys :: PaymentAddr => {
105- let shelley_addr = decode_payment_addr ( d, ctx ) ?;
105+ let shelley_addr = decode_payment_addr ( d, err_report ) ?;
106106 cip36_key_registration. is_payable = shelley_addr
107107 . as_ref ( )
108108 . map ( |addr| !addr. payment ( ) . is_script ( ) )
@@ -130,7 +130,7 @@ impl Decode<'_, ProblemReport> for Cip36KeyRegistration {
130130
131131 for key in & required_keys {
132132 if !found_keys. contains ( key) {
133- ctx . missing_field (
133+ err_report . missing_field (
134134 & format ! ( "{key:?}" ) ,
135135 "Missing required key in CIP36 Key Registration" ,
136136 ) ;
0 commit comments