@@ -4261,16 +4261,19 @@ def test_sql(node_factory, bitcoind):
42614261
42624262
42634263def test_sql_deprecated (node_factory , bitcoind ):
4264- # deprecated-apis breaks schemas...
4265- l1 = node_factory .get_node (start = False , options = {'allow-deprecated-apis' : True })
4266- l1 .rpc .check_request_schemas = False
4267- l1 .start ()
4264+ l1 , l2 = node_factory .line_graph (2 , opts = [{'allow-deprecated-apis' : True }, {}])
4265+
4266+ # l1 allows it, l2 doesn't
4267+ ret = l1 .rpc .sql ("SELECT max_total_htlc_in_msat FROM peerchannels;" )
4268+ assert ret == {'rows' : [[- 1 ]]}
42684269
4269- # FIXME: we have no fields which have been deprecated since sql plugin was
4270- # introduced. When we do, add them here! (I manually tested a fake one)
4270+ # It's deprecated in l2, so that will fail!
4271+ with pytest .raises (RpcError , match = "Deprecated column table peerchannels.max_total_htlc_in_msat" ):
4272+ l2 .rpc .sql ("SELECT max_total_htlc_in_msat FROM peerchannels;" )
42714273
4272- # ret = l1.rpc.sql("SELECT funding_local_msat, funding_remote_msat FROM peerchannels;")
4273- # assert ret == {'rows': []}
4274+ # But we can use a wildcard fine.
4275+ ret = l2 .rpc .sql ("SELECT COUNT(*) FROM peerchannels;" )
4276+ assert ret == {'rows' : [[1 ]]}
42744277
42754278
42764279def test_plugin_persist_option (node_factory ):
0 commit comments