Menu ▾ ▴

#505 Refactor: deduplicate the OpenTimestamps OTS_HEADER constant

open
nobody
2026-10-03
2026-10-03
Anonymous
No

Originally created by: Redo-San

The identical 31-byte array OTS_HEADER ([0x00, 0x4f, 0x70, 0x65, 0x6e, 0x54, ... 0x94]) is defined twice:

  • cli/commands/timestamp.js:11
  • cli/index.js:311-315

cli/index.js's upgrade action already requires ./commands/timestamp (cli/index.js:302), so export the constant from the command module and import it.

Do NOT touch

Timestamp/timestamp.js:19 and ID_Forge/id_forge.js:260 are separate browser IIFE modules — leave them alone.

Acceptance criteria

  • [ ] node --test cli/tests/timestamp_command_test.js passes.
  • [ ] node cli/index.js --help still lists upgrade.
  • [ ] Only one OTS_HEADER = [ definition remains under cli/ (excluding cli/tests/).

Discussion


Log in to post a comment.