From f5b2343d60a97833aa3e7f4d28126119aab2fd20 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Wed, 22 Aug 2018 21:26:24 +0800 Subject: [PATCH] Fix errors caused by auto merge. --- cita-executor/core/src/contracts/sys_config.rs | 10 +++++----- cita-executor/core/src/tests/amend_data_test.rs | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cita-executor/core/src/contracts/sys_config.rs b/cita-executor/core/src/contracts/sys_config.rs index a060a3c35..b2912f0ed 100644 --- a/cita-executor/core/src/contracts/sys_config.rs +++ b/cita-executor/core/src/contracts/sys_config.rs @@ -126,22 +126,22 @@ impl<'a> SysConfig<'a> { &[ParamType::Bool], FEE_BACK_PLATFORM_CHECK.as_slice(), Some(BlockId::Latest), - ).remove(0) - .to_bool() + ).ok() + .and_then(|mut x| x.remove(0).to_bool()) .unwrap_or_else(|| false); debug!("check fee back platform: {:?}", check); check } - // The owner of current chain + /// The owner of current chain pub fn chain_owner(&self) -> Address { let chain_owner = self.get_value( &[ParamType::Address], CHAIN_OWNER.as_slice(), Some(BlockId::Latest), - ).remove(0) - .to_address() + ).ok() + .and_then(|mut x| x.remove(0).to_address()) .unwrap_or_else(|| [0u8; 20]); debug!("Get chain owner: {:?}", chain_owner); Address::from(chain_owner) diff --git a/cita-executor/core/src/tests/amend_data_test.rs b/cita-executor/core/src/tests/amend_data_test.rs index 0f235aa1a..b4e956fbc 100644 --- a/cita-executor/core/src/tests/amend_data_test.rs +++ b/cita-executor/core/src/tests/amend_data_test.rs @@ -35,6 +35,8 @@ fn call_vm( &native_factory, false, EconomicalModel::Quota, + false, + Address::from(0), ); let mut out = vec![]; ex.call(