fix(snapshot): set entry expiration info in set_ledger_info
#1111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've noticed some inconsistencies with snapshot creation and use where the various
*_entry_expiration
values are not set properly when create anEnv
from a snapshot that did have those values set.This could possibly be related to #1101, but I'm not sure, since Leigh seemed more focused on prng.
Refs: #1101
What
This commit updates the ledger-snapshot crate to also set the various ledger entry expiration values, if they are set on the snapshot being set in the environment.
Why
When trying to load a ledger snapshot that I've created from an
Env
with valid entry expiration values, the new Env uses the defaults (which turn out to be0
) for those expiration values.I noticed trouble trying to run
env.register_contract()
orenv.register_stellar_asset_contract()
in a test file after loading a previously valid snapshot, and receive the error:trying to bump past max expiration ledger
. (That expiration ledger, being0
ledgers from now.)Known limitations
It's possible this is deliberate, and I'm misunderstanding how to use snapshots. If that's the case, we should probably bolster documentation around ledger snapshots to communicate that.