(node_factory, bitcoind, executor)
| 2928 | |
| 2929 | |
| 2930 | def test_no_fee_estimate(node_factory, bitcoind, executor): |
| 2931 | l1 = node_factory.get_node(start=False, options={'dev-no-fake-fees': True}, |
| 2932 | may_reconnect=True) |
| 2933 | |
| 2934 | # Fail any fee estimation requests until we allow them further down |
| 2935 | l1.daemon.rpcproxy.mock_rpc('estimatesmartfee', { |
| 2936 | 'error': {"errors": ["Insufficient data or no feerate found"], "blocks": 0} |
| 2937 | }) |
| 2938 | l1.start() |
| 2939 | |
| 2940 | l2 = node_factory.get_node(may_reconnect=True) |
| 2941 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 2942 | |
| 2943 | # Can't fund a channel. |
| 2944 | l1.fundwallet(10**7) |
| 2945 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2946 | l1.rpc.fundchannel(l2.info['id'], 10**6) |
| 2947 | |
| 2948 | # Can't withdraw either. |
| 2949 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2950 | l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all') |
| 2951 | |
| 2952 | # Can't use feerate names, either. |
| 2953 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2954 | l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all', 'urgent') |
| 2955 | |
| 2956 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2957 | l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all', 'normal') |
| 2958 | |
| 2959 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2960 | l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all', 'slow') |
| 2961 | |
| 2962 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2963 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'urgent') |
| 2964 | |
| 2965 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2966 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'normal') |
| 2967 | |
| 2968 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2969 | l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow') |
| 2970 | |
| 2971 | # With anchors, not even with manual feerate! |
| 2972 | l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 10000, '1500perkb') |
| 2973 | if TEST_NETWORK == 'regtest': |
| 2974 | with pytest.raises(RpcError, match=r'Cannot estimate fees'): |
| 2975 | l1.rpc.fundchannel(l2.info['id'], 10**6, '2000perkw', minconf=0) |
| 2976 | |
| 2977 | # Can accept incoming connections, can't allow incoming channels |
| 2978 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 2979 | with pytest.raises(RpcError, match=r'feerates unknown'): |
| 2980 | l2.fundchannel(l1, 10**6) |
| 2981 | |
| 2982 | # Re-enable fees for a moment so we can fund channel. |
| 2983 | l1.set_feerates((15000, 11000, 7500, 3750), True) |
| 2984 | l2.fundchannel(l1, 10**6) |
| 2985 | l1.daemon.rpcproxy.mock_rpc('estimatesmartfee', { |
| 2986 | 'error': {"errors": ["Insufficient data or no feerate found"], "blocks": 0} |
| 2987 | }) |
nothing calls this directly
no test coverage detected