Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate and then remove to_json methods #267

Open
etscrivner opened this issue Jul 28, 2018 · 3 comments
Open

Deprecate and then remove to_json methods #267

etscrivner opened this issue Jul 28, 2018 · 3 comments

Comments

@etscrivner
Copy link

The to_json methods on blocks and transactions are somewhat out of place. Originally they were used to support a blockchain explorer, but this use-case no longer exists. The place to phase these out would take the following steps:

  1. Add a deprecation warning to let users know these methods are going away and do a release.
  2. Completely remove the methods and all associated tests in a follow-on major release.
etscrivner added a commit to etscrivner/bitcoin-ruby that referenced this issue Sep 19, 2018
Closes lian#267

Add deprecation warnings on `Bitcoin::Protocol::Tx#to_json(_file)` as well as
to `Bitcoin::Protocol::Block#to_json(_file)`.

This causes the tests to display a lot of warnings and the tests and examples
using these methods must also be removed / revised once they are gone for good.
etscrivner added a commit to etscrivner/bitcoin-ruby that referenced this issue Sep 19, 2018
Addresses the first half of lian#267

Add deprecation warnings on `Bitcoin::Protocol::Tx#to_json(_file)` as well as
to `Bitcoin::Protocol::Block#to_json(_file)`.

This causes the tests to display a lot of warnings and the tests and examples
using these methods must also be removed / revised once they are gone for good.
@etscrivner
Copy link
Author

etscrivner commented Sep 19, 2018

@lian It sounds like from your comment on #280 that you'd want to deprecate and remove all JSON methods, meaning to_json* and from_json*. Is this accurate?

@lian
Copy link
Owner

lian commented Sep 19, 2018

yea, think we should deprecate them and remove move all of them. unsure about to_hash and from_hash, but even if we keep them we might remove their script.to_string output and just output scripts as hex

etscrivner added a commit to etscrivner/bitcoin-ruby that referenced this issue Sep 20, 2018
Addresses the first half of lian#267

Add deprecation warnings to all `to_json*` and `from_json*` methods to indicate
that these will be removed in a future release. All deprecated methods are also
moved to be near each other so they will be easier to remove in the future.

This causes the tests to display a lot of warnings and the tests and examples
using these methods must also be removed / revised once they are gone for good.
@etscrivner
Copy link
Author

@lian Updated, let me know if this looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants