Page MenuHomePhabricator

[Chronik] Add `Script` and `ScriptMut`
ClosedPublic

Authored by tobias_ruck on Apr 1 2023, 19:30.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC8e93604814ca: [Chronik] Add `Script` and `ScriptMut`
Summary

We use two structs to represent Bitcoin scripts:

  • Script: An immutable and cheap to copy script.
  • ScriptMut: A mutable script with helpful functions to modify scripts.

Depends on D13528.

Test Plan

ninja check-crates

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-script
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22899
Build 45418: Build Diffbuild-chronik
Build 45417: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Apr 3 2023, 09:22
Fabien added inline comments.
chronik/bitcoinsuite-core/src/script/script.rs
108 ↗(On Diff #39126)

67, or 1 + UncompressedPubKey::SIZE + 1 if you feel like being verbose (then do the same for compressed key)

chronik/bitcoinsuite-core/src/script/script_mut.rs
43 ↗(On Diff #39126)

unnecessary copy/pasta

This revision now requires changes to proceed.Apr 3 2023, 09:22

Fix script capacities, remove some dead code

This revision is now accepted and ready to land.Apr 3 2023, 10:20
This revision was automatically updated to reflect the committed changes.