Skip to content

Commit c964961

Browse files
mriiseshamb0
authored andcommitted
Add ripemd160 precompile test (filecoin-project#651)
1 parent be8d4ec commit c964961

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

actors/evm/src/interpreter/precompiles.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,18 @@ mod tests {
322322
assert_eq!(&res, &expected);
323323
}
324324

325+
#[test]
326+
fn ripemd160() {
327+
use super::ripemd160 as hash;
328+
let input = "foo bar baz boxy".as_bytes();
329+
330+
let rt = MockRuntime::default();
331+
332+
let expected = hex!("4cd7a0452bd3d682e4cbd5fa90f446d7285b156a");
333+
let res = hash(&rt, input).unwrap();
334+
assert_eq!(&res, &expected);
335+
}
336+
325337
// bn tests borrowed from https://github.com/bluealloy/revm/blob/26540bf5b29de6e7c8020c4c1880f8a97d1eadc9/crates/revm_precompiles/src/bn128.rs
326338
mod bn {
327339
use super::MockRuntime;

0 commit comments

Comments
 (0)