The wallet canisters stores valuable data, so we need to make sure it is upgradable without loosing data.
This means that pre_upgrade cannot be used, because:
The solution, for critical canisters, before we have a nice stable memory API, is simply to move this code to be ran at the end of each update method. This way, if any change in (persistent but not stable) state causes some failure in the persistence in stable memory, then that call is immediately rejected.
The wallet canisters stores valuable data, so we need to make sure it is upgradable without loosing data.
This means that
pre_upgradecannot be used, because:The solution, for critical canisters, before we have a nice stable memory API, is simply to move this code to be ran at the end of each update method. This way, if any change in (persistent but not stable) state causes some failure in the persistence in stable memory, then that call is immediately rejected.