Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 46164a8

Browse files
committed
fix test
1 parent 45415ac commit 46164a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/test/java/ai/elimu/crowdsource/ExampleUnitTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import static org.junit.Assert.assertEquals;
44

55
import org.junit.Test;
6+
import org.web3j.utils.Numeric;
7+
8+
import java.nio.charset.StandardCharsets;
69

710
import ai.elimu.crowdsource.ui.authentication.SignInWithWeb3Activity;
811
import ai.elimu.crowdsource.util.EthersUtils;
@@ -18,7 +21,7 @@ public void web3recover_SanityCheck() {
1821
String signature = "382a3e04daf88f322730f6a2972475fc5646ea8c4a7f3b5e83a90b10ba08a7364cd2f55348f2b6d210fbed7fc485abf19ecb2f3967e410d6349dd7dd1d4487751b";
1922
String message = "0x63f9a92d8d61b48a9fff8d58080425a3012d05c8igwyk4r1o7o";
2023
String digest = "0x438d6abe3d60b1a1f3f1e0c606ba249bc30e221001b9269f96be450c393c2f7c";
21-
assertEquals(EthersUtils.hashMessage(message), digest);
24+
assertEquals(Numeric.toHexString(EthersUtils.hashMessage(message)), digest);
2225
assertEquals(EthersUtils.recoverAddress(EthersUtils.hashMessage(message), signature), "0x63f9a92d8d61b48a9fff8d58080425a3012d05c8");
2326
}
2427
}

0 commit comments

Comments
 (0)