Testing framework: add support for context saving/restoring

Merged E. Rivas requested to merge er433/test/context-manipulation into dev


This MR adds support for saving/restoring the context in testing framework:

Test.save_context : unit -> unit
Test.restore_context : unit -> unit

This could be useful for doing testing of contracts, you set up a context, and then try different transactions on the very same context instead of resetting the whole context.

Changelog details:

New operations Test.save_context and Test.restore_context

  • Test.save_context : unit -> unit : takes current testing framework context and saves it, pushing it into a stack of contexts.
  • Test.restore_context : unit -> unit : pops a testing framework context from the stack of contexts, and sets it up as the new current context. In case the stack was empty, the current context is kept.
Edited by E. Rivas