From 3a5f09ff67d8b4387395c52131538be0de19ae30 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Wed, 11 Oct 2023 00:32:08 +0300 Subject: [PATCH] meta - OutputContractBuilder default fix --- .../src/cmd/contract/output_contract/oc_builder.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/framework/meta/src/cmd/contract/output_contract/oc_builder.rs b/framework/meta/src/cmd/contract/output_contract/oc_builder.rs index d0a779de19..5f5a8dd24a 100644 --- a/framework/meta/src/cmd/contract/output_contract/oc_builder.rs +++ b/framework/meta/src/cmd/contract/output_contract/oc_builder.rs @@ -57,25 +57,26 @@ impl OutputContractBuilder { multiversx_sc::external_view_contract::external_view_contract_constructor_abi(), ) } + let default = OutputContractBuilder::default(); ( contract_id.clone(), OutputContractBuilder { contract_id: contract_id.clone(), - explicit_name: cms.name.clone().unwrap_or_default(), - add_unlabelled: cms.add_unlabelled.unwrap_or_default(), + explicit_name: cms.name.clone().unwrap_or(default.explicit_name), + add_unlabelled: cms.add_unlabelled.unwrap_or(default.add_unlabelled), add_labels: cms.add_labels.iter().cloned().collect(), add_endpoints: cms.add_endpoints.iter().cloned().collect(), collected_endpoints, settings: OutputContractSettings { - external_view: cms.external_view.unwrap_or_default(), - panic_message: cms.panic_message.unwrap_or_default(), + external_view: cms.external_view.unwrap_or(default.settings.external_view), + panic_message: cms.panic_message.unwrap_or(default.settings.panic_message), check_ei: parse_check_ei(&cms.ei), allocator: parse_allocator(&cms.allocator), stack_size: parse_stack_size(&cms.stack_size), features: cms.features.clone(), kill_legacy_callback: cms.kill_legacy_callback, }, - ..Default::default() + ..default }, ) }