fix(contract): allow 16 calls in multicall (#1934)

This commit is contained in:
Andrey Kuznetsov 2022-12-15 11:47:59 +04:00 committed by GitHub
parent cd19d1a691
commit 5bc9ee73b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -102,6 +102,7 @@
between its right shift operator and standard library numeric types. between its right shift operator and standard library numeric types.
- [#842](https://github.com/gakonst/ethers-rs/issues/842) Add support for I256 types in `parse_units` and `format_units`. - [#842](https://github.com/gakonst/ethers-rs/issues/842) Add support for I256 types in `parse_units` and `format_units`.
Added `twos_complement` function for I256. Added `twos_complement` function for I256.
- [#1934](https://github.com/gakonst/ethers-rs/pull/1934) Allow 16 calls in multicall.
## ethers-contract-abigen ## ethers-contract-abigen

View File

@ -608,7 +608,7 @@ impl<M: Middleware> Multicall<M> {
/// # } /// # }
/// ``` /// ```
pub async fn call<D: Detokenize>(&self) -> Result<D, M> { pub async fn call<D: Detokenize>(&self) -> Result<D, M> {
assert!(self.calls.len() < 16, "Cannot decode more than 16 calls"); assert!(self.calls.len() <= 16, "Cannot decode more than 16 calls");
let tokens = self.call_raw().await?; let tokens = self.call_raw().await?;
let tokens = vec![Token::Tuple(tokens)]; let tokens = vec![Token::Tuple(tokens)];
let data = D::from_tokens(tokens).map_err(ContractError::DetokenizationError)?; let data = D::from_tokens(tokens).map_err(ContractError::DetokenizationError)?;