To date, there are 10 published implementations of the SCALE Codec. Since each is implemented by a different team & the reference implementation still introduces small fixes, it would be beneficial to compile a table of feature-completeness. This would provide (some) assurance that the implementation in a given language is safe & sound to use.
Scale-codec-comarator provides the FFI function of the parity-scale-codec library, which can compare the implementation results of various SCALE Codecs
GitHub action is integrated to run unit tests using the FFI of Rust lib
The tests of the following scale libraries have been completed
- scale.go https://github.com/itering/scale.go
- scale.rb https://github.com/itering/scale.rb
- php-scale-codec https://github.com/gmajor-encrypt/php-scale-codec
- polkadot-js https://github.com/polkadot-js/api
- py-scale-codec https://github.com/polkascan/py-scale-codec
- cScale https://github.com/MatthewDarnell/cScale
- as-scale-codec https://github.com/LimeChain/as-scale-codec
- go-substrate-rpc-client https://github.com/centrifuge/go-substrate-rpc-client/tree/master/scale
- scale-codec-js-library https://github.com/soramitsu/scale-codec-js-library
- scale-codec-cpp https://github.com/soramitsu/scale-codec-cpp
- scale-ts https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#scale-ts
make
The FFI are definitions here https://github.com/gmajor-encrypt/scale-codec-comparator/blob/main/src/scale_ffi.h
We use the reference implementation as the standard result to compare with the results of other implementations of the SCALE Codec test. If the test fails, the implementation is inconsistent with parity-scale. You can simply get the test results from the top badges.
cd scale.go && go test -v ./...
cd php-scale-codec && composer install && make
cd scale.rb && bundle install && bundle exec rspec spec/base_spec.rb
cd polkadot-js && npm install && npm run test
cd py-scale-codec && pip install -r requirements.txt && python -m unittest discover
cd scale-ts && npm install && npm run test
cd scale-codec-js-library && npm install && npm run test
cd go-substrate-rpc-client && go test -v ./...
cd as-scale-codec-wasm && npm run asbuild ## build as-scale-codec wasm
cd ../as-scale-codec && npm run test
cd cScale && git submodule update --init --recursive && cmake --build . && ./MyProject
cd scale-codec-cpp && cmake . && cmake --build . --target scaleCodecCpp -j 8 && ./scaleCodecCpp
Dependabot here declares that all the above libs will be automatically updated and tested through pull requests if there is a new version. Here are a few examples:
The package is available as open source under the terms of the MIT License