Exemple #1
0
def test_deterministic_superblock_selection(go_list_superblocks):
    from aitherd import AitherDaemon
    aitherd = AitherDaemon.from_aither_conf(config.aither_conf)

    for item in go_list_superblocks:
        (go,
         subobj) = GovernanceObject.import_gobject_from_aitherd(aitherd, item)

    # highest hash wins if same -- so just order by hash
    sb = Superblock.find_highest_deterministic(
        '22a5f429c5ffb2b79b1b30c3ac30751284e3efa4e710bc7fd35fbe7456b1e485')

    assert sb.object_hash == 'a10bab2993a11f206d8094024b254d36bf0c9a34ee34ce60f11bc75e44d70c93'
def test_approved_and_ranked(go_list_proposals):
    from aitherd import AitherDaemon
    aitherd = AitherDaemon.from_aither_conf(config.aither_conf)

    for item in go_list_proposals:
        (go,
         subobj) = GovernanceObject.import_gobject_from_aitherd(aitherd, item)

    prop_list = Proposal.approved_and_ranked(proposal_quorum=1,
                                             next_superblock_max_budget=60)

    assert prop_list[
        0].object_hash == u'e966911624df92b90582ef9cdd2b3d8c1ed5c06ee2847aadc68ad0442c22ea6a'
    assert prop_list[
        1].object_hash == u'2b6b4aee7bea18b38a928ef8c50aa74dac58787e850d990881daf5c1341c9bf8'
Exemple #3
0
def test_deterministic_superblock_creation(go_list_proposals):
    import aitherlib
    import misc
    from aitherd import AitherDaemon
    aitherd = AitherDaemon.from_aither_conf(config.aither_conf)
    for item in go_list_proposals:
        (go,
         subobj) = GovernanceObject.import_gobject_from_aitherd(aitherd, item)

    max_budget = 60
    prop_list = Proposal.approved_and_ranked(
        proposal_quorum=1, next_superblock_max_budget=max_budget)
    sb = aitherlib.create_superblock(prop_list,
                                     72000,
                                     budget_max=max_budget,
                                     sb_epoch_time=misc.now())

    assert sb.event_block_height == 72000
    assert sb.payment_addresses == 'nLLGSuauCV21NBpHJpLHKevWpwE3t6CHGc|nLLGSuauCV21NBpHJpLHKevWpwE3t6CHGc'
    assert sb.payment_amounts == '25.75000000|32.01000000'
    assert sb.proposal_hashes == 'e966911624df92b90582ef9cdd2b3d8c1ed5c06ee2847aadc68ad0442c22ea6a|2b6b4aee7bea18b38a928ef8c50aa74dac58787e850d990881daf5c1341c9bf8'

    assert sb.hex_hash(
    ) == '5534e9fa4a51423820b9e19fa6d4770c12ea0a5663e8adff8223f5e8b6df641c'