Exemplo n.º 1
0
    def test_distribute_invalid_price(self, *args, loop):
        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.distribute,
            address=self.addresses[0].address,
            forward_address=self.addresses[2].address,
            price='20.2r',
            metadata='metadata',
            mode='preview')
    def test_distribute_invalid_price(self, *args, loop):
        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.distribute,
            address=self.addresses[0].address,
            forward_address=self.addresses[2].address,
            price='20.2r',
            metadata='metadata',
            mode='preview')
Exemplo n.º 3
0
    def test_issueasset_invalid_address(self, *args, loop):
        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.issueasset,
            address=self.addresses[0].address,
            amount='100',
            to=self.addresses[2].address,
            metadata='metadata',
            fees='10',
            mode='unsigned')
    def test_issueasset_invalid_address(self, *args, loop):
        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.issueasset,
            address=self.addresses[0].address,
            amount='100',
            to=self.addresses[2].address,
            metadata='metadata',
            fees='10',
            mode='unsigned')
Exemplo n.º 5
0
    def test_invalid_fees(self, *args, loop):
        self.setup_mocks(loop, [
            (80, self.addresses[0].script(), None, 0),
            (50, self.addresses[1].script(), None, 0),
            (50, self.addresses[0].script(), None, 0)
        ])

        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.sendbitcoin,
            address=self.addresses[0].address,
            amount='100',
            to=self.addresses[2].address,
            fees='10a',
            mode='unsigned')
    def test_invalid_fees(self, *args, loop):
        self.setup_mocks(loop, [
            (80, self.addresses[0].script(), None, 0),
            (50, self.addresses[1].script(), None, 0),
            (50, self.addresses[0].script(), None, 0)
        ])

        target = self.create_controller()

        yield from helpers.assert_coroutine_raises(
            self,
            colorcore.routing.ControllerError,
            target.sendbitcoin,
            address=self.addresses[0].address,
            amount='100',
            to=self.addresses[2].address,
            fees='10a',
            mode='unsigned')
Exemplo n.º 7
0
    def test_sendbitcoin_signed_invalid_signature(self, *args, loop):
        self.set_sign_transaction_mock(False)

        yield from helpers.assert_coroutine_raises(
            self, colorcore.routing.ControllerError, self._setup_sendbitcoin_test, 'signed', 'json', loop)
        self.assertEqual(1, self.provider.sign_transaction.call_count)
    def test_sendbitcoin_signed_invalid_signature(self, *args, loop):
        self.set_sign_transaction_mock(False)

        yield from helpers.assert_coroutine_raises(
            self, colorcore.routing.ControllerError, self._setup_sendbitcoin_test, 'signed', 'json', loop)
        self.assertEqual(1, self.provider.sign_transaction.call_count)