Skip to content

Commit

Permalink
piecrust: upgrade dusk-wasmtime to version 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Leegwater Simões committed Dec 5, 2023
1 parent f69d2b1 commit 6676b30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions piecrust/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<usize>>`, and not
require a contract to be instantiated [#296]
Expand Down
2 changes: 1 addition & 1 deletion piecrust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 2 additions & 8 deletions piecrust/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<N: AsRef<str>>(&mut self, name: N) -> bool {
Expand Down

0 comments on commit 6676b30

Please sign in to comment.