@@ -24,7 +24,7 @@ use pallas::{
2424 minicbor:: { Encode , Encoder } ,
2525 utils:: Bytes ,
2626 } ,
27- ledger:: traverse:: MultiEraTx ,
27+ ledger:: traverse:: MultiEraTxWithRawAuxiliary ,
2828} ;
2929use rbac:: { certs:: C509Cert , role_data:: RoleData } ;
3030use strum:: FromRepr ;
@@ -189,7 +189,7 @@ impl Cip509 {
189189 ///
190190 /// Nothing. IF CIP509 Metadata is found it will be updated in `decoded_metadata`.
191191 pub ( crate ) fn decode_and_validate (
192- decoded_metadata : & DecodedMetadata , txn : & MultiEraTx , raw_aux_data : & RawAuxData ,
192+ decoded_metadata : & DecodedMetadata , txn : & MultiEraTxWithRawAuxiliary , raw_aux_data : & RawAuxData ,
193193 txn_idx : usize ,
194194 ) {
195195 // Get the CIP509 metadata if possible
@@ -297,13 +297,13 @@ impl Cip509 {
297297 /// Transaction inputs hash validation.
298298 /// Must exist and match the hash of the transaction inputs.
299299 fn validate_txn_inputs_hash (
300- & self , txn : & MultiEraTx , validation_report : & mut ValidationReport ,
300+ & self , txn : & MultiEraTxWithRawAuxiliary , validation_report : & mut ValidationReport ,
301301 decoded_metadata : & DecodedMetadata ,
302302 ) -> Option < bool > {
303303 let mut buffer = Vec :: new ( ) ;
304304 let mut e = Encoder :: new ( & mut buffer) ;
305305 match txn {
306- MultiEraTx :: AlonzoCompatible ( tx, _) => {
306+ MultiEraTxWithRawAuxiliary :: AlonzoCompatible ( tx, _) => {
307307 let inputs = tx. transaction_body . inputs . clone ( ) ;
308308 if let Err ( e) = e. array ( inputs. len ( ) as u64 ) {
309309 self . validation_failure (
@@ -324,7 +324,7 @@ impl Cip509 {
324324 }
325325 }
326326 } ,
327- MultiEraTx :: Babbage ( tx) => {
327+ MultiEraTxWithRawAuxiliary :: Babbage ( tx) => {
328328 let inputs = tx. transaction_body . inputs . clone ( ) ;
329329 if let Err ( e) = e. array ( inputs. len ( ) as u64 ) {
330330 self . validation_failure (
@@ -345,7 +345,7 @@ impl Cip509 {
345345 }
346346 }
347347 } ,
348- MultiEraTx :: Conway ( tx) => {
348+ MultiEraTxWithRawAuxiliary :: Conway ( tx) => {
349349 let inputs = tx. transaction_body . inputs . clone ( ) ;
350350 if let Err ( e) = e. array ( inputs. len ( ) as u64 ) {
351351 self . validation_failure (
@@ -398,11 +398,11 @@ impl Cip509 {
398398 /// Also log out the pre-computed hash where the validation signature (99) set to
399399 /// zero.
400400 fn validate_aux (
401- & mut self , txn : & MultiEraTx , validation_report : & mut ValidationReport ,
401+ & mut self , txn : & MultiEraTxWithRawAuxiliary , validation_report : & mut ValidationReport ,
402402 decoded_metadata : & DecodedMetadata ,
403403 ) -> Option < bool > {
404404 match txn {
405- MultiEraTx :: AlonzoCompatible ( tx, _) => {
405+ MultiEraTxWithRawAuxiliary :: AlonzoCompatible ( tx, _) => {
406406 if let pallas:: codec:: utils:: Nullable :: Some ( a) = & tx. auxiliary_data {
407407 let original_aux = a. raw_cbor ( ) ;
408408 let aux_data_hash =
@@ -432,7 +432,7 @@ impl Cip509 {
432432 None
433433 }
434434 } ,
435- MultiEraTx :: Babbage ( tx) => {
435+ MultiEraTxWithRawAuxiliary :: Babbage ( tx) => {
436436 if let pallas:: codec:: utils:: Nullable :: Some ( a) = & tx. auxiliary_data {
437437 let original_aux = a. raw_cbor ( ) ;
438438 let aux_data_hash =
@@ -462,7 +462,7 @@ impl Cip509 {
462462 None
463463 }
464464 } ,
465- MultiEraTx :: Conway ( tx) => {
465+ MultiEraTxWithRawAuxiliary :: Conway ( tx) => {
466466 if let pallas:: codec:: utils:: Nullable :: Some ( a) = & tx. auxiliary_data {
467467 let original_aux = a. raw_cbor ( ) ;
468468 let aux_data_hash =
@@ -535,12 +535,12 @@ impl Cip509 {
535535 /// Validate the stake public key in the certificate with witness set in transaction.
536536 #[ allow( clippy:: too_many_lines) ]
537537 fn validate_stake_public_key (
538- & self , txn : & MultiEraTx , validation_report : & mut ValidationReport ,
538+ & self , txn : & MultiEraTxWithRawAuxiliary , validation_report : & mut ValidationReport ,
539539 decoded_metadata : & DecodedMetadata , txn_idx : usize ,
540540 ) -> Option < bool > {
541541 let mut pk_addrs = Vec :: new ( ) ;
542542 match txn {
543- MultiEraTx :: AlonzoCompatible ( ..) | MultiEraTx :: Babbage ( _) | MultiEraTx :: Conway ( _) => {
543+ MultiEraTxWithRawAuxiliary :: AlonzoCompatible ( ..) | MultiEraTxWithRawAuxiliary :: Babbage ( _) | MultiEraTxWithRawAuxiliary :: Conway ( _) => {
544544 // X509 certificate
545545 if let Some ( x509_certs) = & self . x509_chunks . 0 . x509_certs {
546546 for cert in x509_certs {
@@ -740,7 +740,7 @@ impl Cip509 {
740740 /// Validate the payment key
741741 #[ allow( clippy:: too_many_lines) ]
742742 fn validate_payment_key (
743- & self , txn : & MultiEraTx , validation_report : & mut ValidationReport ,
743+ & self , txn : & MultiEraTxWithRawAuxiliary , validation_report : & mut ValidationReport ,
744744 decoded_metadata : & DecodedMetadata , txn_idx : usize , role_data : & RoleData ,
745745 ) -> Option < bool > {
746746 if let Some ( payment_key) = role_data. payment_key {
@@ -754,7 +754,7 @@ impl Cip509 {
754754 return None ;
755755 }
756756 match txn {
757- MultiEraTx :: AlonzoCompatible ( tx, _) => {
757+ MultiEraTxWithRawAuxiliary :: AlonzoCompatible ( tx, _) => {
758758 // Handle negative payment keys (reference to tx output)
759759 if payment_key < 0 {
760760 let witness = match TxWitness :: new ( & [ txn. clone ( ) ] ) {
@@ -819,7 +819,7 @@ impl Cip509 {
819819 }
820820 return Some ( true ) ;
821821 } ,
822- MultiEraTx :: Babbage ( tx) => {
822+ MultiEraTxWithRawAuxiliary :: Babbage ( tx) => {
823823 // Negative indicates reference to tx output
824824 if payment_key < 0 {
825825 let index = match decremented_index ( payment_key. abs ( ) ) {
@@ -887,7 +887,7 @@ impl Cip509 {
887887 }
888888 return Some ( true ) ;
889889 } ,
890- MultiEraTx :: Conway ( tx) => {
890+ MultiEraTxWithRawAuxiliary :: Conway ( tx) => {
891891 // Negative indicates reference to tx output
892892 if payment_key < 0 {
893893 let index = match decremented_index ( payment_key. abs ( ) ) {
@@ -1025,7 +1025,7 @@ mod tests {
10251025 . expect ( "Failed to decode hex block." )
10261026 }
10271027
1028- fn cip_509_aux_data ( tx : & MultiEraTx < ' _ > ) -> Vec < u8 > {
1028+ fn cip_509_aux_data ( tx : & pallas :: ledger :: traverse :: MultiEraTxWithRawAuxiliary < ' _ > ) -> Vec < u8 > {
10291029 let raw_auxiliary_data = tx
10301030 . as_conway ( )
10311031 . unwrap ( )
@@ -1079,7 +1079,7 @@ mod tests {
10791079 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
10801080 let mut validation_report = ValidationReport :: new ( ) ;
10811081 let conway_block_data = conway_1 ( ) ;
1082- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1082+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
10831083 . expect ( "Failed to decode MultiEraBlock" ) ;
10841084
10851085 let transactions = multi_era_block. txs ( ) ;
@@ -1101,7 +1101,7 @@ mod tests {
11011101 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
11021102 let mut validation_report = ValidationReport :: new ( ) ;
11031103 let conway_block_data = conway_1 ( ) ;
1104- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1104+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
11051105 . expect ( "Failed to decode MultiEraBlock" ) ;
11061106
11071107 let transactions = multi_era_block. txs ( ) ;
@@ -1124,7 +1124,7 @@ mod tests {
11241124 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
11251125 let mut validation_report = ValidationReport :: new ( ) ;
11261126 let conway_block_data = conway_1 ( ) ;
1127- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1127+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
11281128 . expect ( "Failed to decode MultiEraBlock" ) ;
11291129
11301130 let transactions = multi_era_block. txs ( ) ;
@@ -1147,7 +1147,7 @@ mod tests {
11471147 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
11481148 let mut validation_report = ValidationReport :: new ( ) ;
11491149 let conway_block_data = conway_1 ( ) ;
1150- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1150+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
11511151 . expect ( "Failed to decode MultiEraBlock" ) ;
11521152
11531153 let transactions = multi_era_block. txs ( ) ;
@@ -1183,7 +1183,7 @@ mod tests {
11831183 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
11841184 let mut validation_report = ValidationReport :: new ( ) ;
11851185 let conway_block_data = conway_3 ( ) ;
1186- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1186+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
11871187 . expect ( "Failed to decode MultiEraBlock" ) ;
11881188
11891189 let transactions = multi_era_block. txs ( ) ;
@@ -1220,7 +1220,7 @@ mod tests {
12201220 let decoded_metadata = DecodedMetadata ( DashMap :: new ( ) ) ;
12211221 let mut validation_report = ValidationReport :: new ( ) ;
12221222 let conway_block_data = conway_2 ( ) ;
1223- let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlock :: decode ( & conway_block_data)
1223+ let multi_era_block = pallas:: ledger:: traverse:: MultiEraBlockWithRawAuxiliary :: decode ( & conway_block_data)
12241224 . expect ( "Failed to decode MultiEraBlock" ) ;
12251225
12261226 let transactions = multi_era_block. txs ( ) ;
0 commit comments