From 56b491a8258b4e6b019daf44b50f66c14dc6b00c Mon Sep 17 00:00:00 2001 From: Michael Birch Date: Thu, 24 Jun 2021 13:38:37 +0000 Subject: [PATCH 1/2] Remove some needless borrows --- src/precompiles/modexp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/precompiles/modexp.rs b/src/precompiles/modexp.rs index c1be8dbc8..0b56a38ba 100644 --- a/src/precompiles/modexp.rs +++ b/src/precompiles/modexp.rs @@ -94,7 +94,7 @@ impl Precompile for ModExp { let (base_len, exp_len, mod_len) = parse_lengths(input); let mul = Self::mul_complexity(core::cmp::max(mod_len, base_len)); - let iter_count = Self::calc_iter_count(exp_len, base_len, &input); + let iter_count = Self::calc_iter_count(exp_len, base_len, input); // mul * iter_count bounded by 2^195 < 2^256 (no overflow) let gas = mul * core::cmp::max(iter_count, U256::one()) / U256::from(20); @@ -134,7 +134,7 @@ impl Precompile for ModExp { let (base_len, exp_len, mod_len) = parse_lengths(input); let mul = Self::mul_complexity(base_len, mod_len); - let iter_count = Self::calc_iter_count(exp_len, base_len, &input); + let iter_count = Self::calc_iter_count(exp_len, base_len, input); // mul * iter_count bounded by 2^189 (so no overflow) let gas = mul * iter_count / U256::from(3); From c697a05fdc79f874a908a74733efd3338c8bcb8e Mon Sep 17 00:00:00 2001 From: Michael Birch Date: Thu, 24 Jun 2021 13:44:24 +0000 Subject: [PATCH 2/2] Fix scheduled lints workflow --- .github/workflows/scheduled_lints.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_lints.yml b/.github/workflows/scheduled_lints.yml index 690165215..52918b251 100644 --- a/.github/workflows/scheduled_lints.yml +++ b/.github/workflows/scheduled_lints.yml @@ -17,8 +17,9 @@ jobs: toolchain: nightly override: true components: clippy + - run: make etc/eth-contracts/res/EvmErc20.bin - name: Run cargo clippy uses: actions-rs/cargo@v1 with: command: clippy - args: --no-default-features --features=contract -- -D warnings + args: --no-default-features --features=mainnet -- -D warnings