HomePhabricator

[ecash-lib] Add `pushNumberOp` to push minimally encoded numbers

Description

[ecash-lib] Add pushNumberOp to push minimally encoded numbers

Summary:
Add a companion function to pushBytesOp that encodes numbers. It handles signs and little-endian conversion by replicating the CScriptNum serialization algorithm.

Depends on D16529

Test Plan: npm run test

Reviewers: tobias_ruck, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: tobias_ruck, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D16531

Details

Provenance
m4ktubAuthored on Jul 24 2024, 00:03
m4ktubPushed on Jul 24 2024, 21:55
Reviewer
Restricted Owners Package
Differential Revision
D16531: [ecash-lib] Add `pushNumberOp` to push minimally encoded numbers
Parents
rABC76ec1d497a76: [Chronik] Remove unneeded `.as_ref()` call
Branches
Unknown
Tags
Unknown