def METHOD_NAME(self, node, myopid, in_status='success', in_errormsg=None):
    print('waiting for async operation {}'.format(myopid))
    opids = []
    opids.append(myopid)
    timeout = 300
    status = None
    errormsg = None
    txid = None
    for x in range(1, timeout):
        results = node.z_getoperationresult(opids)
        if len(results)==0:
            time.sleep(1)
        else:
            print("Results", results[0])
            status = results[0]["status"]
            if status == "failed":
                errormsg = results[0]['error']['message']
            elif status == "success":
                txid = results[0]['result']['txid']
            break
    print('...returned status: {}'.format(status))
    assert_equal(in_status, status)
    if errormsg is not None:
        assert(in_errormsg is not None)
        assert_equal(in_errormsg in errormsg, True)
        print('...returned error: {}'.format(errormsg))
    return txid