[Phase 4] polkadot.js Compatibility Testing (Issue #44)#61
Merged
gmajor-encrypt merged 1 commit intomasterfrom Mar 25, 2026
Merged
[Phase 4] polkadot.js Compatibility Testing (Issue #44)#61gmajor-encrypt merged 1 commit intomasterfrom
gmajor-encrypt merged 1 commit intomasterfrom
Conversation
- Add compat/ directory with compatibility test framework - Add test vectors for all SCALE types (from polkadot.js reference) - Add PHP compatibility test runner - Add Node.js test runner for comparison with polkadot.js - Add `make compat` target - Document test categories and usage Test coverage: - Integer types: U8, U16, U32, U64, U128, I8, I16, I32, I64 - Compact integers - Boolean - String/Text - Vec<T>, Option<T> Closes #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a compatibility testing framework to ensure php-scale-codec produces the same encoding results as polkadot.js SCALE codec reference.
Files Added
compat/ directory:
README.md- Documentation and usagepackage.json- Node.js dependencies for polkadot.js teststests/test-vectors.json- Known good encoding values from polkadot.jstests/php-compatibility-test.php- PHP test runnertests/run-compatibility-tests.js- Node.js test runnertests/generate-test-data.js- Test data generatorMakefile:
make compattarget for running compatibility testsTest Coverage
Test Vectors
Test vectors in
test-vectors.jsoncontain:Running Tests
Tasks from Issue #44
Closes #44