Skip to content

Commit 5c081f7

Browse files
Add the 'current_txn_index' method to the RegistrationChain type (#409)
1 parent 9d22cc1 commit 5c081f7

File tree

1 file changed

+8
-3
lines changed
  • rust/rbac-registration/src/registration/cardano

1 file changed

+8
-3
lines changed

rust/rbac-registration/src/registration/cardano/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{
99

1010
use anyhow::{bail, Context};
1111
use c509_certificate::c509::C509;
12-
use cardano_blockchain_types::{Point, StakeAddress, TransactionId};
12+
use cardano_blockchain_types::{Point, StakeAddress, TransactionId, TxnIndex};
1313
use catalyst_types::{
1414
catalyst_id::{key_rotation::KeyRotation, role_index::RoleId, CatalystId},
1515
conversion::zero_out_last_n_bytes,
@@ -89,13 +89,18 @@ impl RegistrationChain {
8989
*self.inner.current_tx_id_hash.data()
9090
}
9191

92-
/// Returns a point (slot and transaction index) of the latest transaction in the
93-
/// registration chain.
92+
/// Returns a point (slot) of the latest transaction in the registration chain.
9493
#[must_use]
9594
pub fn current_point(&self) -> &Point {
9695
self.inner.current_tx_id_hash.point()
9796
}
9897

98+
/// Returns an index of the latest transaction in the registration chain.
99+
#[must_use]
100+
pub fn current_txn_index(&self) -> TxnIndex {
101+
self.inner.current_tx_id_hash.txn_index()
102+
}
103+
99104
/// Get a list of purpose for this registration chain.
100105
#[must_use]
101106
pub fn purpose(&self) -> &[UuidV4] {

0 commit comments

Comments
 (0)