public async Task update_refund_gas_price_should_fail_for_zero_gas_price()
        {
            var depositId = TestItem.KeccakA;
            var info      = await _consumerTransactionsService.UpdateRefundGasPriceAsync(depositId, 0);

            info.Status.Should().Be(UpdatedTransactionStatus.InvalidGasPrice);
            info.Hash.Should().BeNull();
        }
示例#2
0
        public void update_refund_gas_price_should_fail_for_zero_gas_price()
        {
            var         depositId = TestItem.KeccakA;
            Func <Task> act       = () => _consumerTransactionsService.UpdateRefundGasPriceAsync(depositId, 0);

            act.Should().Throw <ArgumentException>()
            .WithMessage("Gas price cannot be 0. (Parameter 'gasPrice')");
        }
示例#3
0
        public async Task update_refund_gas_price_should_return_transaction_hash()
        {
            var depositId       = TestItem.KeccakA;
            var gasPrice        = 20.GWei();
            var transactionHash = TestItem.KeccakB;

            _consumerTransactionsService.UpdateRefundGasPriceAsync(depositId, gasPrice).Returns(transactionHash);
            var result = await _rpc.ndm_updateRefundGasPrice(depositId, gasPrice);

            result.Data.Should().Be(transactionHash);
            await _consumerTransactionsService.Received().UpdateRefundGasPriceAsync(depositId, gasPrice);
        }
示例#4
0
        public async Task update_refund_gas_price_should_return_transaction_hash()
        {
            var depositId = TestItem.KeccakA;
            var gasPrice  = 20.GWei();
            var info      = new UpdatedTransactionInfo(UpdatedTransactionStatus.Ok, TestItem.KeccakB);

            _consumerTransactionsService.UpdateRefundGasPriceAsync(depositId, gasPrice).Returns(info);
            var result = await _rpc.ndm_updateRefundGasPrice(depositId, gasPrice);

            result.Data.Status.Should().Be(info.Status.ToString().ToLowerInvariant());
            result.Data.Hash.Should().Be(info.Hash);
            await _consumerTransactionsService.Received().UpdateRefundGasPriceAsync(depositId, gasPrice);
        }