Skip to content

txscript: Support min int64 script num encoding.#2863

Merged
davecgh merged 1 commit intodecred:masterfrom
davecgh:txscript_allow_scriptnum_minint64
Jan 7, 2022
Merged

txscript: Support min int64 script num encoding.#2863
davecgh merged 1 commit intodecred:masterfrom
davecgh:txscript_allow_scriptnum_minint64

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented Jan 1, 2022

This modifies the encoding logic for script numbers to support encoding min int64s. This was previously not supported since the type was not public and it is not possible to achieve a min int64 within the context of the script system itself due to the strict limits it imposes.

However, now that script numbers are exported for external use and callers are not bound by the aforementioned strictness, it should be possible to encode the entire range for completeness.

In practice, callers should never realistically need to encode the value since the purpose of the type is to create encoded numbers for scripts and the value in question will be rejected upon any attempt to use it as a number when verifying scripts given it is out of range.

This modifies the encoding logic for script numbers to support encoding
min int64s.  This was previously not supported since the type was not
public and it is not possible to achieve a min int64 within the context
of the script system itself due to the strict limits it imposes.

However, now that script numbers are exported for external use and
callers are not bound by the aforementioned strictness, it should be
possible to encode the entire range for completeness.

In practice, callers should never realistically need to encode the value
since the purpose of the type is to create encoded numbers for scripts
and the value in question will be rejected upon any attempt to use it as
a number when verifying scripts given it is out of range.
@davecgh davecgh added this to the 1.8.0 milestone Jan 1, 2022
@davecgh davecgh merged commit 9969b8f into decred:master Jan 7, 2022
@davecgh davecgh deleted the txscript_allow_scriptnum_minint64 branch January 7, 2022 06:54
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.

3 participants