availproject / avail

775 stars 529 forks source link

Fix padding on rlp value #585

Closed 0xSasaPrsic closed 2 months ago

0xSasaPrsic commented 2 months ago

Pull Request type

Please add the labels corresponding to the type of changes your PR introduces:

Description

Removes H256::from_slice which panics if a provided slice is not 32 bytes. It appends leading zeros up to 32 bytes if the rlp value (message hash) has leading zeros that are trimmed.
Prevents code from panicking and gets the correct hash (32 bytes) from the storage proof/account.

Related Issues

Testing Performed

Checklist