From 6676b306b8adf248b4919552a6a3f088b772e3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Leegwater=20Sim=C3=B5es?= Date: Tue, 5 Dec 2023 01:18:31 +0100 Subject: [PATCH] piecrust: upgrade `dusk-wasmtime` to version `15` --- piecrust/CHANGELOG.md | 1 + piecrust/Cargo.toml | 2 +- piecrust/src/instance.rs | 10 ++-------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/piecrust/CHANGELOG.md b/piecrust/CHANGELOG.md index e1b7dd37..d2a907cf 100644 --- a/piecrust/CHANGELOG.md +++ b/piecrust/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Upgrade `dusk-wasmtime` to version `15` - De-instantiate modules after call [#296] - Change `Session::memory_len` to return `Result>`, and not require a contract to be instantiated [#296] diff --git a/piecrust/Cargo.toml b/piecrust/Cargo.toml index e1430f83..75cb10ce 100644 --- a/piecrust/Cargo.toml +++ b/piecrust/Cargo.toml @@ -16,7 +16,7 @@ license = "MPL-2.0" crumbles = { version = "0.3", path = "../crumbles" } piecrust-uplink = { version = "0.8", path = "../piecrust-uplink" } -dusk-wasmtime = { version = "14", default-features = false, features = ["cranelift", "parallel-compilation"] } +dusk-wasmtime = { version = "15", default-features = false, features = ["cranelift", "parallel-compilation"] } bytecheck = "0.6" rkyv = { version = "0.7", features = ["size_32", "validation"] } once_cell = "1.18" diff --git a/piecrust/src/instance.rs b/piecrust/src/instance.rs index 93cf3a8e..ceb3d1c3 100644 --- a/piecrust/src/instance.rs +++ b/piecrust/src/instance.rs @@ -287,17 +287,11 @@ impl WrappedInstance { } pub fn set_remaining_points(&mut self, limit: u64) { - let remaining = self.store.fuel_remaining().expect("Fuel is enabled"); - self.store - .consume_fuel(remaining) - .expect("Consuming all fuel should succeed"); - self.store - .add_fuel(limit) - .expect("Adding fuel should succeed"); + self.store.set_fuel(limit).expect("Fuel is enabled"); } pub fn get_remaining_points(&mut self) -> u64 { - self.store.fuel_remaining().expect("Fuel should be enabled") + self.store.get_fuel().expect("Fuel is enabled") } pub fn is_function_exported>(&mut self, name: N) -> bool {