This commit is contained in:
swrup 2026-02-21 23:40:58 +01:00
parent 283ad65a10
commit 3297a8f4ee
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ b="/tmp/b.json"
url="http://localhost:3434" url="http://localhost:3434"
auditor_pub=$(<"./test/auditor_public_key") auditor_pub=$(<"./test/auditor_public_key")
master_key="./default/master_offline_private_key" master_key="./default/master_offline_private_key"
zero_euro="EUR:0.0" zero_euro="KUDO:0.0"
offline_tool() { offline_tool() {
dune exec offline -- "$@" > /dev/null dune exec offline -- "$@" > /dev/null

View file

@ -48,16 +48,16 @@ let () =
let () = let () =
let open Amount in let open Amount in
let v = let v =
make ~sign:(Some Sign_plus) ~currency:"EUR" ~value:(Int64.of_int 25) make ~sign:(Some Sign_plus) ~currency:"KUDO" ~value:(Int64.of_int 25)
~fraction:(Int32.of_int 678) ~fraction:(Int32.of_int 678)
|> Result.get_ok |> Result.get_ok
in in
let s = to_string v in let s = to_string v in
let v' = of_string s |> Result.get_ok in let v' = of_string s |> Result.get_ok in
assert (v = v'); assert (v = v');
let r = of_string {|~EUR:4.9|} in let r = of_string {|~KUDO:4.9|} in
assert (Result.is_error r); assert (Result.is_error r);
let r = of_string {|+EUR:4.99999999999999999999999|} in let r = of_string {|+KUDO:4.99999999999999999999999|} in
assert (Result.is_error r); assert (Result.is_error r);
() ()