Closed karim-en closed 1 year ago
How about introducing helper functions for storage writes too? It’s a nit, but I think it would improve readability.
#[inline] fn up_set_duration(key: __UpgradableStorageKey, duration: &near_sdk::Duration) { near_sdk::env::storage_write(self.up_storage_key(key).as_ref(), duration.to_be_bytes()); } // Same for `fn up_set_timestamp`.
These functions would be the counterparts of
up_get_{duration, timestamp}
.Please remember to update the Upgradable section in the root README.
fixed in : 6489041834e6f7040f583b6795f15eebfc4cee30 3a1f09ae8c752f110adc5a8e3db688cc63a18781
How about using the term
delay
instead ofstaging duration
in the code? I think that could make things clearer, for instance:fn up_stage_new_delay(&self, delay: Option<near_sdk::Duration>); // instead of fn up_stage_update_staging_duration(&self, staging_duration: Option<near_sdk::Duration>);
There are events for
StageCode
andDeployCode
.I think it would make sense to also have events like
StageDelay
andSetDelay
The term staging duration
is already used in the NEP, NEP implementation, so I am skeptical about adding new terminology
Implement #20
Added apis:
Added storage keys: