示例#1
0
def transferToken(fromAcc, toAcc, amount, memo):
    newjson = transfer.transferJson(fromAcc, toAcc, amount, memo)

    scopes = [fromAcc, toAcc]

    trxjson = trx.formatTrxJson([newjson], scopes)

    postjson = trx.formatPostJson([ACTIVE_KEY_PRIVATE], [trxjson])

    rpc.pushTrxRpc(RPC_SERVER_POINT, postjson, False)
    return
示例#2
0
def newAccount(accname, amount):
    newaccjson = account.newAccountJson(CREATOR_NAME, accname, amount, OWNER_KEY, ACTIVE_KEY)

    scopes = [CREATOR_NAME]

    trxjson = trx.formatTrxJson([newaccjson], scopes)

    postjson = trx.formatPostJson([CREATOR_PRI_KEY], [trxjson])

    print('new account: ' + accname)

    rpc.pushTrxRpc(RPC_SERVER_POINT, postjson, False)
    return
示例#3
0
def transferTest(Acc1, Acc2, amount, count):
    newjson1 = transfer.transferJson(Acc1, Acc2, amount, "")
    newjson2 = transfer.transferJson(Acc2, Acc1, amount, "")
    scopes = [Acc1, Acc2]

    msgs = []

    for idx in range(0, count):
        if(idx % 2 == 0):
            msgs.append(newjson1)
        else:
            msgs.append(newjson2)

    trxjson = trx.formatTrxJson(msgs, scopes)

    postjson = trx.formatPostJson([ACTIVE_KEY_PRIVATE], [trxjson])

    rpc.pushTrxRpc(RPC_SERVER_POINT, postjson, False)
    return