Skip to content

Commit 7ea437b

Browse files
committed
primitives - ValidatorId to_address & as_bytes
1 parent 98790b5 commit 7ea437b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

primitives/src/validator.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ impl fmt::Debug for ValidatorId {
1616
}
1717

1818
impl ValidatorId {
19+
pub fn as_bytes(&self) -> &[u8; 20] {
20+
self.0.as_bytes()
21+
}
22+
23+
pub fn to_address(&self) -> Address {
24+
self.0
25+
}
26+
1927
pub fn inner(&self) -> &[u8; 20] {
2028
&self.0.as_bytes()
2129
}

0 commit comments

Comments
 (0)