Alpha: use singular for Sourced_operation
This commit is contained in:
parent
ee5373d960
commit
25ecd68b90
@ -52,7 +52,7 @@ let transfer (cctxt : #Proto_alpha.full)
|
|||||||
let operations = [Transaction { amount ; parameters ; destination }] in
|
let operations = [Transaction { amount ; parameters ; destination }] in
|
||||||
append_reveal cctxt block ~source ~src_pk operations >>=? fun operations ->
|
append_reveal cctxt block ~source ~src_pk operations >>=? fun operations ->
|
||||||
let contents =
|
let contents =
|
||||||
Sourced_operations
|
Sourced_operation
|
||||||
(Manager_operations { source ; fee ; counter ;
|
(Manager_operations { source ; fee ; counter ;
|
||||||
gas_limit ; operations }) in
|
gas_limit ; operations }) in
|
||||||
Injection.inject_operation cctxt block ?confirmations
|
Injection.inject_operation cctxt block ?confirmations
|
||||||
@ -72,7 +72,7 @@ let reveal cctxt
|
|||||||
| _ :: _ ->
|
| _ :: _ ->
|
||||||
let gas_limit = Z.zero in
|
let gas_limit = Z.zero in
|
||||||
let contents =
|
let contents =
|
||||||
Sourced_operations
|
Sourced_operation
|
||||||
(Manager_operations { source ; fee ; counter ;
|
(Manager_operations { source ; fee ; counter ;
|
||||||
gas_limit ; operations }) in
|
gas_limit ; operations }) in
|
||||||
Injection.inject_operation cctxt block ?confirmations
|
Injection.inject_operation cctxt block ?confirmations
|
||||||
@ -88,7 +88,7 @@ let originate
|
|||||||
append_reveal
|
append_reveal
|
||||||
cctxt block ~source ~src_pk operations >>=? fun operations ->
|
cctxt block ~source ~src_pk operations >>=? fun operations ->
|
||||||
let contents =
|
let contents =
|
||||||
Sourced_operations
|
Sourced_operation
|
||||||
(Manager_operations { source ; fee ; counter ;
|
(Manager_operations { source ; fee ; counter ;
|
||||||
gas_limit ; operations }) in
|
gas_limit ; operations }) in
|
||||||
Injection.inject_operation cctxt block ?confirmations
|
Injection.inject_operation cctxt block ?confirmations
|
||||||
@ -127,7 +127,7 @@ let delegate_contract cctxt
|
|||||||
append_reveal
|
append_reveal
|
||||||
cctxt block ~source ~src_pk operations >>=? fun operations ->
|
cctxt block ~source ~src_pk operations >>=? fun operations ->
|
||||||
let contents =
|
let contents =
|
||||||
Sourced_operations
|
Sourced_operation
|
||||||
(Manager_operations { source ; fee ; counter ;
|
(Manager_operations { source ; fee ; counter ;
|
||||||
gas_limit = Z.zero ; operations }) in
|
gas_limit = Z.zero ; operations }) in
|
||||||
Injection.inject_operation cctxt block ?confirmations
|
Injection.inject_operation cctxt block ?confirmations
|
||||||
@ -173,7 +173,7 @@ let get_manager
|
|||||||
return (src_name, src_pkh, src_pk, src_sk)
|
return (src_name, src_pkh, src_pk, src_sk)
|
||||||
|
|
||||||
let dictate rpc_config block ?confirmations command src_sk =
|
let dictate rpc_config block ?confirmations command src_sk =
|
||||||
let contents = Sourced_operations (Dictator_operation command) in
|
let contents = Sourced_operation (Dictator_operation command) in
|
||||||
Injection.inject_operation
|
Injection.inject_operation
|
||||||
rpc_config block ?confirmations
|
rpc_config block ?confirmations
|
||||||
~src_sk contents >>=? fun res ->
|
~src_sk contents >>=? fun res ->
|
||||||
|
@ -35,7 +35,7 @@ let preapply
|
|||||||
({ branch }, contents) in
|
({ branch }, contents) in
|
||||||
let watermark =
|
let watermark =
|
||||||
match contents with
|
match contents with
|
||||||
| Sourced_operations (Consensus_operation (Endorsements _)) ->
|
| Sourced_operation (Consensus_operation (Endorsements _)) ->
|
||||||
Signature.Endorsement
|
Signature.Endorsement
|
||||||
| _ ->
|
| _ ->
|
||||||
Signature.Generic_operation in
|
Signature.Generic_operation in
|
||||||
@ -92,10 +92,10 @@ let may_patch_gas_limit
|
|||||||
?src_sk contents =
|
?src_sk contents =
|
||||||
Alpha_services.Constants.hard_gas_limits cctxt block >>=? fun (_, gas_limit) ->
|
Alpha_services.Constants.hard_gas_limits cctxt block >>=? fun (_, gas_limit) ->
|
||||||
match contents with
|
match contents with
|
||||||
| Sourced_operations (Manager_operations c)
|
| Sourced_operation (Manager_operations c)
|
||||||
when c.gas_limit < Z.zero || gas_limit < c.gas_limit ->
|
when c.gas_limit < Z.zero || gas_limit < c.gas_limit ->
|
||||||
let contents =
|
let contents =
|
||||||
Sourced_operations (Manager_operations { c with gas_limit }) in
|
Sourced_operation (Manager_operations { c with gas_limit }) in
|
||||||
preapply cctxt block ?branch ?src_sk contents >>=? fun (_, _, result) ->
|
preapply cctxt block ?branch ?src_sk contents >>=? fun (_, _, result) ->
|
||||||
Lwt.return (estimated_gas result) >>=? fun gas ->
|
Lwt.return (estimated_gas result) >>=? fun gas ->
|
||||||
begin
|
begin
|
||||||
@ -108,7 +108,7 @@ let may_patch_gas_limit
|
|||||||
(Z.to_string gas) >>= fun () ->
|
(Z.to_string gas) >>= fun () ->
|
||||||
return (Z.add gas (Z.of_int 100))
|
return (Z.add gas (Z.of_int 100))
|
||||||
end >>=? fun gas_limit ->
|
end >>=? fun gas_limit ->
|
||||||
return (Sourced_operations (Manager_operations { c with gas_limit }))
|
return (Sourced_operation (Manager_operations { c with gas_limit }))
|
||||||
| op -> return op
|
| op -> return op
|
||||||
|
|
||||||
let inject_operation
|
let inject_operation
|
||||||
|
@ -173,7 +173,7 @@ let pp_operation_result ppf ({ contents ; _ }, operation_result) =
|
|||||||
| _, _ -> invalid_arg "Apply_operation_result.pp"
|
| _, _ -> invalid_arg "Apply_operation_result.pp"
|
||||||
in
|
in
|
||||||
Format.pp_print_list pp_anonymous_operation_result ppf ops_rs
|
Format.pp_print_list pp_anonymous_operation_result ppf ops_rs
|
||||||
| Sourced_operations
|
| Sourced_operation
|
||||||
(Consensus_operation
|
(Consensus_operation
|
||||||
(Endorsements { block ; level ; slots })),
|
(Endorsements { block ; level ; slots })),
|
||||||
Sourced_operation_result
|
Sourced_operation_result
|
||||||
@ -192,7 +192,7 @@ let pp_operation_result ppf ({ contents ; _ }, operation_result) =
|
|||||||
~pp_sep:Format.pp_print_space
|
~pp_sep:Format.pp_print_space
|
||||||
Format.pp_print_int)
|
Format.pp_print_int)
|
||||||
slots
|
slots
|
||||||
| Sourced_operations
|
| Sourced_operation
|
||||||
(Amendment_operation { source ; operation = Proposals { period ; proposals } }),
|
(Amendment_operation { source ; operation = Proposals { period ; proposals } }),
|
||||||
Sourced_operation_result Amendment_operation_result ->
|
Sourced_operation_result Amendment_operation_result ->
|
||||||
Format.fprintf ppf
|
Format.fprintf ppf
|
||||||
@ -204,7 +204,7 @@ let pp_operation_result ppf ({ contents ; _ }, operation_result) =
|
|||||||
Signature.Public_key_hash.pp source
|
Signature.Public_key_hash.pp source
|
||||||
Voting_period.pp period
|
Voting_period.pp period
|
||||||
(Format.pp_print_list Protocol_hash.pp) proposals
|
(Format.pp_print_list Protocol_hash.pp) proposals
|
||||||
| Sourced_operations
|
| Sourced_operation
|
||||||
(Amendment_operation { source ; operation = Ballot { period ; proposal ; ballot } }),
|
(Amendment_operation { source ; operation = Ballot { period ; proposal ; ballot } }),
|
||||||
Sourced_operation_result Amendment_operation_result ->
|
Sourced_operation_result Amendment_operation_result ->
|
||||||
Format.fprintf ppf
|
Format.fprintf ppf
|
||||||
@ -217,19 +217,19 @@ let pp_operation_result ppf ({ contents ; _ }, operation_result) =
|
|||||||
Voting_period.pp period
|
Voting_period.pp period
|
||||||
Protocol_hash.pp proposal
|
Protocol_hash.pp proposal
|
||||||
(match ballot with Yay -> "YAY" | Pass -> "PASS" | Nay -> "NAY")
|
(match ballot with Yay -> "YAY" | Pass -> "PASS" | Nay -> "NAY")
|
||||||
| Sourced_operations (Dictator_operation (Activate protocol)),
|
| Sourced_operation (Dictator_operation (Activate protocol)),
|
||||||
Sourced_operation_result Dictator_operation_result ->
|
Sourced_operation_result Dictator_operation_result ->
|
||||||
Format.fprintf ppf
|
Format.fprintf ppf
|
||||||
"@[<v 2>Dictator protocol activation:@,\
|
"@[<v 2>Dictator protocol activation:@,\
|
||||||
Protocol: %a@]"
|
Protocol: %a@]"
|
||||||
Protocol_hash.pp protocol
|
Protocol_hash.pp protocol
|
||||||
| Sourced_operations (Dictator_operation (Activate_testchain protocol)),
|
| Sourced_operation (Dictator_operation (Activate_testchain protocol)),
|
||||||
Sourced_operation_result Dictator_operation_result ->
|
Sourced_operation_result Dictator_operation_result ->
|
||||||
Format.fprintf ppf
|
Format.fprintf ppf
|
||||||
"@[<v 2>Dictator test protocol activation:@,\
|
"@[<v 2>Dictator test protocol activation:@,\
|
||||||
Protocol: %a@]"
|
Protocol: %a@]"
|
||||||
Protocol_hash.pp protocol
|
Protocol_hash.pp protocol
|
||||||
| Sourced_operations (Manager_operations { source ; fee ; counter ; operations ; gas_limit }),
|
| Sourced_operation (Manager_operations { source ; fee ; counter ; operations ; gas_limit }),
|
||||||
Sourced_operation_result (Manager_operations_result { balance_updates ; operation_results }) ->
|
Sourced_operation_result (Manager_operations_result { balance_updates ; operation_results }) ->
|
||||||
let pp_result ppf result =
|
let pp_result ppf result =
|
||||||
Format.fprintf ppf "@," ;
|
Format.fprintf ppf "@," ;
|
||||||
|
@ -717,7 +717,7 @@ type operation = {
|
|||||||
|
|
||||||
and proto_operation =
|
and proto_operation =
|
||||||
| Anonymous_operations of anonymous_operation list
|
| Anonymous_operations of anonymous_operation list
|
||||||
| Sourced_operations of sourced_operations
|
| Sourced_operation of sourced_operation
|
||||||
|
|
||||||
and anonymous_operation =
|
and anonymous_operation =
|
||||||
| Seed_nonce_revelation of {
|
| Seed_nonce_revelation of {
|
||||||
@ -737,7 +737,7 @@ and anonymous_operation =
|
|||||||
secret: Blinded_public_key_hash.secret ;
|
secret: Blinded_public_key_hash.secret ;
|
||||||
}
|
}
|
||||||
|
|
||||||
and sourced_operations =
|
and sourced_operation =
|
||||||
| Consensus_operation of consensus_operation
|
| Consensus_operation of consensus_operation
|
||||||
| Amendment_operation of {
|
| Amendment_operation of {
|
||||||
source: Signature.Public_key_hash.t ;
|
source: Signature.Public_key_hash.t ;
|
||||||
|
@ -608,8 +608,8 @@ let apply_anonymous_operation ctxt _delegate kind =
|
|||||||
return (ctxt, Seed_nonce_revelation_result [(* FIXME *)])
|
return (ctxt, Seed_nonce_revelation_result [(* FIXME *)])
|
||||||
| Double_endorsement_evidence { op1 ; op2 } -> begin
|
| Double_endorsement_evidence { op1 ; op2 } -> begin
|
||||||
match op1.contents, op2.contents with
|
match op1.contents, op2.contents with
|
||||||
| Sourced_operations (Consensus_operation (Endorsements e1)),
|
| Sourced_operation (Consensus_operation (Endorsements e1)),
|
||||||
Sourced_operations (Consensus_operation (Endorsements e2))
|
Sourced_operation (Consensus_operation (Endorsements e2))
|
||||||
when Raw_level.(e1.level = e2.level) &&
|
when Raw_level.(e1.level = e2.level) &&
|
||||||
not (Block_hash.equal e1.block e2.block) ->
|
not (Block_hash.equal e1.block e2.block) ->
|
||||||
let level = Level.from_raw ctxt e1.level in
|
let level = Level.from_raw ctxt e1.level in
|
||||||
@ -709,7 +709,7 @@ let apply_operation
|
|||||||
(ctxt, []) ops
|
(ctxt, []) ops
|
||||||
>>=? fun (ctxt, results) ->
|
>>=? fun (ctxt, results) ->
|
||||||
return (ctxt, Anonymous_operations_result (List.rev results))
|
return (ctxt, Anonymous_operations_result (List.rev results))
|
||||||
| Sourced_operations ops ->
|
| Sourced_operation ops ->
|
||||||
apply_sourced_operation ctxt pred_block block_prio operation ops
|
apply_sourced_operation ctxt pred_block block_prio operation ops
|
||||||
>>=? fun (ctxt, result) ->
|
>>=? fun (ctxt, result) ->
|
||||||
return (ctxt, Sourced_operation_result result)
|
return (ctxt, Sourced_operation_result result)
|
||||||
@ -800,9 +800,9 @@ let finalize_application ctxt protocol_data delegate =
|
|||||||
let compare_operations op1 op2 =
|
let compare_operations op1 op2 =
|
||||||
match op1.contents, op2.contents with
|
match op1.contents, op2.contents with
|
||||||
| Anonymous_operations _, Anonymous_operations _ -> 0
|
| Anonymous_operations _, Anonymous_operations _ -> 0
|
||||||
| Anonymous_operations _, Sourced_operations _ -> -1
|
| Anonymous_operations _, Sourced_operation _ -> -1
|
||||||
| Sourced_operations _, Anonymous_operations _ -> 1
|
| Sourced_operation _, Anonymous_operations _ -> 1
|
||||||
| Sourced_operations op1, Sourced_operations op2 ->
|
| Sourced_operation op1, Sourced_operation op2 ->
|
||||||
match op1, op2 with
|
match op1, op2 with
|
||||||
| Consensus_operation _, (Amendment_operation _ | Manager_operations _ | Dictator_operation _) -> -1
|
| Consensus_operation _, (Amendment_operation _ | Manager_operations _ | Dictator_operation _) -> -1
|
||||||
| (Amendment_operation _ | Manager_operations _ | Dictator_operation _), Consensus_operation _ -> 1
|
| (Amendment_operation _ | Manager_operations _ | Dictator_operation _), Consensus_operation _ -> 1
|
||||||
|
@ -320,7 +320,7 @@ module Forge = struct
|
|||||||
Manager_operations { source ;
|
Manager_operations { source ;
|
||||||
counter ; operations ; fee ; gas_limit } in
|
counter ; operations ; fee ; gas_limit } in
|
||||||
(RPC_context.make_call0 S.operations ctxt block
|
(RPC_context.make_call0 S.operations ctxt block
|
||||||
() ({ branch }, Sourced_operations ops))
|
() ({ branch }, Sourced_operation ops))
|
||||||
|
|
||||||
let reveal ctxt
|
let reveal ctxt
|
||||||
block ~branch ~source ~sourcePubKey ~counter ~fee ()=
|
block ~branch ~source ~sourcePubKey ~counter ~fee ()=
|
||||||
@ -364,7 +364,7 @@ module Forge = struct
|
|||||||
block ~branch operation =
|
block ~branch operation =
|
||||||
let ops = Consensus_operation operation in
|
let ops = Consensus_operation operation in
|
||||||
(RPC_context.make_call0 S.operations ctxt block
|
(RPC_context.make_call0 S.operations ctxt block
|
||||||
() ({ branch }, Sourced_operations ops))
|
() ({ branch }, Sourced_operation ops))
|
||||||
|
|
||||||
let endorsement ctxt
|
let endorsement ctxt
|
||||||
b ~branch ~block ~level ~slots () =
|
b ~branch ~block ~level ~slots () =
|
||||||
@ -380,7 +380,7 @@ module Forge = struct
|
|||||||
block ~branch ~source operation =
|
block ~branch ~source operation =
|
||||||
let ops = Amendment_operation { source ; operation } in
|
let ops = Amendment_operation { source ; operation } in
|
||||||
(RPC_context.make_call0 S.operations ctxt block
|
(RPC_context.make_call0 S.operations ctxt block
|
||||||
() ({ branch }, Sourced_operations ops))
|
() ({ branch }, Sourced_operation ops))
|
||||||
|
|
||||||
let proposals ctxt
|
let proposals ctxt
|
||||||
b ~branch ~source ~period ~proposals () =
|
b ~branch ~source ~period ~proposals () =
|
||||||
@ -400,7 +400,7 @@ module Forge = struct
|
|||||||
block ~branch operation =
|
block ~branch operation =
|
||||||
let op = Dictator_operation operation in
|
let op = Dictator_operation operation in
|
||||||
(RPC_context.make_call0 S.operations ctxt block
|
(RPC_context.make_call0 S.operations ctxt block
|
||||||
() ({ branch }, Sourced_operations op))
|
() ({ branch }, Sourced_operation op))
|
||||||
|
|
||||||
let activate ctxt
|
let activate ctxt
|
||||||
b ~branch hash =
|
b ~branch hash =
|
||||||
@ -472,7 +472,7 @@ module Parse = struct
|
|||||||
let check_signature ctxt signature shell contents =
|
let check_signature ctxt signature shell contents =
|
||||||
match contents with
|
match contents with
|
||||||
| Anonymous_operations _ -> return ()
|
| Anonymous_operations _ -> return ()
|
||||||
| Sourced_operations (Manager_operations op) ->
|
| Sourced_operation (Manager_operations op) ->
|
||||||
let public_key =
|
let public_key =
|
||||||
List.fold_left (fun acc op ->
|
List.fold_left (fun acc op ->
|
||||||
match op with
|
match op with
|
||||||
@ -487,16 +487,16 @@ module Parse = struct
|
|||||||
end >>=? fun public_key ->
|
end >>=? fun public_key ->
|
||||||
Operation.check_signature public_key
|
Operation.check_signature public_key
|
||||||
{ signature ; shell ; contents }
|
{ signature ; shell ; contents }
|
||||||
| Sourced_operations (Consensus_operation (Endorsements { level ; slots ; _ })) ->
|
| Sourced_operation (Consensus_operation (Endorsements { level ; slots ; _ })) ->
|
||||||
let level = Level.from_raw ctxt level in
|
let level = Level.from_raw ctxt level in
|
||||||
Baking.check_endorsements_rights ctxt level slots >>=? fun public_key ->
|
Baking.check_endorsements_rights ctxt level slots >>=? fun public_key ->
|
||||||
Operation.check_signature public_key
|
Operation.check_signature public_key
|
||||||
{ signature ; shell ; contents }
|
{ signature ; shell ; contents }
|
||||||
| Sourced_operations (Amendment_operation { source ; _ }) ->
|
| Sourced_operation (Amendment_operation { source ; _ }) ->
|
||||||
Roll.delegate_pubkey ctxt source >>=? fun source ->
|
Roll.delegate_pubkey ctxt source >>=? fun source ->
|
||||||
Operation.check_signature source
|
Operation.check_signature source
|
||||||
{ signature ; shell ; contents }
|
{ signature ; shell ; contents }
|
||||||
| Sourced_operations (Dictator_operation _) ->
|
| Sourced_operation (Dictator_operation _) ->
|
||||||
let key = Constants.dictator_pubkey ctxt in
|
let key = Constants.dictator_pubkey ctxt in
|
||||||
Operation.check_signature key
|
Operation.check_signature key
|
||||||
{ signature ; shell ; contents }
|
{ signature ; shell ; contents }
|
||||||
|
@ -24,7 +24,7 @@ type operation = {
|
|||||||
|
|
||||||
and proto_operation =
|
and proto_operation =
|
||||||
| Anonymous_operations of anonymous_operation list
|
| Anonymous_operations of anonymous_operation list
|
||||||
| Sourced_operations of sourced_operations
|
| Sourced_operation of sourced_operation
|
||||||
|
|
||||||
and anonymous_operation =
|
and anonymous_operation =
|
||||||
| Seed_nonce_revelation of {
|
| Seed_nonce_revelation of {
|
||||||
@ -44,7 +44,7 @@ and anonymous_operation =
|
|||||||
secret: Blinded_public_key_hash.secret ;
|
secret: Blinded_public_key_hash.secret ;
|
||||||
}
|
}
|
||||||
|
|
||||||
and sourced_operations =
|
and sourced_operation =
|
||||||
| Consensus_operation of consensus_operation
|
| Consensus_operation of consensus_operation
|
||||||
| Amendment_operation of {
|
| Amendment_operation of {
|
||||||
source: Signature.Public_key_hash.t ;
|
source: Signature.Public_key_hash.t ;
|
||||||
@ -317,8 +317,8 @@ module Encoding = struct
|
|||||||
manager_kind_case (Tag 2) ;
|
manager_kind_case (Tag 2) ;
|
||||||
dictator_kind_case (Tag 3) ;
|
dictator_kind_case (Tag 3) ;
|
||||||
])
|
])
|
||||||
(function Sourced_operations ops -> Some ops | _ -> None)
|
(function Sourced_operation op -> Some op | _ -> None)
|
||||||
(fun ops -> Sourced_operations ops)
|
(fun op -> Sourced_operation op)
|
||||||
|
|
||||||
let seed_nonce_revelation_encoding =
|
let seed_nonce_revelation_encoding =
|
||||||
(obj3
|
(obj3
|
||||||
@ -469,10 +469,10 @@ let parse (op: Operation.t) =
|
|||||||
|
|
||||||
let acceptable_passes op =
|
let acceptable_passes op =
|
||||||
match op.contents with
|
match op.contents with
|
||||||
| Sourced_operations (Consensus_operation _) -> [0]
|
| Sourced_operation (Consensus_operation _) -> [0]
|
||||||
| Sourced_operations (Amendment_operation _ | Dictator_operation _) -> [1]
|
| Sourced_operation (Amendment_operation _ | Dictator_operation _) -> [1]
|
||||||
| Anonymous_operations _ -> [2]
|
| Anonymous_operations _ -> [2]
|
||||||
| Sourced_operations (Manager_operations _) -> [3]
|
| Sourced_operation (Manager_operations _) -> [3]
|
||||||
|
|
||||||
type error += Invalid_signature (* `Permanent *)
|
type error += Invalid_signature (* `Permanent *)
|
||||||
type error += Missing_signature (* `Permanent *)
|
type error += Missing_signature (* `Permanent *)
|
||||||
@ -508,9 +508,9 @@ let forge shell proto =
|
|||||||
let check_signature key { shell ; contents ; signature } =
|
let check_signature key { shell ; contents ; signature } =
|
||||||
match contents, signature with
|
match contents, signature with
|
||||||
| Anonymous_operations _, _ -> return ()
|
| Anonymous_operations _, _ -> return ()
|
||||||
| Sourced_operations _, None ->
|
| Sourced_operation _, None ->
|
||||||
fail Missing_signature
|
fail Missing_signature
|
||||||
| Sourced_operations (Consensus_operation _), Some signature ->
|
| Sourced_operation (Consensus_operation _), Some signature ->
|
||||||
(* Safe for baking *)
|
(* Safe for baking *)
|
||||||
let unsigned_operation = forge shell contents in
|
let unsigned_operation = forge shell contents in
|
||||||
if Signature.check
|
if Signature.check
|
||||||
@ -519,7 +519,7 @@ let check_signature key { shell ; contents ; signature } =
|
|||||||
return ()
|
return ()
|
||||||
else
|
else
|
||||||
fail Invalid_signature
|
fail Invalid_signature
|
||||||
| Sourced_operations _, Some signature ->
|
| Sourced_operation _, Some signature ->
|
||||||
(* Unsafe for baking *)
|
(* Unsafe for baking *)
|
||||||
let unsigned_operation = forge shell contents in
|
let unsigned_operation = forge shell contents in
|
||||||
if Signature.check
|
if Signature.check
|
||||||
|
@ -24,7 +24,7 @@ type operation = {
|
|||||||
|
|
||||||
and proto_operation =
|
and proto_operation =
|
||||||
| Anonymous_operations of anonymous_operation list
|
| Anonymous_operations of anonymous_operation list
|
||||||
| Sourced_operations of sourced_operations
|
| Sourced_operation of sourced_operation
|
||||||
|
|
||||||
and anonymous_operation =
|
and anonymous_operation =
|
||||||
| Seed_nonce_revelation of {
|
| Seed_nonce_revelation of {
|
||||||
@ -44,7 +44,7 @@ and anonymous_operation =
|
|||||||
secret: Blinded_public_key_hash.secret ;
|
secret: Blinded_public_key_hash.secret ;
|
||||||
}
|
}
|
||||||
|
|
||||||
and sourced_operations =
|
and sourced_operation =
|
||||||
| Consensus_operation of consensus_operation
|
| Consensus_operation of consensus_operation
|
||||||
| Amendment_operation of {
|
| Amendment_operation of {
|
||||||
source: Signature.Public_key_hash.t ;
|
source: Signature.Public_key_hash.t ;
|
||||||
|
@ -11,7 +11,7 @@ open Proto_alpha
|
|||||||
open Error_monad
|
open Error_monad
|
||||||
open Alpha_context
|
open Alpha_context
|
||||||
|
|
||||||
let sourced ops = Sourced_operations ops
|
let sourced ops = Sourced_operation ops
|
||||||
|
|
||||||
let manager (src : Helpers_account.t) ?(fee = Tez.zero) operations context gas_limit =
|
let manager (src : Helpers_account.t) ?(fee = Tez.zero) operations context gas_limit =
|
||||||
Alpha_context.prepare
|
Alpha_context.prepare
|
||||||
@ -101,7 +101,7 @@ let sign src oph protop =
|
|||||||
let watermark =
|
let watermark =
|
||||||
match protop with
|
match protop with
|
||||||
| Proto_alpha.Alpha_context.Anonymous_operations _ -> None
|
| Proto_alpha.Alpha_context.Anonymous_operations _ -> None
|
||||||
| Proto_alpha.Alpha_context.Sourced_operations
|
| Proto_alpha.Alpha_context.Sourced_operation
|
||||||
(Proto_alpha.Alpha_context.Consensus_operation (Endorsements _)) ->
|
(Proto_alpha.Alpha_context.Consensus_operation (Endorsements _)) ->
|
||||||
Some Signature.Endorsement
|
Some Signature.Endorsement
|
||||||
| _ ->
|
| _ ->
|
||||||
|
@ -12,11 +12,11 @@ open Alpha_context
|
|||||||
|
|
||||||
(** Functions building operations *)
|
(** Functions building operations *)
|
||||||
|
|
||||||
val sourced : sourced_operations -> proto_operation
|
val sourced : sourced_operation -> proto_operation
|
||||||
|
|
||||||
val manager :
|
val manager :
|
||||||
Helpers_account.t -> ?fee:Tez.tez -> manager_operation list ->
|
Helpers_account.t -> ?fee:Tez.tez -> manager_operation list ->
|
||||||
Alpha_environment.Context.t -> Z.t -> sourced_operations proto_tzresult Lwt.t
|
Alpha_environment.Context.t -> Z.t -> sourced_operation proto_tzresult Lwt.t
|
||||||
|
|
||||||
val manager_full :
|
val manager_full :
|
||||||
Helpers_account.t -> ?fee:Tez.tez -> manager_operation list ->
|
Helpers_account.t -> ?fee:Tez.tez -> manager_operation list ->
|
||||||
@ -50,7 +50,7 @@ val transaction_full :
|
|||||||
Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t
|
Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t
|
||||||
|
|
||||||
val amendment_operation :
|
val amendment_operation :
|
||||||
Helpers_account.t -> amendment_operation -> sourced_operations
|
Helpers_account.t -> amendment_operation -> sourced_operation
|
||||||
|
|
||||||
val endorsements :
|
val endorsements :
|
||||||
?slot:int -> Block_hash.t -> Raw_level.t -> consensus_operation
|
?slot:int -> Block_hash.t -> Raw_level.t -> consensus_operation
|
||||||
|
Loading…
Reference in New Issue
Block a user