ブロックチェーン Tezos において、ノードの立ち上げやクライアントを使ったインタラクションをOCaml上で実行できるフレームワーク Tezt が爆誕したので試してみる。
Tezos開発者がOCamlでTezosの tezos プロジェクトに内包される形で提供されようとして現在 Merge Request が出ている段階である。
| Aug 18 15:38:43.133 - external_block_validator: initialized | |
| Aug 18 15:38:43.260 - external_block_validator: block validator process started with pid 3093 | |
| Aug 18 15:38:44.027 - external_block_validator: shutting down | |
| Aug 18 15:38:44.035 - external_block_validator: process terminated normally | |
| Aug 18 15:40:14.584 - external_block_validator: initialized | |
| Aug 18 15:40:14.713 - external_block_validator: block validator process started with pid 3726 | |
| Aug 18 15:40:14.722 - external_block_validator: shutting down | |
| Aug 18 15:40:14.726 - external_block_validator: process terminated normally | |
| Aug 18 15:53:56.974 - external_block_validator: initialized | |
| Aug 18 15:53:57.102 - external_block_validator: block validator process started with pid 5518 |
| Require Import List. | |
| Import ListNotations. | |
| Fixpoint list_map {A B:Type} (f : A -> B) (xs : list A) := | |
| match xs with | |
| | [] => [] | |
| | x :: xs => f x :: list_map f xs | |
| end. | |
| Theorem list_map_length : forall (A B: Type) (f: A -> B) xs, |
ブロックチェーン Tezos において、ノードの立ち上げやクライアントを使ったインタラクションをOCaml上で実行できるフレームワーク Tezt が爆誕したので試してみる。
Tezos開発者がOCamlでTezosの tezos プロジェクトに内包される形で提供されようとして現在 Merge Request が出ている段階である。
mube@euler:~/gitlab/tezos/tezos-v7-release$ git log -n 1 --pretty=oneline
51977265590ba5fbd166b921e265fa22bf9f66a6 (HEAD -> v7-release, tag: v7.1, origin/v7-release, origin/latest-release) Changelog: add version 7.1 changesmube@euler:~/gitlab/tezos/tezos-v7-release$ mkdir mockup-base-dir
mube@euler:~/gitlab/tezos/tezos-v7-release$ ./tezos-client --base-dir mockup-base-dir/ list mockup protocols| Require Import Premise. | |
| Fixpoint hash node := | |
| match node with | |
| | Bud None => zerohash | |
| | Bud (Some n) => h 2 (hash n) | |
| | Leaf v => h 0 (hash_of_value v) | |
| | Internal n1 n2 => h 1 (hash n1 ^^ hash n2) | |
| | Extender seg n => hash n ^^ seg | |
| end. |
| open SCaml | |
| type balances = (address, nat) map | |
| type storage = balances | |
| type parameter = | |
| | Activate | |
| | Send of {to_ : address; amount : nat} | |
| let activate addr (balances : balances) = |
| Require Import List. | |
| Import ListNotations. | |
| Lemma fst_injective : forall {A B: Type} (p1 p2: A * B), | |
| fst p1 <> fst p2 -> p1 <> p2. | |
| Proof. | |
| intros A B p1 p2. destruct p1, p2. simpl. intros Ha Hp. | |
| elim Ha. now injection Hp. | |
| Qed. |