Exemplo n.º 1
0
def idle_blockchain_policy(blockchain_alice, blockchain_bob):
    """
    Creates a Policy, in a manner typical of how Alice might do it, with a unique label
    """
    random_label = generate_random_label()
    policy = blockchain_alice.create_policy(blockchain_bob, label=random_label, m=2, n=3)
    return policy
Exemplo n.º 2
0
def idle_federated_policy(federated_alice, federated_bob):
    """
    Creates a Policy, in a manner typical of how Alice might do it, with a unique label
    """
    m = MOCK_POLICY_DEFAULT_M
    n = NUMBER_OF_URSULAS_IN_DEVELOPMENT_NETWORK
    random_label = generate_random_label()
    policy = federated_alice.create_policy(federated_bob, label=random_label, m=m, n=n, federated=True)
    return policy
Exemplo n.º 3
0
def idle_blockchain_policy(blockchain_alice, blockchain_bob):
    """
    Creates a Policy, in a manner typical of how Alice might do it, with a unique label
    """
    random_label = generate_random_label()
    expiration = maya.now().add(days=MIN_LOCKED_PERIODS//2)
    policy = blockchain_alice.create_policy(blockchain_bob,
                                            label=random_label,
                                            m=2, n=3,
                                            value=20*100,
                                            expiration=expiration)
    return policy
Exemplo n.º 4
0
def idle_blockchain_policy(blockchain_alice, blockchain_bob, token_economics):
    """
    Creates a Policy, in a manner typical of how Alice might do it, with a unique label
    """
    random_label = generate_random_label()
    days = token_economics.minimum_locked_periods // 2
    expiration = maya.now().add(days=days)
    policy = blockchain_alice.create_policy(blockchain_bob,
                                            label=random_label,
                                            m=2, n=3,
                                            value=3*days*100,
                                            expiration=expiration)
    return policy
Exemplo n.º 5
0
def idle_blockchain_policy(testerchain, blockchain_alice, blockchain_bob, token_economics):
    """
    Creates a Policy, in a manner typical of how Alice might do it, with a unique label
    """
    random_label = generate_random_label()
    days = token_economics.minimum_locked_periods // 2
    now = testerchain.w3.eth.getBlock(block_identifier='latest').timestamp
    expiration = maya.MayaDT(now).add(days=days-1)
    n = 3
    m = 2
    policy = blockchain_alice.create_policy(blockchain_bob,
                                            label=random_label,
                                            m=m, n=n,
                                            value=n * days * 100,
                                            expiration=expiration)
    return policy
Exemplo n.º 6
0
def random_policy_label():
    yield generate_random_label()