Skip to content

test: add comprehensive tests for bip66, merkle, and push_data modules#2315

Open
amussara wants to merge 1 commit intobitcoinjs:masterfrom
amussara:add-missing-module-tests
Open

test: add comprehensive tests for bip66, merkle, and push_data modules#2315
amussara wants to merge 1 commit intobitcoinjs:masterfrom
amussara:add-missing-module-tests

Conversation

@amussara
Copy link

Add test coverage for three modules that previously had no dedicated test files:

  • bip66.spec.ts: 41 tests covering DER signature check/decode/encode, including edge cases for invalid lengths, negative values, excessive padding, and encode-decode roundtrips
  • merkle.spec.ts: 10 tests covering fastMerkleRoot with empty arrays, single elements, odd/even counts, determinism, and order sensitivity
  • push_data.spec.ts: 24 tests covering encodingLength, encode, and decode for all OP_PUSHDATA variants (1/2/4), offset handling, buffer boundary checks, and encode-decode roundtrips

Add test coverage for three modules that previously had no dedicated test files:

- bip66.spec.ts: 41 tests covering DER signature check/decode/encode,
  including edge cases for invalid lengths, negative values, excessive
  padding, and encode-decode roundtrips
- merkle.spec.ts: 10 tests covering fastMerkleRoot with empty arrays,
  single elements, odd/even counts, determinism, and order sensitivity
- push_data.spec.ts: 24 tests covering encodingLength, encode, and decode
  for all OP_PUSHDATA variants (1/2/4), offset handling, buffer boundary
  checks, and encode-decode roundtrips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments