diff --git a/crates/client/src/lib.rs b/crates/client/src/lib.rs index 481fc236..55f34188 100644 --- a/crates/client/src/lib.rs +++ b/crates/client/src/lib.rs @@ -10,7 +10,7 @@ pub use prism_common::{ operation::{ServiceChallenge, ServiceChallengeInput, SignatureBundle}, transaction::{Transaction, TransactionError, UnsignedTransaction}, }; -pub use prism_keys::{Signature, SigningKey, VerifyingKey}; +pub use prism_keys::{CryptoAlgorithm, Signature, SigningKey, VerifyingKey}; pub use prism_serde::binary; #[cfg(feature = "mockall")] diff --git a/crates/common/src/api/mock.rs b/crates/common/src/api/mock.rs index c28bfd6b..7320f131 100644 --- a/crates/common/src/api/mock.rs +++ b/crates/common/src/api/mock.rs @@ -26,7 +26,7 @@ impl MockPrismPendingTransaction { } #[async_trait] -impl PendingTransaction for MockPrismPendingTransaction { +impl PendingTransaction<'_> for MockPrismPendingTransaction { type Timer = MockPrismTimer; async fn wait_with_interval(&self, _: Duration) -> Result { diff --git a/crates/common/src/api/mod.rs b/crates/common/src/api/mod.rs index 25dddccb..a3fb72fa 100644 --- a/crates/common/src/api/mod.rs +++ b/crates/common/src/api/mod.rs @@ -184,7 +184,7 @@ pub trait PrismApiTimer { const DEFAULT_POLLING_INTERVAL: Duration = Duration::from_secs(5); #[async_trait] -pub trait PendingTransaction +pub trait PendingTransaction<'a> where Self: Send + Sync, { @@ -215,7 +215,7 @@ where } #[async_trait] -impl

PendingTransaction for PendingTransactionImpl<'_, P> +impl<'a, P> PendingTransaction<'a> for PendingTransactionImpl<'a, P> where P: PrismApi, { diff --git a/crates/common/src/api/noop.rs b/crates/common/src/api/noop.rs index 052aad65..04a87462 100644 --- a/crates/common/src/api/noop.rs +++ b/crates/common/src/api/noop.rs @@ -16,7 +16,7 @@ impl PrismApiTimer for NoopTimer { pub struct NoopPendingTransaction; #[async_trait] -impl PendingTransaction for NoopPendingTransaction { +impl PendingTransaction<'_> for NoopPendingTransaction { type Timer = NoopTimer; async fn wait_with_interval(&self, _: Duration) -> Result { diff --git a/crates/common/src/builder.rs b/crates/common/src/builder.rs index 6a18bc12..213428ee 100644 --- a/crates/common/src/builder.rs +++ b/crates/common/src/builder.rs @@ -367,7 +367,7 @@ where pub async fn send( self, - ) -> Result + 'a, PrismApiError> { + ) -> Result, PrismApiError> { let Some(prism) = self.prism else { return Err(TransactionError::MissingSender.into()); }; diff --git a/crates/common/src/transaction.rs b/crates/common/src/transaction.rs index e79da21f..c79d3a2a 100644 --- a/crates/common/src/transaction.rs +++ b/crates/common/src/transaction.rs @@ -1,6 +1,9 @@ -use std::fmt::{Display, Formatter}; +use std::{ + error::Error, + fmt::{Display, Formatter}, +}; -use anyhow::{anyhow, Result}; +use anyhow::Result; use celestia_types::Blob; use prism_keys::{Signature, SigningKey, VerifyingKey}; use prism_serde::binary::{FromBinary, ToBinary}; @@ -118,8 +121,4 @@ impl Display for TransactionError { } } -impl From for anyhow::Error { - fn from(error: TransactionError) -> Self { - anyhow!(error.to_string()) - } -} +impl Error for TransactionError {} diff --git a/crates/keys/src/verifying_keys.rs b/crates/keys/src/verifying_keys.rs index 4160e763..0b2fe060 100644 --- a/crates/keys/src/verifying_keys.rs +++ b/crates/keys/src/verifying_keys.rs @@ -76,11 +76,11 @@ impl VerifyingKey { /// Returns the byte representation of the public key. pub fn to_bytes(&self) -> Vec { match self { - VerifyingKey::Ed25519(vk) => vk.to_bytes().to_vec(), - VerifyingKey::Secp256k1(vk) => vk.to_sec1_bytes().to_vec(), - VerifyingKey::Secp256r1(vk) => vk.to_sec1_bytes().to_vec(), - VerifyingKey::Eip191(vk) => vk.to_sec1_bytes().to_vec(), - VerifyingKey::CosmosAdr36(vk) => vk.to_sec1_bytes().to_vec(), + VerifyingKey::Ed25519(vk) => vk.as_bytes().to_vec(), + VerifyingKey::Secp256k1(vk) => vk.to_encoded_point(true).as_bytes().to_vec(), + VerifyingKey::Secp256r1(vk) => vk.to_encoded_point(true).as_bytes().to_vec(), + VerifyingKey::Eip191(vk) => vk.to_encoded_point(true).as_bytes().to_vec(), + VerifyingKey::CosmosAdr36(vk) => vk.to_encoded_point(true).as_bytes().to_vec(), } } diff --git a/elf/riscv32im-succinct-zkvm-elf b/elf/riscv32im-succinct-zkvm-elf index 2691d6d8..2c431560 100755 Binary files a/elf/riscv32im-succinct-zkvm-elf and b/elf/riscv32im-succinct-zkvm-elf differ