From b4f9be733d51f7a1378e228e7a3ce152fcee5a79 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Thu, 29 Aug 2019 16:27:48 +0200 Subject: [PATCH] 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 --- src/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.rs b/src/build.rs index 65846b0..e19f30d 100644 --- a/src/build.rs +++ b/src/build.rs @@ -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)?;