Make wait_for function available outside

Merged Mateusz Żebrak requested to merge mzebrak/wait-for into master

When writing test cases, there are situations where you have to wait in a loop for a certain amount of time until some specific action happens, e.g. proposal expires.

This leads to own implementations of the functions waiting for some action, which can cause different tests to use different implementations, when currently such a mechanism is available inside test-tools, which is well-tested and in my opinion full (By full I mean that it exhausts the possibilities, and parameters that such a function can provide).

This MR was inspired by wait_for_proposal_expiration function introduced in these changes, then supplemented with some assertions in these changes. In my option it still lacks some time between subsequent requests. (there is no sleeping between requests so I suppose node receives tons of requests)

The example of this function shows that we can use the existing mechanism for this, which needs to be exposed outside and can be slightly modified to meet different requirements.

Reviewers: @kudmich @kmochocki

Edited by Mateusz Żebrak

Merge request reports