Ejemplo n.º 1
0
 def test_follow_posting_key(self):
     nodelist = NodeList()
     stm = DPay(node=nodelist.get_testnet(),
                 keys=[self.posting_key],
                 nobroadcast=True,
                 expiration=120,
                 num_retries=10)
     account = Account("dpaycli", dpay_instance=stm)
     account.follow("dpaycli1")
Ejemplo n.º 2
0
    if useWallet:
        stm.wallet.addPrivateKey(owner_privkey)
        stm.wallet.addPrivateKey(active_privkey)
        stm.wallet.addPrivateKey(memo_privkey)
        stm.wallet.addPrivateKey(posting_privkey)
    else:
        stm = DPay(node=testnet_node,
                   wif={
                       'active': str(active_privkey),
                       'posting': str(posting_privkey),
                       'memo': str(memo_privkey)
                   })
    account = Account(username, dpay_instance=stm)
    if account["name"] == "dpaycli":
        account.disallow("dpaycli1", permission='posting')
        account.allow('dpaycli1', weight=1, permission='posting', account=None)
        account.follow("dpaycli1")
    elif account["name"] == "dpaycli5":
        account.allow('dpaycli4', weight=2, permission='active', account=None)
    if useWallet:
        stm.wallet.getAccountFromPrivateKey(str(active_privkey))

    # stm.create_account("dpaycli1", creator=account, password=password1)

    account1 = Account("dpaycli1", dpay_instance=stm)
    b = Blockchain(dpay_instance=stm)
    blocknum = b.get_current_block().identifier

    account.transfer("dpaycli1", 1, "BBD", "test")
    b1 = Block(blocknum, dpay_instance=stm)