-
Notifications
You must be signed in to change notification settings - Fork 37
Fix TxOut::is_fee, add confidential is_explicit and unwrap_explicit, add Transaction::fee #42
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
Conversation
jonasnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be easy to add a test for this. Otherwise ACK
|
|
|
@RCasatta I agree, I had to check it as well. This is how it was done in our integration tests, I ported the method here. I guess since we use is_fee, we can assert the value to be explicit afterwards. Let me clean that up and add a test. |
|
I noticed that is_fee was actually incomplete according to Elements Core. So I fixed that and added is_explicit and unwrap_explicit methods to the confidential types to help. |
|
did you consider having |
|
Yeah but then it's not really an unwrap method like in the stdlib. We could have |
|
yeah, Option or like it is now is ok |
Make conform with Elements Core:
```c++
bool IsFee() const {
return g_con_elementsmode && scriptPubKey == CScript()
&& nValue.IsExplicit() && nAsset.IsExplicit();
}
```
|
I changed it to a Option, can you re-review and ack? I'd like to have this to add feerates to hal-elements. |
|
ack cbb9674 |
|
@apoelstra could you perhaps give me owner permissions on this repo so that I can merge PRs that are ACKed, but not "github-approved"? Currently I can't. I'll try self-approve, but that's weird. |
|
update: you can't self-approve. Bravo, GitHub :) |
jonasnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK cbb9674
|
Is there a reason I was refactoring some of my code to take advantage of the new methods, was kind of surprised to see that |
|
Nice, @stevenroose unified them here: 5d826e8 |
No description provided.