Skip to content

Commit 5cb9ab1

Browse files
committed
fix: failing validator_worker/lib test
1 parent 140bc51 commit 5cb9ab1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

adapter/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn get_signable_state_root(
4848

4949
pub fn get_balance_leaf(acc: &ValidatorId, amnt: &BigNum) -> Result<[u8; 32], Box<dyn Error>> {
5050
let params = [
51-
(ParamType::Address, &acc.to_string()[..]),
51+
(ParamType::Address, &acc.to_hex_non_prefix_string()[..]),
5252
(ParamType::Uint(256), &amnt.to_str_radix(10)[..]),
5353
];
5454
let encoded = encode_params(&params, true)?;

primitives/src/validator.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ impl ValidatorId {
2828
self.0
2929
}
3030

31+
pub fn to_hex_non_prefix_string(&self) -> String {
32+
hex::encode(self.0)
33+
}
3134
pub fn to_hex_checksummed_string(&self) -> String {
3235
eth_checksum::checksum(&format!("0x{}", hex::encode(self.0)))
3336
}

0 commit comments

Comments
 (0)