Skip to content

Commit 4d85300

Browse files
committed
add tests
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
1 parent 88c3da9 commit 4d85300

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.hyperledger.besu.nativelib.constantine;
2+
3+
import org.apache.tuweni.bytes.Bytes;
4+
import org.junit.Test;
5+
6+
import java.nio.charset.StandardCharsets;
7+
8+
import static org.junit.Assert.assertEquals;
9+
import static org.junit.Assert.assertNotNull;
10+
import static org.junit.Assert.assertThrows;
11+
12+
public class LibConstantineKeccak256Test {
13+
14+
@Test
15+
public void testKeccakNonimalCase() {
16+
final byte[] inputs = "testKeccak256".getBytes(StandardCharsets.UTF_8);
17+
final byte[] result = LibConstantineKeccak256.keccak256(inputs);
18+
assertEquals(Bytes.wrap(result), Bytes.fromHexString("0xfe8baa653979909c621153b53c973bab3832768b5e77896a5b5944d20d48c7a6"));
19+
}
20+
21+
22+
}

0 commit comments

Comments
 (0)