Skip to content

Commit

Permalink
Set a default gas policy (#2830)
Browse files Browse the repository at this point in the history
### Description

When no gas enforcement policy is set, by default, we should apply None

---------

Co-authored-by: Trevor Porter <trkporter@ucdavis.edu>
  • Loading branch information
nambrot and tkporter authored Nov 10, 2023
1 parent 0302a28 commit 87796e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rust/agents/relayer/src/msg/gas_payment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub struct GasPaymentEnforcer {
}

impl GasPaymentEnforcer {
/// Note that `policy_configs` should not be empty. In the settings,
/// a default of vec![GasPaymentEnforcementConf::default()] is used.
pub fn new(
policy_configs: impl IntoIterator<Item = GasPaymentEnforcementConf>,
db: HyperlaneRocksDB,
Expand Down
2 changes: 1 addition & 1 deletion rust/agents/relayer/src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl FromRawConf<RawRelayerSettings> for RelayerSettings {
matching_list,
})
}).collect_vec()
}).unwrap_or_default();
}).unwrap_or_else(|_| vec![GasPaymentEnforcementConf::default()]);

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

0 comments on commit 87796e2

Please sign in to comment.