fix TxToJSON(), add IsValid() and GetAmount() support for naked blinder #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
couple quick fixes here that came up when using this for MW. added support for
IsValid()
andGetAmount()
where the explicit amount of a naked blinder is assumed to always be zero.also, the code had no specific execution pathway for a naked blinder in the
TxToJSON()
function (i noticed this when attempting to rundecoderuntransaction
). Instead of failing theIsExplicit()
check and defaulting to theelse
statement, I changed it to explicitly checkIsCommitment()
andIsBlinder()
so that they can be handled on their own. Theassert(0)
at the end should never be reached and will serve as a fail fast reminder in case anyone adds more output types or something. This should probably be added to the main elements code but I presume naked blinder support will be merged at some point so i'll keep it in this PR.Also, a test should be added at some point that creates a tx with a naked blinder. If not, my (eventual) MW PR will certainly have txs that have this and will be tested against.