Skip to content

Commit c19ce2c

Browse files
magistauukint-vs
authored andcommitted
fix(pallet-contracts): Add a handler for MemoryGrow.
This error kind was introduced with bb32803 (see #1), but pallet-contracts was not updated after adding it. Note that adding a variant to an public exhaustive enum is a breaking change. See https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new.
1 parent e0bd98a commit c19ce2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

frame/contracts/src/wasm/runtime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ where
409409
// Any other kind of a trap should result in a failure.
410410
Err(sp_sandbox::Error::Execution) | Err(sp_sandbox::Error::OutOfBounds) =>
411411
Err(Error::<E::T>::ContractTrapped)?,
412+
Err(sp_sandbox::Error::MemoryGrow) =>
413+
unreachable!("MemoryGrow returnes by the sandboxed runtime"),
412414
}
413415
}
414416

0 commit comments

Comments
 (0)