Skip to content

Commit d2297aa

Browse files
committed
Fix ed25519_batch gas calculation
1 parent 2fad356 commit d2297aa

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/vm/src/imports.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Import implementations
22
3-
use std::cmp::max;
43
use std::marker::PhantomData;
54

65
use cosmwasm_crypto::{
@@ -737,12 +736,7 @@ pub fn do_ed25519_batch_verify<
737736
} else {
738737
&data.gas_config.ed25519_batch_verify_cost
739738
};
740-
let gas_info = GasInfo::with_cost(max(
741-
// charge for each signature
742-
gas_cost.total_cost(signatures.len() as u64),
743-
// but ensure we charge something even if there are no signatures
744-
data.gas_config.ed25519_verify_cost,
745-
));
739+
let gas_info = GasInfo::with_cost(gas_cost.total_cost(signatures.len() as u64));
746740
process_gas_info(data, &mut store, gas_info)?;
747741
let result = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys);
748742
let code = match result {

0 commit comments

Comments
 (0)