Skip to content

Commit

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

Cherry-picks #2921 which got merged into the wrong branch
  • Loading branch information
nambrot authored Dec 14, 2023
1 parent ef2ece3 commit a888cf7
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 a888cf7

Please sign in to comment.