-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
It's me, CI
committed
Oct 30, 2023
1 parent
aa58750
commit f7c4c3c
Showing
3 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
src/app/receipt_chain_hash_to_b58/receipt_chain_hash_to_b58.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
open Core_kernel | ||
open Mina_base | ||
|
||
let () = | ||
let s = Stdlib.read_line () in | ||
let fp = Kimchi_backend.Pasta.Basic.Fp.of_string s in | ||
let receipt_chain_hash : Mina_base.Receipt.Chain_hash.t = fp in | ||
Format.printf "%s@." (Mina_base.Receipt.Chain_hash.to_base58_check receipt_chain_hash) | ||
let b58 = | ||
match Receipt.Chain_hash.of_base58_check s with | ||
| Ok _ -> | ||
s | ||
| Error _ -> | ||
let fp = Kimchi_backend.Pasta.Basic.Fp.of_string s in | ||
let receipt_chain_hash : Mina_base.Receipt.Chain_hash.t = fp in | ||
Receipt.Chain_hash.to_base58_check receipt_chain_hash | ||
in | ||
Format.printf "%s@." b58 |