Proto.Mempool
type conflict_handler =
existing_operation:(Mavryk_crypto.Hashed.Operation_hash.t * operation) ->
new_operation:(Mavryk_crypto.Hashed.Operation_hash.t * operation) ->
[ `Keep | `Replace ]
type operation_conflict =
| Operation_conflict of {
existing : Mavryk_crypto.Hashed.Operation_hash.t;
new_operation : Mavryk_crypto.Hashed.Operation_hash.t;
}
type add_result =
| Added
| Replaced of {
removed : Mavryk_crypto.Hashed.Operation_hash.t;
}
| Unchanged
type add_error =
| Validation_error of Mavryk_base.TzPervasives.Error_monad.tztrace
| Add_conflict of operation_conflict
val encoding : t Mavryk_base.TzPervasives.Data_encoding.t
val add_operation :
?check_signature:bool ->
?conflict_handler:conflict_handler ->
validation_info ->
t ->
(Mavryk_crypto.Hashed.Operation_hash.t * operation) ->
(t * add_result, add_error) Stdlib.result Lwt.t
val remove_operation : t -> Mavryk_crypto.Hashed.Operation_hash.t -> t
val merge :
?conflict_handler:conflict_handler ->
t ->
t ->
(t, merge_error) Stdlib.result
val operations : t -> operation Mavryk_crypto.Hashed.Operation_hash.Map.t
val init :
Mavryk_protocol_environment__.Environment_context.Context.t ->
Mavryk_crypto.Hashed.Chain_id.t ->
head_hash:Mavryk_crypto.Hashed.Block_hash.t ->
head:Mavryk_base.TzPervasives.Block_header.shell_header ->
cache:
[ `Force_load
| `Load
| `Lazy
| `Inherited of
Mavryk_protocol_environment__.Environment_context.Context.block_cache
* Mavryk_crypto.Hashed.Context_hash.t ] ->
(validation_info * t) Mavryk_base.TzPervasives.tzresult Lwt.t