Ejemplo n.º 1
0
    def do_withdraw(self, arguments):
        if not self.Wallet:
            print("Please open a wallet")
            return

        item = get_arg(arguments, 0)

        if item:

            if item == 'holds':
                PrintHolds(self.Wallet)
            elif item == 'delete_holds':
                index_to_delete = -1
                if get_arg(arguments, 1) and int(get_arg(arguments, 1)) > -1:
                    index_to_delete = int(get_arg(arguments, 1))
                DeleteHolds(self.Wallet, index_to_delete)
            elif item == 'cancel_holds':
                if len(arguments) > 1:
                    CancelWithdrawalHolds(self.Wallet, get_arg(arguments, 1))
                else:
                    print("Please specify contract hash to cancel holds for")
            elif item == 'completed':
                ShowCompletedHolds(self.Wallet)
            elif item == 'cleanup':
                CleanupCompletedHolds(self.Wallet)
            elif item == 'all':
                WithdrawAll(self.Wallet)
        else:
            WithdrawOne(self.Wallet)
    def test_6_cleanup_holds(self):

        wallet = self.GetWallet1()

        res = CleanupCompletedHolds(wallet, require_password=False)

        self.assertIsInstance(res, InvocationTransaction)

        self.assertEqual(res.Hash.ToString(), '24708397bf6a54df7f2161348a399dca24082fd00d564bf21fa2cb18ff1efbe5')
Ejemplo n.º 3
0
    def test_6_cleanup_holds(self):

        wallet = self.GetWallet1()

        res = CleanupCompletedHolds(wallet, require_password=False)

        self.assertIsInstance(res, InvocationTransaction)

        self.assertEqual(
            res.Hash.ToString(),
            'aa27a2331631e7594517fed5f6388e6f3e2567a7854b4d98901c818d9f20d03e')