Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a default gas policy #2830

Merged
merged 6 commits into from
Nov 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions rust/agents/relayer/src/msg/gas_payment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ pub struct GasPaymentEnforcer {
}

impl GasPaymentEnforcer {
pub fn new(
policy_configs: impl IntoIterator<Item = GasPaymentEnforcementConf>,
db: HyperlaneRocksDB,
) -> Self {
pub fn new(policy_configs: Vec<GasPaymentEnforcementConf>, db: HyperlaneRocksDB) -> Self {
nambrot marked this conversation as resolved.
Show resolved Hide resolved
if policy_configs.len() == 0 {
nambrot marked this conversation as resolved.
Show resolved Hide resolved
return Self {
policies: vec![(Box::new(GasPaymentPolicyNone), MatchingList::default())],
db,
};
}
let policies = policy_configs
.into_iter()
.map(|cfg| {
Expand Down
Loading