vechain / vechain-sdk-js

The official JavaScript SDK for VeChain.
24 stars 9 forks source link

fix: 949 blake2b256 compatibility with ethers / thor-dev-kip wip #960

Closed lucanicoladebiasi closed 3 months ago

lucanicoladebiasi commented 3 months ago

Description

The code at packages/core/src/hash/blake2b256.ts enforces the normalization form for canonical composition of hashed strings and introduce the method blake2b256OfHex to hash bytes expressed as hexadecimal. Documentation reviewed for sake of clarity.

Tests at packages/core/tests/hash/blake2b256.unit.test.ts introduce teh canonical test pattern with one test case per test to speed-up debugging. The code suggests tests to check the compatibility with thor-dev-kit but such code is commented out because the introduction of `thor-dev-kit dependency clashes with bignumber.js dependency.

Fixes # 949

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Checklist:

github-actions[bot] commented 3 months ago

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 100%
100% (3399/3399) 100% (790/790) 100% (702/702)
Title Tests Skipped Failures Errors Time
core 494 0 :zzz: 0 :x: 0 :fire: 1m 3s :stopwatch:
network 658 0 :zzz: 0 :x: 0 :fire: 3m 51s :stopwatch:
errors 48 0 :zzz: 0 :x: 0 :fire: 11.008s :stopwatch: