2017-04-06 00:40:02 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2017-11-14 03:36:14 +04:00
|
|
|
(* Copyright (c) 2014 - 2017. *)
|
2017-04-06 00:40:02 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-10-09 12:55:12 +04:00
|
|
|
module Ed25519 = Environment.Ed25519
|
2017-04-06 00:40:02 +04:00
|
|
|
|
2017-10-28 22:32:39 +04:00
|
|
|
val init :
|
|
|
|
?sandbox:string ->
|
|
|
|
?rpc_port:int ->
|
|
|
|
unit -> (int * Block_hash.t) tzresult Lwt.t
|
2017-04-06 00:40:02 +04:00
|
|
|
(** [init ()] sets up the test environment, and return the PID of
|
|
|
|
forked Tezos node and the block info of the block from where the
|
|
|
|
tests will begin. *)
|
|
|
|
|
2017-04-12 20:53:23 +04:00
|
|
|
val level : Client_proto_rpcs.block -> Tezos_context.Level.t tzresult Lwt.t
|
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
module Account : sig
|
|
|
|
|
|
|
|
type t = {
|
|
|
|
alias : string ;
|
|
|
|
sk : Ed25519.Secret_key.t ;
|
|
|
|
pk : Ed25519.Public_key.t ;
|
|
|
|
pkh : Ed25519.Public_key_hash.t ;
|
|
|
|
contract : Contract.t ;
|
|
|
|
}
|
|
|
|
|
|
|
|
val encoding : t Data_encoding.t
|
|
|
|
val pp_account : Format.formatter -> t -> unit
|
|
|
|
val create : ?keys:(secret_key * public_key) -> string -> t
|
|
|
|
(** [create ?keys alias] is an account with alias [alias]. If
|
|
|
|
[?keys] is [None], a pair of keys will be minted. *)
|
|
|
|
|
|
|
|
type destination = {
|
|
|
|
alias : string ;
|
|
|
|
contract : Contract.t ;
|
|
|
|
pk : public_key ;
|
|
|
|
pkh : public_key_hash ;
|
|
|
|
}
|
|
|
|
|
|
|
|
val destination_encoding : destination Data_encoding.t
|
|
|
|
val pp_destination : Format.formatter -> destination -> unit
|
|
|
|
val create_destination :
|
|
|
|
alias:string ->
|
|
|
|
contract:Contract.t ->
|
|
|
|
pk:public_key -> destination
|
|
|
|
(** [create_destination ~alias ~contract ~pk] is a destination
|
|
|
|
contract [contract] with manager's publick key [pk]. *)
|
|
|
|
|
|
|
|
type bootstrap_accounts = { b1 : t ; b2 : t ; b3 : t ; b4 : t ; b5 : t }
|
|
|
|
|
|
|
|
val bootstrap_accounts : bootstrap_accounts
|
|
|
|
(** The hardcoded bootstrap accounts. *)
|
|
|
|
|
|
|
|
val transfer :
|
|
|
|
?block:Client_proto_rpcs.block ->
|
|
|
|
?fee:int64 ->
|
|
|
|
account:t ->
|
|
|
|
destination:Contract.t ->
|
|
|
|
amount:int64 ->
|
|
|
|
unit ->
|
|
|
|
(Operation_hash.t * Contract.t list) tzresult Lwt.t
|
|
|
|
|
|
|
|
val originate :
|
|
|
|
?block:Client_proto_rpcs.block ->
|
|
|
|
?delegate:public_key_hash ->
|
|
|
|
?fee:int64 ->
|
|
|
|
src:t ->
|
|
|
|
manager_pkh:public_key_hash ->
|
|
|
|
spendable:bool ->
|
|
|
|
balance:int64 ->
|
|
|
|
unit -> (Operation_hash.t * Contract.t) tzresult Lwt.t
|
|
|
|
|
|
|
|
val set_delegate :
|
|
|
|
?block:Client_proto_rpcs.block ->
|
|
|
|
?fee:int64 ->
|
2017-11-09 14:50:42 +04:00
|
|
|
?src_pk:public_key ->
|
2017-04-06 00:40:02 +04:00
|
|
|
contract:Contract.t ->
|
|
|
|
manager_sk:secret_key ->
|
|
|
|
public_key_hash option ->
|
|
|
|
Operation_hash.t tzresult Lwt.t
|
|
|
|
|
|
|
|
val balance : ?block:Client_proto_rpcs.block -> t -> Tez.t tzresult Lwt.t
|
|
|
|
|
|
|
|
val delegate :
|
|
|
|
?block:Client_proto_rpcs.block ->
|
|
|
|
Contract.t ->
|
|
|
|
public_key_hash option tzresult Lwt.t
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-11-01 19:42:37 +04:00
|
|
|
module Baking : sig
|
2017-04-06 00:40:02 +04:00
|
|
|
|
2017-04-27 03:01:05 +04:00
|
|
|
val mine:
|
2017-04-06 00:40:02 +04:00
|
|
|
Client_node_rpcs.Blocks.block ->
|
|
|
|
Account.t ->
|
2017-04-27 03:01:05 +04:00
|
|
|
Operation.raw list ->
|
2017-04-06 00:40:02 +04:00
|
|
|
Block_hash.t tzresult Lwt.t
|
|
|
|
|
2017-04-27 03:01:05 +04:00
|
|
|
val endorsement_reward:
|
|
|
|
Client_node_rpcs.Blocks.block -> int64 tzresult Lwt.t
|
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
module Endorse : sig
|
|
|
|
|
|
|
|
val endorse :
|
|
|
|
?slot:int ->
|
|
|
|
Account.t ->
|
2017-10-27 23:39:13 +04:00
|
|
|
Client_proto_rpcs.block ->
|
2017-04-17 22:53:23 +04:00
|
|
|
Operation.raw tzresult Lwt.t
|
2017-04-06 00:40:02 +04:00
|
|
|
|
|
|
|
val endorsers_list :
|
2017-10-27 23:39:13 +04:00
|
|
|
Client_proto_rpcs.block ->
|
2017-04-06 00:40:02 +04:00
|
|
|
Account.t array tzresult Lwt.t
|
|
|
|
|
|
|
|
val endorsement_rights :
|
|
|
|
?max_priority:int ->
|
|
|
|
Account.t ->
|
|
|
|
Client_proto_rpcs.block ->
|
|
|
|
Client_proto_rpcs.Helpers.Rights.endorsement_slot list tzresult Lwt.t
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-04-12 20:53:23 +04:00
|
|
|
module Protocol : sig
|
|
|
|
|
2017-04-17 22:53:23 +04:00
|
|
|
val proposals :
|
2017-04-12 20:53:23 +04:00
|
|
|
?block:Client_node_rpcs.Blocks.block ->
|
|
|
|
src:Account.t ->
|
2017-04-17 22:53:23 +04:00
|
|
|
Protocol_hash.t list ->
|
|
|
|
Operation.raw tzresult Lwt.t
|
2017-04-12 20:53:23 +04:00
|
|
|
|
2017-04-17 22:53:23 +04:00
|
|
|
val ballot :
|
2017-04-12 20:53:23 +04:00
|
|
|
?block:Client_node_rpcs.Blocks.block ->
|
|
|
|
src:Account.t ->
|
2017-04-17 22:53:23 +04:00
|
|
|
proposal:Protocol_hash.t ->
|
2017-04-12 20:53:23 +04:00
|
|
|
Vote.ballot ->
|
2017-04-17 22:53:23 +04:00
|
|
|
Operation.raw tzresult Lwt.t
|
2017-04-12 20:53:23 +04:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
module Assert : sig
|
|
|
|
|
|
|
|
include module type of Assert
|
|
|
|
|
|
|
|
val balance_equal:
|
2017-04-17 22:53:23 +04:00
|
|
|
?block:Client_node_rpcs.Blocks.block ->
|
2017-04-06 00:40:02 +04:00
|
|
|
msg:string -> Account.t -> int64 -> unit tzresult Lwt.t
|
|
|
|
val delegate_equal:
|
2017-04-17 22:53:23 +04:00
|
|
|
?block:Client_node_rpcs.Blocks.block ->
|
2017-04-06 00:40:02 +04:00
|
|
|
msg:string -> Contract.t -> public_key_hash option -> unit tzresult Lwt.t
|
|
|
|
|
2017-04-27 03:01:05 +04:00
|
|
|
val failed_to_preapply:
|
|
|
|
msg:string ->
|
|
|
|
?op:Client_node_rpcs.operation ->
|
2017-10-09 12:55:12 +04:00
|
|
|
(Environment.Error_monad.error ->
|
2017-04-27 03:01:05 +04:00
|
|
|
bool) ->
|
|
|
|
'a tzresult -> unit
|
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
val ecoproto_error:
|
2017-10-09 12:55:12 +04:00
|
|
|
(Environment.Error_monad.error -> bool) ->
|
2017-04-17 22:53:23 +04:00
|
|
|
error -> bool
|
2017-04-06 00:40:02 +04:00
|
|
|
|
|
|
|
val generic_economic_error : msg:string -> 'a tzresult -> unit
|
|
|
|
|
|
|
|
(** Transaction assertions *)
|
|
|
|
|
|
|
|
val unknown_contract : msg:string -> 'a tzresult -> unit
|
|
|
|
(** [unknown_contract ~msg result] raises if result is not a
|
|
|
|
[Storage_error]. *)
|
2017-11-13 17:29:28 +04:00
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
val non_existing_contract : msg:string -> 'a tzresult -> unit
|
|
|
|
val balance_too_low : msg:string -> 'a tzresult -> unit
|
|
|
|
val non_spendable : msg:string -> 'a tzresult -> unit
|
|
|
|
val inconsistent_pkh : msg:string -> 'a tzresult -> unit
|
2017-11-09 14:50:42 +04:00
|
|
|
val inconsistent_public_key : msg:string -> 'a tzresult -> unit
|
|
|
|
val missing_public_key : msg:string -> 'a tzresult -> unit
|
2017-04-06 00:40:02 +04:00
|
|
|
|
|
|
|
(** Origination assertions *)
|
|
|
|
|
|
|
|
val initial_amount_too_low : msg:string -> 'a tzresult -> unit
|
|
|
|
val non_delegatable : msg:string -> 'a tzresult -> unit
|
|
|
|
|
2017-11-01 15:13:23 +04:00
|
|
|
(** Endorsement / baking assertions *)
|
2017-04-06 00:40:02 +04:00
|
|
|
|
|
|
|
val wrong_delegate : msg:string -> 'a tzresult -> unit
|
|
|
|
|
2017-04-12 20:53:23 +04:00
|
|
|
val check_protocol :
|
|
|
|
?msg:string -> block:Client_node_rpcs.Blocks.block ->
|
2017-04-17 22:53:23 +04:00
|
|
|
Protocol_hash.t -> unit tzresult Lwt.t
|
2017-04-12 20:53:23 +04:00
|
|
|
|
2017-04-20 13:07:50 +04:00
|
|
|
val check_voting_period_kind :
|
|
|
|
?msg:string -> block:Client_node_rpcs.Blocks.block ->
|
|
|
|
Voting_period.kind -> unit tzresult Lwt.t
|
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
end
|
2017-04-10 15:01:22 +04:00
|
|
|
|
|
|
|
val display_level: Client_proto_rpcs.block -> unit tzresult Lwt.t
|