package tezt-tezos

  1. Overview
  2. Docs
type secret_key =
  1. | Unencrypted of string
    (*

    The string does NOT contain the 'encrypted:' prefix

    *)
  2. | Encrypted of string

This type is used to construct values for secret keys.

Note: The tests only use unencrypted keys for the moment, please add new constructors for other keys here, as needed.

type key = {
  1. alias : string;
  2. public_key_hash : string;
  3. public_key : string;
  4. secret_key : secret_key;
}

Keys associated to an account. For example:

{
  alias = "bootstrap1";
  public_key_hash = "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx";
  public_key = "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav";
  secret_key =
    Unencrypted "edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh";
}

A Check.typ for key

type aggregate_key = {
  1. aggregate_alias : string;
  2. aggregate_public_key_hash : string;
  3. aggregate_public_key : string;
  4. aggregate_secret_key : secret_key;
}

Keys associated to an aggregatable account. For example:

{
  aggregate_alias = "bls_account";
  aggregate_public_key_hash = "tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn";
  aggregate_public_key =
    "BLpk1yUiLJ7RezbyViD5ZvWTfQndM3TRRYmvYWkUfH2EJqsLFnzzvpJss6pbuz3U1DDMpk8v16nV";
  aggregate_secret_key =
    Unencrypted "BLsk1hKAHyGqY9qRbgoSVnjiSmDWpKGjFF3WNQ7BaiaMUA6RMA6Pfq";
}
val sign_bytes : watermark:Tezos_crypto.Signature.watermark -> signer:key -> bytes -> Tezos_crypto.Signature.t

sign_bytes ~watermark ~signer message signs the bytes message with signer's secret key. Returns the corresponding Tezos signature. This function can be used to sign transactions, blocks, etc. depending on the given watermark.

Used for regular accounts.

val require_unencrypted_secret_key : __LOC__:string -> secret_key -> string

require_unencrypted_secret_key ~__LOC__ key returns sk if key is Unencrypted sk, or fails.

val uri_of_secret_key : secret_key -> string

uri_of_secret_key secret_key returns secret_key as an URI.

The URI of a secret key is its contents prefixed unencrypted: respectively encrypted: if it is unencrypted respetively encrypted.

val secret_key_typ : secret_key Tezt_wrapper.Check.typ

A Check.typ for secret_key

val write : key list -> base_dir:string -> unit

write keys ~base_dir writes the keys into the octez-client's data directory base_dir. This function has the same effect as importing all the keys manually via octez-client but is faster.

module Bootstrap : sig ... end
val parse_client_output : alias:string -> client_output:string -> key

parse_client_output ~alias ~client_output extracts keys from clients output that yields result of the form

      Hash: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
      Public Key: edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav
      Secret Key: unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh

and returns the corresponding key.

val parse_client_output_aggregate : alias:string -> client_output:string -> aggregate_key

parse_client_output_aggregate ~alias ~client_output extracts keys from clients output that yields result of the form

      Hash: tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn
      Public Key: BLpk1yUiLJ7RezbyViD5ZvWTfQndM3TRRYmvYWkUfH2EJqsLFnzzvpJss6pbuz3U1DDMpk8v16nV
      Secret Key: aggregate_unencrypted:BLsk1hKAHyGqY9qRbgoSVnjiSmDWpKGjFF3WNQ7BaiaMUA6RMA6Pfq

and returns the corresponding key.

OCaml

Innovation. Community. Security.