From 8cbce2be34b6fdd2f799f1b921cd59f528ad20f5 Mon Sep 17 00:00:00 2001 From: Bucur David Date: Wed, 5 Jun 2024 17:44:13 +0300 Subject: [PATCH] fix: require fee collector + wegld address if fee value is set --- src/config.rs | 14 ++++++++------ tests/unit_tests.rs | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index 5b4af27..4d32bc1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -83,12 +83,14 @@ pub trait ConfigModule: storage::StorageModule + events::EventsModule { is_ready = false; } - if self.fee_collector().is_empty() { - is_ready = false; - } - - if self.wegld_contract_address().is_empty() { - is_ready = false; + if self.fee_value().get() != BigUint::zero() { + if self.fee_collector().is_empty() { + is_ready = false; + } + + if self.wegld_contract_address().is_empty() { + is_ready = false; + } } if self.relayer().is_empty() { diff --git a/tests/unit_tests.rs b/tests/unit_tests.rs index 922e874..8dde978 100644 --- a/tests/unit_tests.rs +++ b/tests/unit_tests.rs @@ -79,6 +79,8 @@ fn contract_is_ready_test() { assert_eq!(check, false); + bridge_sc.fee_value().set(BigUint::from(10u64)); + bridge_sc .tokens_whitelist() .insert(TokenIdentifier::from(ITHEUM_TOKEN_IDENTIFIER));