From dd5495ee18485e3599f6e6ed194e632d2f7f6144 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 29 Mar 2024 09:27:41 +0100 Subject: [PATCH] feat: update eject template with last features (#113) * feat: update eject template with last features * build: bump dependencies --- templates/eject/src/satellite/Cargo.toml | 4 ++-- templates/eject/src/satellite/src/lib.rs | 28 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/templates/eject/src/satellite/Cargo.toml b/templates/eject/src/satellite/Cargo.toml index 6fbffa3..09ea236 100644 --- a/templates/eject/src/satellite/Cargo.toml +++ b/templates/eject/src/satellite/Cargo.toml @@ -12,7 +12,7 @@ ic-cdk = "0.12.1" ic-cdk-macros = "0.8.1" serde = "1.0.190" serde_cbor = "0.11.2" -junobuild-satellite = "0.0.15-patch.3" -junobuild-macros = "0.0.1" +junobuild-satellite = "0.0.16" +junobuild-macros = "0.0.2" junobuild-utils = "0.0.1" diff --git a/templates/eject/src/satellite/src/lib.rs b/templates/eject/src/satellite/src/lib.rs index b3813da..1786d32 100644 --- a/templates/eject/src/satellite/src/lib.rs +++ b/templates/eject/src/satellite/src/lib.rs @@ -1,9 +1,11 @@ use junobuild_macros::{ - on_delete_asset, on_delete_doc, on_delete_many_assets, on_delete_many_docs, on_set_doc, - on_set_many_docs, on_upload_asset, + assert_delete_asset, assert_delete_doc, assert_set_doc, assert_upload_asset, on_delete_asset, + on_delete_doc, on_delete_many_assets, on_delete_many_docs, on_set_doc, on_set_many_docs, + on_upload_asset, }; use junobuild_satellite::{ - include_satellite, OnDeleteAssetContext, OnDeleteDocContext, OnDeleteManyAssetsContext, + include_satellite, AssertDeleteAssetContext, AssertDeleteDocContext, AssertSetDocContext, + AssertUploadAssetContext, OnDeleteAssetContext, OnDeleteDocContext, OnDeleteManyAssetsContext, OnDeleteManyDocsContext, OnSetDocContext, OnSetManyDocsContext, OnUploadAssetContext, }; @@ -42,4 +44,24 @@ async fn on_delete_many_assets(_context: OnDeleteManyAssetsContext) -> Result<() Ok(()) } +#[assert_set_doc] +fn assert_set_doc(_context: AssertSetDocContext) -> Result<(), String> { + Ok(()) +} + +#[assert_delete_doc] +fn assert_delete_doc(_context: AssertDeleteDocContext) -> Result<(), String> { + Ok(()) +} + +#[assert_upload_asset] +fn assert_upload_asset(_context: AssertUploadAssetContext) -> Result<(), String> { + Ok(()) +} + +#[assert_delete_asset] +fn assert_delete_asset(_context: AssertDeleteAssetContext) -> Result<(), String> { + Ok(()) +} + include_satellite!();