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

feat: add with_hash to transaction to_h #178

Merged
merged 2 commits into from
Sep 18, 2019

Conversation

shaojunda
Copy link
Collaborator

@shaojunda shaojunda marked this pull request as ready for review September 18, 2019 09:00
@shaojunda shaojunda force-pushed the shaojunda-use-strict-on-rpc branch from 9a22acd to 55abb63 Compare September 18, 2019 09:16
@@ -62,7 +62,7 @@ def sign(key, tx_hash)
)
end

def to_h
def to_h(with_hash = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A boolean param is not good here - what if we want to exclude another property? Then we'd have to_h(with_hash = true, with_xxx = true).

I suggest we keep all properties in the model, but strip (exclude) the txhash when calling rpc.

Copy link
Collaborator Author

@shaojunda shaojunda Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it make sense, I will fix this.

@shaojunda shaojunda requested a review from ashchan September 18, 2019 10:03
@ashchan ashchan merged commit 51f7c00 into nervosnetwork:develop Sep 18, 2019
@shaojunda shaojunda deleted the shaojunda-use-strict-on-rpc branch September 19, 2019 01:39
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

Successfully merging this pull request may close these issues.

2 participants