Added unit tests for init_znetwork and wait_zrequest. Updated the functions to pass the tests.