Skip to content

Commit 8d15eaf

Browse files
committed
seth (test): add tests for --from-fix and --to-fix
1 parent 4d2a612 commit 8d15eaf

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/dapp-tests/integration/tests.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,46 @@ test-lookup-address2() {
370370
= $(seth lookup-address 0x49c92f2ce8f876b070b114a6b2f8a60b83c281ad --rpc-url=$ETH_RPC_URL) ]] || error
371371
}
372372
test-lookup-address2
373+
374+
# SETH FIXED POINT TESTS
375+
# seth --from-fix
376+
test-from-fix1() {
377+
[[ $(seth --from-fix 6 1) = 1000000 ]] || error
378+
}
379+
test-from-fix1
380+
381+
test-from-fix2() {
382+
[[ $(seth --from-fix 18 1) = 1000000000000000000 ]] || error
383+
}
384+
test-from-fix2
385+
386+
test-from-fix3() {
387+
[[ $(seth --from-fix 6 1.2345) = 1234500 ]] || error
388+
}
389+
test-from-fix3
390+
391+
test-from-fix4() {
392+
[[ $(seth --from-fix 18 1.23456789) = 1234567890000000000 ]] || error
393+
}
394+
test-from-fix4
395+
396+
# seth --to-fix
397+
test-to-fix1() {
398+
[[ $(seth --to-fix 6 1000000) = 1.000000 ]] || error
399+
}
400+
test-to-fix1
401+
402+
test-to-fix2() {
403+
[[ $(seth --to-fix 18 1000000000000000000) = 1.000000000000000000 ]] || error
404+
}
405+
test-to-fix2
406+
407+
test-to-fix3() {
408+
[[ $(seth --to-fix 6 1234500) = 1.234500 ]] || error
409+
}
410+
test-to-fix3
411+
412+
test-to-fix4() {
413+
[[ $(seth --to-fix 18 1234567890000000000) = 1.234567890000000000 ]] || error
414+
}
415+
test-to-fix4

0 commit comments

Comments
 (0)