File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
rust/rbac-registration/src/registration/cardano Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,8 @@ impl RegistrationChainInner {
202202 // Previous transaction ID in the CIP509 should equal to the current transaction ID
203203 // or else it is not a part of the chain
204204 if prv_tx_id == self . current_tx_id_hash {
205- new_inner. current_tx_id_hash = prv_tx_id;
205+ // Update the current transaction ID hash
206+ new_inner. current_tx_id_hash = cip509. txn_hash ( ) ;
206207 } else {
207208 bail ! ( "Invalid previous transaction ID, not a part of this registration chain" ) ;
208209 }
@@ -458,6 +459,12 @@ mod test {
458459 "{:#?}" ,
459460 registration. report( )
460461 ) ;
461- chain. update ( registration) . unwrap ( ) ;
462+ let update = chain. update ( registration) . unwrap ( ) ;
463+
464+ // Current tx hash should updated to RBAC data in block 4
465+ assert_eq ! ( update. current_tx_id_hash( ) . to_string( ) , data. tx_hash) ;
466+ assert ! ( update
467+ . role_data( )
468+ . contains_key( & RoleNumber :: from( data. role) ) ) ;
462469 }
463470}
You can’t perform that action at this time.
0 commit comments