Set a default gas policy (#2830)

### Description

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

---------

Co-authored-by: Trevor Porter <trkporter@ucdavis.edu>
typechain11
Nam Chu Hoai 1 year ago committed by GitHub
parent 0302a282bf
commit 87796e2ac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      rust/agents/relayer/src/msg/gas_payment/mod.rs
  2. 2
      rust/agents/relayer/src/settings/mod.rs

@ -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,

@ -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)

Loading…
Cancel
Save