Skip to content

Commit

Permalink
📍 adresDüzelt testleri ekle
Browse files Browse the repository at this point in the history
  • Loading branch information
KimlikDAO-bot committed Apr 10, 2024
1 parent 80ef645 commit 8be357c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions ethereum/evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import { hex, hexten } from "../util/çevir";
*/
const adresDüzelt = (adres) => {
if (adres.length != 42 || !adres.startsWith("0x")) return null;
/** @type {string} */
let küçük = adres.slice(2).toLowerCase();
/** @const {string} */
const entropi = keccak256(küçük);
const entropi = keccak256(adres.slice(2).toLowerCase());
/** @type {boolean} */
let büyükVar = false;
/** @type {boolean} */
Expand Down
8 changes: 8 additions & 0 deletions ethereum/test/evm.compiled-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ assertEq(evm.signerAddress(
"728c381e23784ae164794f24bee158b569b20d17200315bcfacc7b6c0daae0601c")),
"0x79883d9acbc4abac6d2d216693f66fcc5a0bcbc1"
);

assertEq(evm.adresDüzelt("0xdDd1AC04c9251B74B0B30A20FC7cb26Eb62b1ddd"),
"0xdDd1AC04c9251B74B0B30A20FC7cb26Eb62b1ddd");

assertEq(evm.adresDüzelt("0xdDd1AC04c9251B74B0B30A20FC7cb26Eb62b1ddd".toLowerCase()),
"0xdDd1AC04c9251B74B0B30A20FC7cb26Eb62b1ddd");

assertEq(evm.adresDüzelt("0xdDd1AC04c9251B74B0B30A20FC7cb26Eb62b1dDd"), null);

0 comments on commit 8be357c

Please sign in to comment.