paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

fix(test-externalities): include memory db reference counts in snapshots #14411

Closed liamaharon closed 1 year ago

liamaharon commented 1 year ago

Closes https://github.com/paritytech/substrate/issues/14150

Include MemoryDb ref counts when test-externalities storage is backed up and restored from snapshots.

liamaharon commented 1 year ago

Hey @cheme, let me know if this fixes the issue you were encountering

liamaharon commented 1 year ago

Good point regarding the older snapshots. I think a good middle ground could be to detect when the user is trying to load a legacy snapshot, and let them know they need to create a new one rather than erroring with the generic "decode failed".

liamaharon commented 1 year ago

bot merge