Skip to content

Commit

Permalink
Actually default to none policy (#2921)
Browse files Browse the repository at this point in the history
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
nambrot authored Nov 21, 2023
1 parent 874f366 commit 4370b08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rust/agents/relayer/src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl FromRawConf<RawRelayerSettings> for RelayerSettings {
raw_gas_payment_enforcement_path,
&raw_gas_payment_enforcement,
);
let gas_payment_enforcement = gas_payment_enforcement_parser.into_array_iter().map(|itr| {
let mut gas_payment_enforcement = gas_payment_enforcement_parser.into_array_iter().map(|itr| {
itr.filter_map(|policy| {
let policy_type = policy.chain(&mut err).get_opt_key("type").parse_string().end();
let minimum_is_defined = matches!(policy.get_opt_key("minimum"), Ok(Some(_)));
Expand Down Expand Up @@ -187,7 +187,11 @@ impl FromRawConf<RawRelayerSettings> for RelayerSettings {
matching_list,
})
}).collect_vec()
}).unwrap_or_else(|_| vec![GasPaymentEnforcementConf::default()]);
}).unwrap_or_default();

if gas_payment_enforcement.is_empty() {
gas_payment_enforcement.push(GasPaymentEnforcementConf::default());
}

let whitelist = p
.chain(&mut err)
Expand Down

0 comments on commit 4370b08

Please sign in to comment.