mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 07:07:59 +00:00
Refactor reward curve (#3668)
* move test in tests dir * comment * refactor
This commit is contained in:
committed by
Bastian Köcher
parent
0a469666c1
commit
e6d4a76521
@@ -96,7 +96,6 @@ members = [
|
||||
"srml/session",
|
||||
"srml/staking",
|
||||
"srml/staking/reward-curve",
|
||||
"srml/staking/reward-curve/test",
|
||||
"srml/sudo",
|
||||
"srml/system",
|
||||
"srml/timestamp",
|
||||
|
||||
@@ -8,7 +8,6 @@ edition = "2018"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
# sr-api-macros = { path = "../../../core/sr-api-macros" }
|
||||
syn = { version = "1.0", features = [ "full", "visit" ] }
|
||||
quote = "1.0"
|
||||
proc-macro2 = "1.0"
|
||||
|
||||
@@ -279,6 +279,8 @@ fn compute_points(input: &INposInput) -> Vec<(u32, u32)> {
|
||||
let mut delta_y = max_length;
|
||||
let mut y = input.max_inflation;
|
||||
|
||||
// The algorithm divide the curve in segment with vertical len and horizontal len less
|
||||
// than `max_length`. This is not very accurate in case of very consequent steep.
|
||||
while delta_y != 0 {
|
||||
let next_y = y - delta_y;
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "srml-staking-reward-curve-test"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
srml-staking-reward-curve = { path = ".." }
|
||||
sr-primitives = { path = "../../../../core/sr-primitives" }
|
||||
Reference in New Issue
Block a user