@@ -185,7 +185,7 @@ impl RegistrationChainInner {
185185 txn : & MultiEraTx ,
186186 ) -> anyhow:: Result < Self > {
187187 // Should be chain root, return immediately if not
188- if cip509. prv_tx_id . is_some ( ) {
188+ if cip509. previous_transaction ( ) . is_some ( ) {
189189 bail ! ( "Invalid chain root, previous transaction ID should be None." ) ;
190190 }
191191
@@ -200,9 +200,9 @@ impl RegistrationChainInner {
200200 }
201201
202202 // Add purpose to the list
203- let purpose = vec ! [ cip509. purpose] ;
203+ let purpose = vec ! [ cip509. purpose( ) ] ;
204204
205- let registration = cip509. metadata ;
205+ let registration = cip509. metadata ( ) . clone ( ) ;
206206 let point_tx_idx = PointTxIdx :: new ( point, tx_idx) ;
207207
208208 let certificate_uris = registration. certificate_uris ;
@@ -259,23 +259,23 @@ impl RegistrationChainInner {
259259 }
260260
261261 // Check and update the current transaction ID hash
262- if let Some ( prv_tx_id) = cip509. prv_tx_id {
262+ if let Some ( prv_tx_id) = cip509. previous_transaction ( ) {
263263 // Previous transaction ID in the CIP509 should equal to the current transaction ID
264264 // or else it is not a part of the chain
265- if prv_tx_id == self . current_tx_id_hash {
266- new_inner. current_tx_id_hash = prv_tx_id;
265+ if prv_tx_id == & self . current_tx_id_hash {
266+ new_inner. current_tx_id_hash = prv_tx_id. clone ( ) ;
267267 } else {
268268 bail ! ( "Invalid previous transaction ID, not a part of this registration chain" ) ;
269269 }
270270 }
271271
272272 // Add purpose to the chain, if not already exist
273- let purpose = cip509. purpose ;
273+ let purpose = cip509. purpose ( ) ;
274274 if !self . purpose . contains ( & purpose) {
275275 new_inner. purpose . push ( purpose) ;
276276 }
277277
278- let registration = cip509. metadata ;
278+ let registration = cip509. metadata ( ) . clone ( ) ;
279279 let point_tx_idx = PointTxIdx :: new ( point, tx_idx) ;
280280 new_inner. certificate_uris = new_inner. certificate_uris . update ( & registration) ;
281281 update_x509_certs ( & mut new_inner, registration. x509_certs , & point_tx_idx) ;
0 commit comments