Accuser: add utility functions to forge double_evidence operations

This commit is contained in:
Vincent Botbol 2018-06-25 16:40:07 +02:00
parent 989c0193a1
commit aa95ee8332
2 changed files with 22 additions and 0 deletions

View File

@ -424,6 +424,14 @@ module Forge = struct
block ~branch ~level ~nonce () = block ~branch ~level ~nonce () =
operation ctxt block ~branch (Seed_nonce_revelation { level ; nonce }) operation ctxt block ~branch (Seed_nonce_revelation { level ; nonce })
let double_baking_evidence ctxt
block ~branch ~bh1 ~bh2 () =
operation ctxt block ~branch (Double_baking_evidence { bh1 ; bh2 })
let double_endorsement_evidence ctxt
block ~branch ~op1 ~op2 () =
operation ctxt block ~branch (Double_endorsement_evidence { op1 ; op2 })
let empty_proof_of_work_nonce = let empty_proof_of_work_nonce =
MBytes.of_string MBytes.of_string
(String.make Constants_repr.proof_of_work_nonce_size '\000') (String.make Constants_repr.proof_of_work_nonce_size '\000')

View File

@ -154,6 +154,20 @@ module Forge : sig
nonce:Nonce.t -> nonce:Nonce.t ->
unit -> MBytes.t shell_tzresult Lwt.t unit -> MBytes.t shell_tzresult Lwt.t
val double_baking_evidence:
'a #RPC_context.simple -> 'a ->
branch:Block_hash.t ->
bh1: Block_header.t ->
bh2: Block_header.t ->
unit -> MBytes.t shell_tzresult Lwt.t
val double_endorsement_evidence:
'a #RPC_context.simple -> 'a ->
branch:Block_hash.t ->
op1: Kind.endorsement operation ->
op2: Kind.endorsement operation ->
unit -> MBytes.t shell_tzresult Lwt.t
val protocol_data: val protocol_data:
'a #RPC_context.simple -> 'a -> 'a #RPC_context.simple -> 'a ->
priority: int -> priority: int ->