NIS should retain funds in reserve (#12928)

* Keep funds with receipt holder

* Counterpart is optional

* Use named reserves

* Tests

* Benchmarks

* Fixes

* Update frame/nis/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/nis/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/nis/src/lib.rs

* Update frame/nis/src/lib.rs

* Update frame/nis/src/tests.rs

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nis/src/lib.rs

* Update frame/nis/src/lib.rs

* Update frame/nis/src/lib.rs

* Update frame/nis/src/lib.rs

* Formatting

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Gavin Wood
2023-01-17 11:37:59 -03:00
committed by GitHub
parent 9f6ac763a7
commit cbcde28546
7 changed files with 826 additions and 307 deletions
+3 -1
View File
@@ -84,7 +84,7 @@ impl pallet_balances::Config<Instance1> for Test {
type AccountStore = System;
type WeightInfo = ();
type MaxLocks = ();
type MaxReserves = ();
type MaxReserves = ConstU32<1>;
type ReserveIdentifier = [u8; 8];
}
@@ -112,6 +112,7 @@ parameter_types! {
pub const MinReceipt: Perquintill = Perquintill::from_percent(1);
pub const ThawThrottle: (Perquintill, u64) = (Perquintill::from_percent(25), 5);
pub static MaxIntakeWeight: Weight = Weight::from_ref_time(2_000_000_000_000);
pub const ReserveId: [u8; 8] = *b"py/nis ";
}
ord_parameter_types! {
@@ -139,6 +140,7 @@ impl pallet_nis::Config for Test {
type MaxIntakeWeight = MaxIntakeWeight;
type MinReceipt = MinReceipt;
type ThawThrottle = ThawThrottle;
type ReserveId = ReserveId;
}
// This function basically just builds a genesis storage key/value store according to