Is your feature request related to a problem? Please describe.
Currently, an error is thrown when using setVariable in a variable of type bytes and sending an string larger than 31 bytes
Describe the solution you'd like
Bytes larger than 31 bytes do have an special handling in the storage, we need to adapt.
For byte arrays that store data which is 32 or more bytes long, the main slot stores length * 2 + 1 and the data is stored as usual in keccak256(slot). This means that you can distinguish a short array from a long array by checking if the lowest bit is set: short (not set) and long (set).
There is an skipped test that should be unskipped as soon as this is working:
Mock: Editable storage logic - should be able to set bytes
Is your feature request related to a problem? Please describe. Currently, an error is thrown when using
setVariable
in a variable of typebytes
and sending an string larger than 31 bytesDescribe the solution you'd like Bytes larger than 31 bytes do have an special handling in the storage, we need to adapt.
Additional context From Hardhat Docs:
There is an skipped test that should be unskipped as soon as this is working:
Mock: Editable storage logic - should be able to set bytes