HomePhabricator

[Chronik] Add `SlpScript` Python helper for functional tests

Description

[Chronik] Add SlpScript Python helper for functional tests

Summary:
SLP requires us to encode Scripts differently than CScript currently does.

SLP forbids encoding the empty bytestring with OP_0, but CScript encodes it this way. Therefore, we add SlpScript, which encodes b"" as b"\x4c\x00".

We rename __coerce_instance to _coerce_instance, as it prevents us from overriding the function. __prefix is intended to have a "private" scope, and _prefix a "protected" scope, and to override a method in a subclass we need the latter.

Test Plan: python -m unittest test_framework.chronik.script

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Jan 15 2024, 15:36
tobias_ruckPushed on Jan 15 2024, 21:45
Reviewer
Restricted Project
Differential Revision
D15171: [Chronik] Add `SlpScript` Python helper for functional tests
Parents
rABC4f10402ee964: [e.cash] Remove QUIC from roadmap
Branches
Unknown
Tags
Unknown