MCPcopy Create free account
hub / github.com/Commit-Boost/commit-boost-client / bls_pubkey_from_hex

Function bls_pubkey_from_hex

crates/common/src/utils.rs:445–454  ·  view source on GitHub ↗
(hex: &str)

Source from the content-addressed store, hash-verified

443impl<T: TestRandom> TestRandomSeed for T {}
444
445pub fn bls_pubkey_from_hex(hex: &str) -> eyre::Result<BlsPublicKey> {
446 let Ok(bytes) = hex::decode(hex) else {
447 eyre::bail!("invalid hex pubkey: {hex}");
448 };
449
450 let pubkey = BlsPublicKey::deserialize(&bytes)
451 .map_err(|e| eyre::eyre!("invalid hex pubkey: {hex}: {e:?}"))?;
452
453 Ok(pubkey)
454}
455
456#[cfg(test)]
457pub fn bls_pubkey_from_hex_unchecked(hex: &str) -> BlsPublicKey {

Callers 6

newMethod · 0.85
do_get_headerMethod · 0.85
load_from_nimbus_formatFunction · 0.85

Calls 1

deserializeFunction · 0.85

Tested by

no test coverage detected