Skip to content

Commit 795277a

Browse files
authored
feat(multicall): add CallItem to dynamic builder (#2307)
1 parent 9ca4e9b commit 795277a

File tree

1 file changed

+14
-0
lines changed
  • crates/provider/src/provider/multicall

1 file changed

+14
-0
lines changed

Diff for: crates/provider/src/provider/multicall/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ where
177177
self
178178
}
179179

180+
/// Add a dynamic [`CallItem`] to the builder
181+
pub fn add_call_dynamic(mut self, call: CallItem<D>) -> Self {
182+
self.calls.push(call.to_call3_value());
183+
self
184+
}
185+
180186
/// Extend the builder with a sequence of calls
181187
pub fn extend(
182188
mut self,
@@ -187,6 +193,14 @@ where
187193
}
188194
self
189195
}
196+
197+
/// Extend the builder with a sequence of [`CallItem`]s
198+
pub fn extend_calls(mut self, calls: impl IntoIterator<Item = CallItem<D>>) -> Self {
199+
for call in calls {
200+
self = self.add_call_dynamic(call);
201+
}
202+
self
203+
}
190204
}
191205

192206
impl<T, P, N> MulticallBuilder<T, &P, N>

0 commit comments

Comments
 (0)