Preserve "deploy" when optimizing pwasm ctor module

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 #128
This commit is contained in:
Thomas Scholtes
2019-08-29 16:27:48 +02:00
parent 155c7253c3
commit b4f9be733d
+1 -1
View File
@@ -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)?;