From b2a09d3edc18cb80953f291ded414baabd1ae23b Mon Sep 17 00:00:00 2001 From: Marco Stronati Date: Mon, 9 Apr 2018 12:33:36 +0200 Subject: [PATCH] Tests: add Op.seed_nonce_revelation --- src/proto_alpha/lib_protocol/test/helpers/op.ml | 9 +++++++++ src/proto_alpha/lib_protocol/test/helpers/op.mli | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index 63156c956..fc638e0e9 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -206,3 +206,12 @@ let double_baking ctxt bh1 bh2 = signature = None ; } ; } + +let seed_nonce_revelation ctxt level nonce = + return + { shell = { branch = Context.branch ctxt } ; + protocol_data = Operation_data { + contents = Single (Seed_nonce_revelation { level ; nonce }) ; + signature = None ; + } ; + } diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.mli b/src/proto_alpha/lib_protocol/test/helpers/op.mli index ec16c9bf2..01f25ed49 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/op.mli @@ -74,3 +74,7 @@ val activation: Context.t -> Signature.Public_key_hash.t -> Blinded_public_key_hash.activation_code -> Operation.packed tzresult Lwt.t + +(** Reveals a seed_nonce that was previously committed at a certain level *) +val seed_nonce_revelation: + Context.t -> Raw_level.t -> Nonce.t -> Operation.packed tzresult Lwt.t