diff --git a/autonomi/src/client/data/public.rs b/autonomi/src/client/data/public.rs index 35d476be18..eff9f99f89 100644 --- a/autonomi/src/client/data/public.rs +++ b/autonomi/src/client/data/public.rs @@ -177,7 +177,7 @@ impl Client { } // Upload chunks and retry failed uploads up to `RETRY_ATTEMPTS` times. - pub(crate) async fn upload_chunks_with_retries<'a>( + pub async fn upload_chunks_with_retries<'a>( &self, mut chunks: Vec<&'a Chunk>, receipt: &Receipt, diff --git a/autonomi/src/client/vault/key.rs b/autonomi/src/client/vault/key.rs index e452eddfab..c87669907f 100644 --- a/autonomi/src/client/vault/key.rs +++ b/autonomi/src/client/vault/key.rs @@ -39,6 +39,17 @@ pub fn derive_vault_key(evm_sk_hex: &str) -> Result Result { + let signature_bytes = hex::decode(signature_hex) + .map_err(|e| VaultKeyError::FailedToGenerateVaultSecretKey(e.to_string()))?; + + let blst_key = derive_secret_key_from_seed(&signature_bytes)?; + let vault_sk = blst_to_blsttc(&blst_key)?; + + Ok(vault_sk) +} + /// Convert a blst secret key to a blsttc secret key and pray that endianness is the same pub(crate) fn blst_to_blsttc(sk: &BlstSecretKey) -> Result { let sk_bytes = sk.to_bytes();