feat(abigen): add helper for getting number of abigen'd contracts

This commit is contained in:
Georgios Konstantopoulos 2022-03-01 14:39:30 +02:00
parent 556367ecbd
commit 94e2d1b122
1 changed files with 10 additions and 0 deletions

View File

@ -309,6 +309,16 @@ pub struct MultiBindings {
} }
impl MultiBindings { impl MultiBindings {
/// Returns the number of contracts to generate bindings for.
pub fn len(&self) -> usize {
self.expansion.contracts.len()
}
/// Returns whether there are any bindings to be generated
pub fn is_empty(&self) -> bool {
self.expansion.contracts.is_empty()
}
fn into_inner(self, single_file: bool) -> MultiBindingsInner { fn into_inner(self, single_file: bool) -> MultiBindingsInner {
self.expansion.into_bindings(single_file, self.rustfmt) self.expansion.into_bindings(single_file, self.rustfmt)
} }