def test_revocation():
    domain = random_domain()
    name = AEName(domain)
    name.full_claim_blocking(keypair)
    EpochClient().wait_for_next_block()
    name.revoke()
    assert name.status == AEName.Status.REVOKED
    EpochClient().wait_for_next_block()
    assert AEName(domain).is_available()
def name_revoke(ctx):
    # retrieve the domain from the context
    domain = ctx.obj.get(CTX_AET_DOMAIN)
    # retrieve the keypair
    kp, _ = _keypair()
    name = AEName(domain)
    name.update_status()
    if name.status == AEName.Status.AVAILABLE:
        print("Domain is available, nothing to revoke")
        exit(0)
    tx = name.revoke(kp)
    _pp([('Transaction hash', tx.tx_hash)],
        title=f"Name {domain} status {name.status}")