Skip to content

Commit

Permalink
Contracts: Update read_sandbox (#1390)
Browse files Browse the repository at this point in the history
* Update runtime.rs

* Fix

* Revert "Update runtime.rs"

This reverts commit 808f026.

* nit mono-repo fixes
  • Loading branch information
pgherveou authored and Daanvdplas committed Sep 11, 2023
1 parent 620ff96 commit d14f1d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion substrate/frame/contracts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn get_latest_version() -> u16 {
fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = std::env::var("OUT_DIR")?;
let path = std::path::Path::new(&out_dir).join("migration_codegen.rs");
let mut f = std::fs::File::create(&path)?;
let mut f = std::fs::File::create(path)?;
let version = get_latest_version();
write!(
f,
Expand Down
4 changes: 3 additions & 1 deletion substrate/frame/contracts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ where
{
let fixture_path = [
// When `CARGO_MANIFEST_DIR` is not set, Rust resolves relative paths from the root folder
std::env::var("CARGO_MANIFEST_DIR").as_deref().unwrap_or("frame/contracts"),
std::env::var("CARGO_MANIFEST_DIR")
.as_deref()
.unwrap_or("substrate/frame/contracts"),
"/fixtures/",
fixture_name,
".wat",
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/contracts/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ impl<'a, E: Ext + 'a> Runtime<'a, E> {
let mut bound_checked = memory
.get(ptr..ptr + D::max_encoded_len() as usize)
.ok_or_else(|| Error::<E::T>::OutOfBounds)?;
let decoded = D::decode_all_with_depth_limit(MAX_DECODE_NESTING, &mut bound_checked)
let decoded = D::decode_with_depth_limit(MAX_DECODE_NESTING, &mut bound_checked)
.map_err(|_| DispatchError::from(Error::<E::T>::DecodingFailed))?;
Ok(decoded)
}
Expand Down

0 comments on commit d14f1d3

Please sign in to comment.