예제 #1
0
def concluded_election(b, ongoing_election, ed25519_node_keys):
    validators = b.get_validators(height=1)
    validator_update = {'validators': validators,
                        'height': 2,
                        'election_id': ongoing_election.id}

    query.store_validator_set(b.connection, validator_update)
    return ongoing_election
예제 #2
0
def inconclusive_election(b, ongoing_validator_election, new_validator):
    validators = b.get_validators(height=1)
    validators[0]['voting_power'] = 15
    validator_update = {'validators': validators,
                        'height': 2,
                        'election_id': 'some_other_election'}

    query.store_validator_set(b.connection, validator_update)
    return ongoing_validator_election
예제 #3
0
def inconclusive_election(b, ongoing_election, new_validator):
    validators = b.get_validators(height=1)
    validators[0]['voting_power'] = 15
    validator_update = {'validators': validators,
                        'height': 2,
                        'election_id': 'some_other_election'}

    query.store_validator_set(b.connection, validator_update)
    return ongoing_election
예제 #4
0
def ongoing_election(b, valid_election, ed25519_node_keys):
    validators = b.get_validators(height=1)
    genesis_validators = {'validators': validators,
                          'height': 0,
                          'election_id': None}
    query.store_validator_set(b.connection, genesis_validators)

    b.store_bulk_transactions([valid_election])
    block_1 = Block(app_hash='hash_1', height=1, transactions=[valid_election.id])
    b.store_block(block_1._asdict())
    return valid_election