diff --git a/.gitignore b/.gitignore index dc480d8..fb7c376 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ test_data_item* node_modules dist /res/gen_bundles/bundle* -bundles.js \ No newline at end of file +bundles.js +.idea \ No newline at end of file diff --git a/src/deep_hash.rs b/src/deep_hash.rs index f2c9719..492978d 100644 --- a/src/deep_hash.rs +++ b/src/deep_hash.rs @@ -12,7 +12,7 @@ use futures::{Stream, TryStream, TryStreamExt}; pub enum DeepHashChunk<'a> { Chunk(Bytes), - Stream(&'a mut Pin>>>), + Stream(&'a mut Pin> + Send>>), Chunks(Vec>), } @@ -60,7 +60,7 @@ pub async fn deep_hash(chunk: DeepHashChunk<'_>) -> Result { } } -#[async_recursion(?Send)] +#[async_recursion] pub async fn deep_hash_chunks( chunks: &mut Vec>, acc: Bytes, diff --git a/src/transaction/bundlr.rs b/src/transaction/bundlr.rs index 4a3b9ed..5ba90d0 100644 --- a/src/transaction/bundlr.rs +++ b/src/transaction/bundlr.rs @@ -18,7 +18,7 @@ use crate::utils::read_offset; enum Data { None, Bytes(Vec), - Stream(Pin>>>), + Stream(Pin> + Send>>), } pub struct BundlrTx { @@ -281,12 +281,9 @@ impl BundlrTx { pub async fn sign(&mut self, signer: &dyn Signer) -> Result<(), BundlrError> { self.signature_type = signer.sig_type(); self.owner = signer.pub_key().to_vec(); - let message = self.get_message().await?; - let sig = signer.sign(message)?; self.signature = sig.to_vec(); - Ok(()) } @@ -321,6 +318,7 @@ mod tests { tokio_test::block_on($e) }; } + #[tokio::test] async fn test_create_sign_verify_load_ed25519() { let path = "./res/test_bundles/test_data_item_ed25519";