Skip to content

Commit 37d336e

Browse files
authored
Contracts: Update read_sandbox (paritytech#1390)
* Update runtime.rs * Fix * Revert "Update runtime.rs" This reverts commit 808f026. * nit mono-repo fixes
1 parent 3e3a998 commit 37d336e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

substrate/frame/contracts/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn get_latest_version() -> u16 {
5353
fn main() -> Result<(), Box<dyn std::error::Error>> {
5454
let out_dir = std::env::var("OUT_DIR")?;
5555
let path = std::path::Path::new(&out_dir).join("migration_codegen.rs");
56-
let mut f = std::fs::File::create(&path)?;
56+
let mut f = std::fs::File::create(path)?;
5757
let version = get_latest_version();
5858
write!(
5959
f,

substrate/frame/contracts/src/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,9 @@ where
564564
{
565565
let fixture_path = [
566566
// When `CARGO_MANIFEST_DIR` is not set, Rust resolves relative paths from the root folder
567-
std::env::var("CARGO_MANIFEST_DIR").as_deref().unwrap_or("frame/contracts"),
567+
std::env::var("CARGO_MANIFEST_DIR")
568+
.as_deref()
569+
.unwrap_or("substrate/frame/contracts"),
568570
"/fixtures/",
569571
fixture_name,
570572
".wat",

substrate/frame/contracts/src/wasm/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ impl<'a, E: Ext + 'a> Runtime<'a, E> {
608608
let mut bound_checked = memory
609609
.get(ptr..ptr + D::max_encoded_len() as usize)
610610
.ok_or_else(|| Error::<E::T>::OutOfBounds)?;
611-
let decoded = D::decode_all_with_depth_limit(MAX_DECODE_NESTING, &mut bound_checked)
611+
let decoded = D::decode_with_depth_limit(MAX_DECODE_NESTING, &mut bound_checked)
612612
.map_err(|_| DispatchError::from(Error::<E::T>::DecodingFailed))?;
613613
Ok(decoded)
614614
}

0 commit comments

Comments
 (0)