Skip to content

Commit

Permalink
Preserve "deploy" when optimizing pwasm ctor module
Browse files Browse the repository at this point in the history
When optimizing the constructor module for a PWasm contract the "deploy" symbol is preserved instead of the "call"
symbol. Before this change `build` would error for PWasm contracts because `pack_instance` would not find the "deploy"
symbol in the optimized contract.

Fixes paritytech#128
  • Loading branch information
Thomas Scholtes committed Aug 29, 2019
1 parent 155c725 commit b4f9be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn build(

if !skip_optimization {
let preserved_exports = match target_runtime {
TargetRuntime::PWasm(_) => vec![target_runtime.symbols().call],
TargetRuntime::PWasm(_) => vec![target_runtime.symbols().create],
TargetRuntime::Substrate(_) => vec![target_runtime.symbols().call, target_runtime.symbols().create],
};
optimize(&mut ctor_module, preserved_exports)?;
Expand Down

0 comments on commit b4f9be7

Please sign in to comment.