#update #parameters #numeric #gradually #module #cancel #value

no-std orml-gradually-update

Provides way to adjust numeric parameter gradually over a period of time

20 releases (2 stable)

new 1.1.0 Dec 10, 2024
1.0.0 Aug 1, 2024
0.13.0 Jun 26, 2024
0.8.0 Mar 18, 2024
0.1.1 Jun 5, 2020

#728 in Magic Beans

Download history 27/week @ 2024-09-15 12/week @ 2024-09-22 19/week @ 2024-09-29 160/week @ 2024-12-08

160 downloads per month

Apache-2.0

31KB
697 lines

Gradually-update module

Overview

Gradually-update module provides a way to adjust numeric parameter such as stability fee or liquidation gradually. The update code should be able to handle different numeric types such as u32, u128, Permill, FixedU128. All the values are assumed to be little-endian and unsigned.


lib.rs:

Gradually Update

A module for scheduling gradually updates to storage values.

Overview

This module exposes capabilities for scheduling updates to storage values gradually. This is useful to change parameter values gradually to ensure a smooth transition. It is also possible to cancel an update before it reaches to target value.

NOTE: Only unsigned integer value up to 128 bits are supported. But a "newtype" pattern struct that wraps an unsigned integer works too such as Permill and FixedU128.

Dependencies

~19–33MB
~555K SLoC