2017-11-13 17:33:39 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2017-11-13 17:33:39 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-11-30 21:34:22 +04:00
|
|
|
type t = {
|
2017-11-13 17:33:39 +04:00
|
|
|
known_valid: Operation_hash.t list ;
|
|
|
|
pending: Operation_hash.Set.t ;
|
|
|
|
}
|
|
|
|
type mempool = t
|
|
|
|
|
2017-11-30 21:34:22 +04:00
|
|
|
let encoding =
|
|
|
|
let open Data_encoding in
|
|
|
|
conv
|
|
|
|
(fun { known_valid ; pending } -> (known_valid, pending))
|
|
|
|
(fun (known_valid, pending) -> { known_valid ; pending })
|
|
|
|
(obj2
|
|
|
|
(req "known_valid" (dynamic_size (list Operation_hash.encoding)))
|
|
|
|
(req "pending" (dynamic_size Operation_hash.Set.encoding)))
|
2017-11-13 17:33:39 +04:00
|
|
|
|
2017-11-30 21:34:22 +04:00
|
|
|
let empty = {
|
|
|
|
known_valid = [] ;
|
|
|
|
pending = Operation_hash.Set.empty ;
|
|
|
|
}
|