#should storage `set` functions accept a `min_ledgers_to_live` argument?

4 messages · Page 1 of 1 (latest)

fresh spruce
#

Seems like setting and bumping so commonly appear together. This can also force developer to think about sensible expiration, rather than to succumb to defaults.

This seems especially relevant for temporary entries with a known timeout

From the token contract:

    e.storage().temporary().set(&key.clone(), &allowance);

    if amount > 0 {
        e.storage().temporary().bump(
            &key,
            expiration_ledger
                .checked_sub(e.ledger().sequence())
                .unwrap(),
        )
    }
fresh spruce
#

oops.

#

consider me a supporter of the petition