Beispiel #1
0
def test_set_custom_network():
    epoch_time = datetime(2017, 1, 1, 13, 00, 00)
    set_custom_network(epoch_time, 11, 130)
    result = get_network()
    assert result['version'] == 11
    assert result['wif'] == 130
    assert result['epoch'] == epoch_time
    set_network(Devnet)  # set back to devnet so other tests don't fail
Beispiel #2
0
def build_network():

    # epoch = datetime(t[0], t[1], t[2], t[3], t[4], t[5])

    # version = network[data['network']]['version']
    # wif = network[data['network']]['wif']

    epoch = datetime(2017, 1, 1, 13, 00, 00)
    version = 23
    wif = 130

    set_custom_network(epoch, version, wif)
    e = network[data['network']][epoch]
    t = [int(i) for i in e]
Beispiel #3
0
def main():

    passphrase = sys.argv[1:0]
    vote = sys.argv[1:1]

    from crypto.transactions.builder.transfer import Transfer
    from crypto.identity.address import address_from_private_key
    from crypto.identity.private_key import PrivateKey
    from crypto.identity.public_key import PublicKey
    from crypto.identity.address import address_from_private_key
    import time
    from crypto.configuration.network import set_custom_network
    from crypto.transactions.builder.transfer import Transfer

    # from tbw import parse_config
    # from util.sql import SnekDB
    # from util.dynamic import Dynamic
    from ark import ArkClient

    client = ArkClient('http://localhost:4003/api')

    from datetime import datetime

    epoch = datetime(2017, 1, 1, 13, 00, 00)
    version = 23
    wif = 130

    work = set_custom_network(epoch, version, wif)

    # userInput

    # passPhrase = "clay harbor enemy utility margin pretty hub comic piece aerobic umbrella acquire"
    phrase = "outside tilt cluster film husband truck install fringe purse door build wire"

    candidate = "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
    # chooseVoter("Donald Trump")
    print(candidate)

    # priv = PrivateKey.from_passphrase(candidate).to_hex()

    tx = Transfer(recipientId=candidate, amount=50000)
    tx.sign(phrase)

    # print(tx.verify())

    ok = client.transactions.create([tx.transaction.to_dict()])

    pprint(ok)

    print(passphrase)
    print(vote)
Beispiel #4
0
def build_network(network):
    if network == 'ark':
        e = ["2017", "3", "21", "13", "00", "00"]
        version = 23
        wif = 170
    elif network == 'qredit':
        e = ["2017", "3", "21", "13", "00", "00"]
        version = 58
        wif = 187
    elif network == 'hydra':
        e = ["2019", "9", "1", "00", "00", "00"]
        version = 100
        wif = 111
    elif network == 'compendia':
        e = ["2020", "8", "21", "16", "00", "00"]
        version = 88
        wif = 171
    else:
        pass

    t = [int(i) for i in e]
    epoch = datetime.datetime(t[0], t[1], t[2], t[3], t[4], t[5])

    set_custom_network(epoch, version, wif)
Beispiel #5
0
def build_network():
    e = network.epoch
    t = [int(i) for i in e]
    epoch = datetime(t[0], t[1], t[2], t[3], t[4], t[5])
    set_custom_network(epoch, network.version, network.wif)