From 65c6c09f7cd9455046e94d207b3f672b34edbc94 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Wed, 15 Jan 2025 19:47:34 -0700 Subject: [PATCH] add return types to the Rust stable ic types --- canister_templates/stable.wasm | Bin 3141844 -> 3141874 bytes .../src/ic/accept_message.rs | 2 +- .../src/ic/arg_data_raw.rs | 2 +- .../stable_canister_template/src/ic/caller.rs | 2 +- .../src/ic/canister_balance.rs | 2 +- .../src/ic/canister_version.rs | 2 +- .../src/ic/is_controller.rs | 2 +- .../src/ic/method_name.rs | 2 +- .../src/ic/msg_cycles_available.rs | 2 +- .../src/ic/msg_cycles_refunded.rs | 2 +- .../stable_canister_template/src/ic/print.rs | 2 +- .../stable_canister_template/src/ic/reject.rs | 2 +- .../src/ic/reject_code.rs | 2 +- .../src/ic/reject_message.rs | 2 +- .../src/ic/reply_raw.rs | 4 +++- .../src/ic/set_certified_data.rs | 2 +- .../src/ic/stable_b_tree_map_init.rs | 2 +- .../stable_canister_template/src/ic/trap.rs | 4 +++- 18 files changed, 21 insertions(+), 17 deletions(-) diff --git a/canister_templates/stable.wasm b/canister_templates/stable.wasm index 4106cd30a1d5416e8e45a797fc7c21520c1e11c8..6e6c2a8da2a5ad987ffb6086df8f0611705977d2 100644 GIT binary patch delta 8957 zcmb7J30zah*3aA<){u~}1_*T9>}QZq`--7kFB0YpJcz0%{8d zR21|mP(?*6;(~&XR+L2`YH6z#m)5=7x`2qST6e#56Ru(;?|t9(_h-&I^Pe+k&YYQh z!RB+-(lcYlJ zK7lZ-Brik$nTw?3Ve?!R-}p%+PEIWAj1S9--*n@govaUAQLT8EXu3rQY8n}-ziV}E%Be{_kG@Q&GRHb zFGu4?^77VdwC~T?Y?Ut1{OQ`Du9WRn?{%wl+axoqx5_q2cgpsw>)ohqpSoUs#bcYS zQN3NZ-eZgOH_2vct=ksaWsf@bcd}BCU9!!xa%qKZhis#)Tvn^Ttg2FdEiZGgW12LJ z@~&t!T(0IQw@`D?bB$_EK&kJ2*L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hnqiIFFTu$EaM*9_>*-5aaNga91p_^B6>rdj91c|=dFz9e*pv5*-rof diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/accept_message.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/accept_message.rs index 83fac62828..94e6982607 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/accept_message.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/accept_message.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::accept_message; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || accept_message()) + Function::new(ctx, || -> () { accept_message() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/arg_data_raw.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/arg_data_raw.rs index c480aed7e6..70e77b936a 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/arg_data_raw.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/arg_data_raw.rs @@ -2,7 +2,7 @@ use ic_cdk::api::call::arg_data_raw; use rquickjs::{Ctx, Function, Result, TypedArray}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx.clone(), move || { + Function::new(ctx.clone(), move || -> Result> { TypedArray::::new(ctx.clone(), arg_data_raw()) }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/caller.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/caller.rs index 1cb32ae8fc..b53c8da463 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/caller.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/caller.rs @@ -2,7 +2,7 @@ use ic_cdk::api::caller; use rquickjs::{Ctx, Function, Result, TypedArray}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx.clone(), move || { + Function::new(ctx.clone(), move || -> Result> { TypedArray::::new(ctx.clone(), caller().as_slice()) }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_balance.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_balance.rs index 8103e9bed1..a790982188 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_balance.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_balance.rs @@ -2,5 +2,5 @@ use ic_cdk::api::canister_balance128; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || canister_balance128().to_string()) + Function::new(ctx, || -> String { canister_balance128().to_string() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_version.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_version.rs index 60ab8aa24c..ac5f004705 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_version.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/canister_version.rs @@ -2,7 +2,7 @@ use ic_cdk::api::canister_version; use rquickjs::{BigInt, Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx.clone(), move || { + Function::new(ctx.clone(), move || -> Result { BigInt::from_u64(ctx.clone(), canister_version()) }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/is_controller.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/is_controller.rs index 62f6aa2582..1b71a8c16b 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/is_controller.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/is_controller.rs @@ -3,7 +3,7 @@ use ic_cdk::api::is_controller; use rquickjs::{Ctx, Function, Result, TypedArray}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |principal_bytes: TypedArray| { + Function::new(ctx, |principal_bytes: TypedArray| -> bool { let principal = Principal::from_slice(principal_bytes.as_ref()); is_controller(&principal) diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/method_name.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/method_name.rs index 0d3073069a..4d97ed8405 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/method_name.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/method_name.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::method_name; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || method_name()) + Function::new(ctx, || -> String { method_name() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_available.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_available.rs index 8846a4be03..314bea41b5 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_available.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_available.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::msg_cycles_available128; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || msg_cycles_available128().to_string()) + Function::new(ctx, || -> String { msg_cycles_available128().to_string() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_refunded.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_refunded.rs index b19e3cf209..178c95310f 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_refunded.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_refunded.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::msg_cycles_refunded128; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || msg_cycles_refunded128().to_string()) + Function::new(ctx, || -> String { msg_cycles_refunded128().to_string() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/print.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/print.rs index 73f63aa8f2..13c1cc612b 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/print.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/print.rs @@ -2,7 +2,7 @@ use ic_cdk::print; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |message: String| { + Function::new(ctx, |message: String| -> () { print(message); }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject.rs index 891aed3612..1f78667cb9 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::reject; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |message: String| reject(&message)) + Function::new(ctx, |message: String| -> () { reject(&message) }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_code.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_code.rs index 1a24e04e1e..bf50e2521f 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_code.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_code.rs @@ -2,7 +2,7 @@ use ic_cdk::api::call::{reject_code, RejectionCode}; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || { + Function::new(ctx, || -> u32 { let reject_code = reject_code(); match reject_code { diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_message.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_message.rs index ae217c9180..6b7a8ea96b 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_message.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reject_message.rs @@ -2,5 +2,5 @@ use ic_cdk::api::call::reject_message; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, || reject_message()) + Function::new(ctx, || -> String { reject_message() }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reply_raw.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reply_raw.rs index c3a4f5cedd..89dd9c1bc7 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reply_raw.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/reply_raw.rs @@ -2,5 +2,7 @@ use ic_cdk::api::call::reply_raw; use rquickjs::{Ctx, Function, Result, TypedArray}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |bytes: TypedArray| reply_raw(bytes.as_ref())) + Function::new(ctx, |bytes: TypedArray| -> () { + reply_raw(bytes.as_ref()) + }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/set_certified_data.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/set_certified_data.rs index 2b6bb48639..5ef69de79a 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/set_certified_data.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/set_certified_data.rs @@ -2,7 +2,7 @@ use ic_cdk::api::set_certified_data; use rquickjs::{Ctx, Function, Result, TypedArray}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |bytes: TypedArray| { + Function::new(ctx, |bytes: TypedArray| -> () { set_certified_data(bytes.as_ref()) }) } diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_init.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_init.rs index 9beaf2a74e..3071482438 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_init.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_init.rs @@ -4,7 +4,7 @@ use rquickjs::{Ctx, Function, Result}; use crate::{stable_b_tree_map::STABLE_B_TREE_MAPS, MEMORY_MANAGER_REF_CELL}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |memory_id: u8| { + Function::new(ctx, |memory_id: u8| -> () { STABLE_B_TREE_MAPS.with(|stable_b_tree_maps| { let mut stable_b_tree_maps = stable_b_tree_maps.borrow_mut(); diff --git a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/trap.rs b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/trap.rs index b48c3980c9..c6456d4f97 100644 --- a/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/trap.rs +++ b/src/build/stable/commands/compile/wasm_binary/rust/stable_canister_template/src/ic/trap.rs @@ -1,8 +1,10 @@ +// TODO readdress the workarounds below once this issue is resolved: https://github.com/DelSkayn/rquickjs/issues/413 + use ic_cdk::api::trap; use rquickjs::{Ctx, Function, Result}; pub fn get_function(ctx: Ctx) -> Result { - Function::new(ctx, |message: String| cast_trap(message)) + Function::new(ctx, |message: String| -> () { cast_trap(message) }) } /// This function is needed to handle the never type (!) return from trap() in a Function::new closure.