Skip to content

Testing framework: add functions to register/generate (sk, pk) pairs for implicit addresses

E. Rivas requested to merge er433/test/add_account into dev

We need to register implicit accounts to the test framework in order to use them as source of transactions.

let test_break =
  let pkh = Crypto.hash_key ("edpku74x9PomVRTaPJgAAvQNMpncob2b2L29xG6pegY1NzDKp2ryax" : key) in
  let c = Tezos.implicit_account pkh in
  let a = Tezos.address c in
  let to_ = Test.nth_bootstrap_account 0 in
  let _ = Test.set_source a in
  Test.transfer_exn to_ (Test.eval ()) 1tez

this ^ failing with:

Sn uncaught error occured:
Missing account: tz1gwr4K6242WPv2SRG7mYkhFAVxgDCNU35e

This MR adds two functions in this space:

Test.add_account : string -> key -> unit
Test.new_account : unit -> string * key

The first one registers a pair (sk, pk) (note that the secret key is represented using a string). The second one generates a pair (sk, pk) and returns it.

  • has a changelog entry
Edited by Rémi

Merge request reports