Move the check for minimal encoded arrays out of CScriptNum's
constructor and into a free function. This enables it to be used
elsewhere, and avoid hitting exceptions.
Details
Details
- Reviewers
movrcx jasonbcox matiu deadalnix - Group Reviewers
Restricted Project - Commits
- rSTAGING2b3932f10d03: Pull minimal check out of CScriptNum constr. into IsMinimalArray
rABC2b3932f10d03: Pull minimal check out of CScriptNum constr. into IsMinimalArray
make check
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- minimalarray
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2158 Build 2460: Bitcoin ABC Buildbot (legacy) Build 2459: arc lint + arc unit
Event Timeline
src/script/script.h | ||
---|---|---|
190 | nit: Most constants in this file are declared at the top and use uppercase. Should follow the style as this constant can also be referenced in Num2Bin as a pre-check to ensure the input value is <= 4 bytes. Suggest placing it under: static const int MAX_SCRIPT_SIZE = 10000; static const int DEFAUL_MAX_NUM_BYTES = 4; |
src/script/script.h | ||
---|---|---|
190 | +1 |
src/script/script.h | ||
---|---|---|
35 ↗ | (On Diff #3291) | This belong is CScriptNum like it was before. The name DEFAULT_MAX_NUM_BYTES has no meaning without context, which is why you added a comment to begin with. |
194 ↗ | (On Diff #3291) | Same thing, IsMinimalArray has no meaning outside of CScriptNum. Having it as a member called IsMinimalEncoding or something would be more appropriate. |