2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
(* Tezos Protocol Implementation - Low level Repr. of Operations *)
|
|
|
|
|
|
|
|
type operation = {
|
|
|
|
hash: Operation_hash.t ;
|
|
|
|
shell: Updater.shell_operation ;
|
|
|
|
contents: proto_operation ;
|
2017-02-28 05:56:40 +04:00
|
|
|
signature: Ed25519.Signature.t option ;
|
2016-09-08 21:13:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
and proto_operation =
|
|
|
|
| Anonymous_operations of anonymous_operation list
|
|
|
|
| Sourced_operations of sourced_operations
|
|
|
|
|
|
|
|
and anonymous_operation =
|
|
|
|
| Seed_nonce_revelation of {
|
|
|
|
level: Raw_level_repr.t ;
|
|
|
|
nonce: Seed_repr.nonce ;
|
|
|
|
}
|
2017-02-28 05:48:51 +04:00
|
|
|
| Faucet of {
|
|
|
|
id: Ed25519.Public_key_hash.t ;
|
|
|
|
nonce: MBytes.t ;
|
|
|
|
}
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
and sourced_operations =
|
|
|
|
| Manager_operations of {
|
|
|
|
source: Contract_repr.contract ;
|
2017-02-28 05:56:40 +04:00
|
|
|
public_key: Ed25519.Public_key.t option ;
|
2016-09-08 21:13:10 +04:00
|
|
|
fee: Tez_repr.tez ;
|
|
|
|
counter: counter ;
|
|
|
|
operations: manager_operation list ;
|
|
|
|
}
|
|
|
|
| Delegate_operations of {
|
2017-02-28 05:56:40 +04:00
|
|
|
source: Ed25519.Public_key.t ;
|
2016-09-08 21:13:10 +04:00
|
|
|
operations: delegate_operation list ;
|
|
|
|
}
|
2017-02-27 21:24:26 +04:00
|
|
|
| Dictator_operation of dictator_operation
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
and manager_operation =
|
|
|
|
| Transaction of {
|
|
|
|
amount: Tez_repr.tez ;
|
|
|
|
parameters: Script_repr.expr option ;
|
|
|
|
destination: Contract_repr.contract ;
|
|
|
|
}
|
|
|
|
| Origination of {
|
2016-11-14 18:54:21 +04:00
|
|
|
manager: Ed25519.Public_key_hash.t ;
|
|
|
|
delegate: Ed25519.Public_key_hash.t option ;
|
2016-09-08 21:13:10 +04:00
|
|
|
script: Script_repr.t ;
|
|
|
|
spendable: bool ;
|
|
|
|
delegatable: bool ;
|
|
|
|
credit: Tez_repr.tez ;
|
|
|
|
}
|
|
|
|
| Issuance of {
|
2016-11-14 18:54:21 +04:00
|
|
|
asset: Asset_repr.t * Ed25519.Public_key_hash.t ;
|
2016-09-08 21:13:10 +04:00
|
|
|
amount: Tez_repr.tez ;
|
|
|
|
}
|
2016-11-14 18:54:21 +04:00
|
|
|
| Delegation of Ed25519.Public_key_hash.t option
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
and delegate_operation =
|
|
|
|
| Endorsement of {
|
|
|
|
block: Block_hash.t ;
|
|
|
|
slot: int ;
|
|
|
|
}
|
|
|
|
| Proposals of {
|
|
|
|
period: Voting_period_repr.t ;
|
|
|
|
proposals: Protocol_hash.t list ;
|
|
|
|
}
|
|
|
|
| Ballot of {
|
|
|
|
period: Voting_period_repr.t ;
|
|
|
|
proposal: Protocol_hash.t ;
|
|
|
|
ballot: Vote_repr.ballot ;
|
|
|
|
}
|
|
|
|
|
2017-02-27 21:24:26 +04:00
|
|
|
and dictator_operation =
|
|
|
|
| Activate of Protocol_hash.t
|
|
|
|
| Activate_testnet of Protocol_hash.t
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
and counter = Int32.t
|
|
|
|
|
|
|
|
type error += Cannot_parse_operation
|
|
|
|
|
|
|
|
val parse:
|
|
|
|
Operation_hash.t -> Updater.raw_operation -> operation tzresult
|
|
|
|
|
|
|
|
val parse_proto:
|
|
|
|
MBytes.t ->
|
2017-02-28 05:56:40 +04:00
|
|
|
(proto_operation * Ed25519.Signature.t option) tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
type error += Invalid_signature
|
|
|
|
val check_signature:
|
2017-02-28 05:56:40 +04:00
|
|
|
Ed25519.Public_key.t -> operation -> unit tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val forge: Updater.shell_operation -> proto_operation -> MBytes.t
|
|
|
|
|
|
|
|
val proto_operation_encoding:
|
|
|
|
proto_operation Data_encoding.t
|
|
|
|
|
|
|
|
val unsigned_operation_encoding:
|
|
|
|
(Updater.shell_operation * proto_operation) Data_encoding.t
|
|
|
|
|
|
|
|
val max_operation_data_length: int
|