Skip to content

Commit

Permalink
fix: require fee collector + wegld address if fee value is set
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Jun 5, 2024
1 parent d6c76b5 commit 8cbce2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8cbce2b

Please sign in to comment.