(node_factory, bitcoind, executor)
| 2791 | |
| 2792 | @pytest.mark.developer("needs dev_fail") |
| 2793 | def test_no_fee_estimate(node_factory, bitcoind, executor): |
| 2794 | l1 = node_factory.get_node(start=False, options={'dev-no-fake-fees': True}) |
| 2795 | |
| 2796 | # Fail any fee estimation requests until we allow them further down |
| 2797 | l1.daemon.rpcproxy.mock_rpc('estimatesmartfee', { |
| 2798 | 'error': {"errors": ["Insufficient data or no feerate found"], "blocks": 0} |
| 2799 | }) |
| 2800 | l1.start() |
| 2801 | |
| 2802 | l2 = node_factory.get_node() |
| 2803 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 2804 | |
| 2805 | # Can't fund a channel. |
| 2806 | l1.fundwallet(10**7) |
| 2807 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2808 | l1.rpc.fundchannel(l2.info['id'], 10**6) |
| 2809 | |
| 2810 | # Can't withdraw either. |
| 2811 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2812 | l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all') |
| 2813 | |
| 2814 | # Can't use feerate names, either. |
| 2815 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2816 | l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'urgent') |
| 2817 | |
| 2818 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2819 | l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'normal') |
| 2820 | |
| 2821 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2822 | l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', 'slow') |
| 2823 | |
| 2824 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2825 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'urgent') |
| 2826 | |
| 2827 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2828 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'normal') |
| 2829 | |
| 2830 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2831 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow') |
| 2832 | |
| 2833 | # Can with manual feerate. |
| 2834 | l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 10000, '1500perkb') |
| 2835 | l1.rpc.fundchannel(l2.info['id'], 10**6, '2000perkw', minconf=0) |
| 2836 | |
| 2837 | # Make sure we clean up cahnnel for later attempt. |
| 2838 | l1.daemon.wait_for_log('sendrawtx exit 0') |
| 2839 | l1.rpc.dev_fail(l2.info['id']) |
| 2840 | l1.daemon.wait_for_log('Failing due to dev-fail command') |
| 2841 | l1.wait_for_channel_onchain(l2.info['id']) |
| 2842 | bitcoind.generate_block(6) |
| 2843 | wait_for(lambda: only_one(l1.rpc.getpeer(l2.info['id'])['channels'])['state'] == 'ONCHAIN') |
| 2844 | wait_for(lambda: only_one(l2.rpc.getpeer(l1.info['id'])['channels'])['state'] == 'ONCHAIN') |
| 2845 | |
| 2846 | # But can accept incoming connections. |
| 2847 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 2848 | l2.fundchannel(l1, 10**6) |
| 2849 | |
| 2850 | # Can do HTLCs. |
nothing calls this directly
no test coverage detected