Skip to content

Commit 91ed66f

Browse files
committed
feat(client): add test for offset
1 parent 79163b3 commit 91ed66f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/client/src/precompiles/bls12.rs

+10
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ mod tests {
9696
use super::*;
9797
use alloc::vec;
9898

99+
#[test]
100+
fn test_fpvm_bls12_offset() {
101+
let input = Bytes::from(vec![0u8; INPUT_LENGTH + 1]);
102+
let gas_limit = PAIRING_OFFSET_BASE;
103+
let err = PrecompileError::Other(
104+
"Pairing input length should be multiple of 384, was 385".to_string(),
105+
);
106+
assert_eq!(fpvm_bls12_pairing(&input, gas_limit), Err(err.into()));
107+
}
108+
99109
#[test]
100110
fn test_fpvm_bls12_out_of_gas() {
101111
let input = Bytes::from(vec![0u8; INPUT_LENGTH * 2]);

0 commit comments

Comments
 (0)