Add a short informative deprecation message when users use getinfo, that points them to the new calls
here to get the different information fields.
This is meant to be temporary, for one release only.
rpc: Add deprecation error for `getinfo` #12198
pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2018_01_getinfo_deprecation_message changing 1 files +13 −0-
laanwj commented at 11:40 AM on January 16, 2018: member
- laanwj added this to the milestone 0.16.0 on Jan 16, 2018
- laanwj added the label RPC/REST/ZMQ on Jan 16, 2018
- laanwj force-pushed on Jan 16, 2018
-
MarcoFalke commented at 1:02 PM on January 16, 2018: member
Before:
$ ./src/bitcoin-cli getinfo error code: -32601 error message: Method not foundAfter:
./src/bitcoin-cli getinfo error code: -1 error message: getinfo This call was removed in version 0.16.0. Use the appropriate fields from: - getblockchaininfo: blocks, difficulty, chain - getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings - getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion bitcoin-cli has the option -getinfo to collect and format these in the old format.-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 utACK b9be8e3f93b0c796d27e1e15e573950098da625f -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJaXffNAAoJENLqSFDnUosliaYP/3p0Q+FmLE+PDIVkneTE192A m88U4TAKsP08dKXNUa0CdOJuAMMy7BL4Ur9J5sF242lA0kUaNBTQAae/KCkhaD/q u2yW3uZRuWjIC8WMz3xstupdL0X8B0ocPFFIXL5wUzln26i+anUQKES3QTgdOQgM tFVYJTshweFWKlDg2R1h3XIKrkWc0YgXM7y2vOSs7LzJd9AKRQm6jVgAswI3txsi pntIeAJini4K5kpcFakHA8x69+MV0sNpOroVVayIvOiUrni+ssQttPdu888pj/OB b7jynMw8LjXRdYSSs8j55br36jDThrK2yxBg0kR1uENXlXoOappuGeUwdINYE9hS lDs/EZtmJJja+gspviZMH9iw3QG0RJKzjzvpyLHH5CX1yshv15n+s2ZlwkG00oP7 wFTfCAYJGWwdhdiGLI55fU6LOBpHTuRmqyFhBYzz4Kp/whDZKdZZyZySCSAM1MdG dRsRvd4SofXoLass4mPvTKQCQKZ+IDHad5WLaj5Snaw1I32dEJbwsh0Y08NrgFnQ 2sCjrLLf65tz9iILiX4cps+WU9xnzbpxQIMknlnWEHKrSeND6oHrvvqLRVK6Kncn WJ7jwPwVU9OC2mIIvoFfsi93BlFUrOwaG9AL9/5emCxK1bYNJPtC7tvwJCMcPi5/ lYJgOhsyJCHeylQIpEEb =UYr3 -----END PGP SIGNATURE----- -
ryanofsky commented at 3:41 PM on January 16, 2018: member
utACK b9be8e3f93b0c796d27e1e15e573950098da625f. But perhaps it should throw JSONRPCError instead of runtime_error, so it can continue to return the RPC_METHOD_NOT_FOUND error code.
-
jnewbery commented at 4:48 PM on January 16, 2018: member
Tested ACK b9be8e3f93b0c796d27e1e15e573950098da625f.
getinfowas not removed using the phased deprecation suggested in #10841. This seems like a good enough alternative.Agree with @ryanofsky that
RPC_METHOD_NOT_FOUNDis the appropriate error rather thanRPC_MISC_ERROR.If you were being ultra zealous, you could add the following to deprecated_rpc.py:
self.log.info("getinfo: Returns deprecation message") assert_raises_rpc_error(-1, 'This call was removed in version 0.16.0', self.nodes[0].getinfo)but this would just need to be removed after one release, so I don't see much point. Manual testing seems appropriate.
-
achow101 commented at 6:16 PM on January 16, 2018: member
utACK b9be8e3f93b0c796d27e1e15e573950098da625f
I would also prefer that this use JSONRPCError than just a runtime error.
-
meshcollider commented at 12:54 AM on January 17, 2018: contributor
utACK https://github.com/bitcoin/bitcoin/pull/12198/commits/b9be8e3f93b0c796d27e1e15e573950098da625f, agree with above comments though
-
49e5f3ff7e
rpc: Add deprecation error for `getinfo`
Add a short informative deprecation message when users use `getinfo`, that points them to the new calls where to get the different information fields.
-
laanwj commented at 9:07 AM on January 17, 2018: member
Changed the error code to RPC_METHOD_NOT_FOUND b9be8e3 → 49e5f3f
- laanwj force-pushed on Jan 17, 2018
-
meshcollider commented at 10:30 AM on January 17, 2018: contributor
re-utACK
- laanwj merged this on Jan 17, 2018
- laanwj closed this on Jan 17, 2018
- laanwj referenced this in commit adce1de9a6 on Jan 17, 2018
-
MarcoFalke commented at 1:14 AM on January 19, 2018: member
Post merge re ACK
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 utACK 49e5f3ff7e940b8da7d9e7252d2b1e27bd192ae4 -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJaYUZmAAoJENLqSFDnUosl/c0P/j7IiFlQ1oGIoXnVwnN0Syec Zix1fVp4WToqgpWiDRchm0wqbXvnh5ZLt1WzAArw6dwXwedG6yHYSS+XDMXz756b Iwro0TPJWF0EtdnM6NshuTwrlI90tKf6XM8dKIlSpiRP/8BUKfcjdx7fbi4U32KG G18/c5/5FmT1GgW0qC0ng/rPmCctMkxmlFf4lzwrbpledV9pbBP7brnvjJeQ6zxC IhSpcIP2unIQDe33ByIIvF5Ujo4irX0uToOb5fxvYWDyLC9yhFttL4lNQXPFiRQR /xSwTdkUGbQf8P16leng9vo2DdyTebIIYAEgwPqHRVxm5qhDOW03ZxXlxXzl4lMk WOYQahj0eYY211739w4tA6c1LmOf5WvzL0jUUtVhFf9ukIuKqKZGxrNnAF4/vv+J DHN286gH0eBgdXaRHFkAnq8R3lUpQr1xGYZr6jadGX5qWIVjtEs5p4LFKURRxZiW I6vEJql8acMAa/1Pl0/KMUaEY0JAHhCD4KWOigsOAZZmW4nu6iLDTKUsWhA6d2jj RuA1NTzvRcJUDYZnWm3XwMEyme1iAtLo+deyscBROM2Lx6SvaRRRJd6LmNp8Tguh cjDidE5qXQxC4lgRkRWO4BqZTVy2OxW4g5gr+V0wh5Qtz3mD2MQJWPF2WJ1EYYEN FsFRoT/FbPOz6rz6LkW8 =dXhb -----END PGP SIGNATURE----- - PastaPastaPasta referenced this in commit a70d50232e on Apr 7, 2020
- PastaPastaPasta referenced this in commit 5bb47a6d91 on Apr 8, 2020
- ckti referenced this in commit 78811b15c5 on Mar 28, 2021
- DrahtBot locked this on Sep 8, 2021
Milestone
0.16.0