Skip to content

Commit

Permalink
fix(pallet-contracts): Add a handler for MemoryGrow.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thecaralice authored and ukint-vs committed Nov 4, 2023
1 parent e0bd98a commit c19ce2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frame/contracts/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ where
// Any other kind of a trap should result in a failure.
Err(sp_sandbox::Error::Execution) | Err(sp_sandbox::Error::OutOfBounds) =>
Err(Error::<E::T>::ContractTrapped)?,
Err(sp_sandbox::Error::MemoryGrow) =>
unreachable!("MemoryGrow returnes by the sandboxed runtime"),
}
}

Expand Down

0 comments on commit c19ce2c

Please sign in to comment.