def withdraw_transactions(wallet, staking_address, transfer_address=None, view_keys=[]): tx = Transaction(wallet) transfer_address = transfer_address or wallet.create_address() tx.withdraw(staking_address, transfer_address, view_keys=view_keys) i = 0 while i < 30: wallet.sync() balance = wallet.balance if balance["available"] > 0: break time.sleep(1)
def withdraw_transactions(wallet, staking_address): # test withdraw all unbounded tx = Transaction(wallet) tx.withdraw(staking_address, wallet.create_address()) i = 0 while i < 30: wallet.sync() balance = wallet.balance if balance["available"] >0: break time.sleep(1) assert balance["available"] == 500000000000000000
def test_transactions(): os.environ['CRYPTO_CLIENT_TENDERMINT'] = 'ws://localhost:26667/websocket' wallet_sender, _wallet_receiver = init_wallet() # test withdraw all unbounded tx = Transaction(wallet_sender) staking_address = "0x5e7e1e79d80b861a94598c721598951098dd3825" tx.withdraw(staking_address, wallet_sender.create_address()) i = 0 while i < 30: wallet_sender.sync() balance = wallet_sender.balance() if balance["available"] >0: break time.sleep(1) print(".", end='') if i % 10 == 0: print("\n", balance) i += 1 assert balance["available"] == 500000000000000000