Skip to content

Commit

Permalink
fix: lints
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Jan 29, 2025
1 parent 98b4247 commit 9dbbe9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
19 changes: 8 additions & 11 deletions crates/optimism/src/bls12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@ pub mod pair {
use super::*;

pub const ISTHMUS_MAX_INPUT_SIZE: usize = 235008;
pub const ISTHMUS: PrecompileWithAddress =
PrecompileWithAddress(precompile::u64_to_address(bls12_381::pairing::ADDRESS), |input, gas_limit| {
run_pair(input, gas_limit)
});
pub const ISTHMUS: PrecompileWithAddress = PrecompileWithAddress(
precompile::u64_to_address(bls12_381::pairing::ADDRESS),
|input, gas_limit| run_pair(input, gas_limit),
);

pub fn run_pair(input: &[u8], gas_limit: u64) -> PrecompileResult {
if input.len() > ISTHMUS_MAX_INPUT_SIZE {
return Err(PrecompileError::Other(
"BLS12-381 pairing input is too large".into(),
).into());
return Err(
PrecompileError::Other("BLS12-381 pairing input is too large".into()).into(),
);
}
let input = Bytes::copy_from_slice(input);
bls12_381::pairing::pairing(
&input,
gas_limit,
)
bls12_381::pairing::pairing(&input, gas_limit)
}
}
3 changes: 1 addition & 2 deletions crates/optimism/src/handler/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ impl<CTX, ERROR> OpPrecompileProvider<CTX, ERROR> {
| OpSpecId::REGOLITH
| OpSpecId::CANYON
| OpSpecId::ECOTONE
| OpSpecId::HOLOCENE

| OpSpecId::HOLOCENE,
)) => Self::new(Precompiles::new(spec.into_eth_spec().into())),
OpSpec::Op(OpSpecId::FJORD) => Self::new(fjord()),
OpSpec::Op(OpSpecId::GRANITE) => Self::new(granite()),
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
extern crate alloc as std;

pub mod api;
pub mod bn128;
pub mod bls12;
pub mod bn128;
pub mod context;
pub mod fast_lz;
pub mod handler;
Expand Down

0 comments on commit 9dbbe9b

Please sign in to comment.