Closed clangenb closed 1 year ago
Ok, found the issue it is in the xxh64 algorithm actually (that is used by twox). cc @justkawal
Fixed on version 0.2.4
I can confirm that it is fixed on our end. Thanks for the blazingly fast fix!
I have to correct my statement, the hash seems to be wrong in other cases now, example:
final _i1.StorageValue<_i3.CeremonyPhaseType> _currentPhase = const _i1.StorageValue<_i3.CeremonyPhaseType>(
prefix: 'EncointerScheduler',
storage: 'CurrentPhase',
valueCodec: _i3.CeremonyPhaseType.codec,
);
// wrong result:
// 26dc3fa0a77526a8494180a4789f6883d9764401941df7f77a47ba7db64a6e0a
// actual value:
// 26dc3fa0a77526a8494180a4789f6883d9764401941df7f707a47ba7db64a6ea
Actual value:
It only seems to affect the last bytes.
I can confirm that the storage hash was correct before #375.
It seems I can't reopen the issue unfortunately. Shall I create a new one?
They are pretty close though haha. I wish dart itself had those hashing algorithms. I will check it later.
Totally my fault this one. When converting to hex it did not use signed 2's complement. It should be fixed now, also added this string to the tests.
Released under version: polkadart: ^0.2.5
Nice, our integration tests work again, seems to be fine, thanks a lot for this quick reaction again! 👍
In our generated code we have this:
The generated key hash:
Is wrong, the correct key hash according to polkadot-js/apps is:
So the method is wrong in this case, whereas the prefix is correct. The method has 33 characters, so my guess is that some magic happens on substrate side for prefixes > 32 bytes.