Salary pallet (#13378)

* More drafting

* Paymaster pallet

* Fix build

* More tests

* Rename

* Rename

* Renaming

* Revert old changes

* Multi-phase payouts to avoid bank-runs

* Tests

* Tests

* Allow payment to be targeted elsewhere

* Proper ssync payment failure handling

* Test for repayment

* Docs

* Impl RankedMembers for RankedCollective

* Implement Pay for Pot (i.e. basic account).

* Benchmarks

* Weights

* Introduce Salary benchmark into node

* Fix warning

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_salary

* Update primitives/arithmetic/src/traits.rs

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>

* Update frame/salary/src/lib.rs

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>

* Update lib.rs

* Update frame/salary/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Docs

* Update frame/salary/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/salary/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Fix

* Fixes

* Fixes

* Move some salary traits stuff to a shared location

* Fix

* Update frame/salary/src/lib.rs

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

* Update frame/salary/src/lib.rs

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

* Mul floor

* Fix warnings

* Fix test

* Docs

---------

Co-authored-by: command-bot <>
Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Gavin Wood
2023-03-03 19:05:01 +00:00
committed by GitHub
parent ac4a23609c
commit e4bf9f2125
17 changed files with 1833 additions and 28 deletions
@@ -148,6 +148,20 @@ impl<
{
}
/// A meta trait for arithmetic.
///
/// Arithmetic types do all the usual stuff you'd expect numbers to do. They are guaranteed to
/// be able to represent at least `u16` values without loss, hence the trait implies `From<u16>`
/// and smaller integers. All other conversions are fallible.
pub trait AtLeast16Bit: BaseArithmetic + From<u16> {}
impl<T: BaseArithmetic + From<u16>> AtLeast16Bit for T {}
/// A meta trait for arithmetic. Same as [`AtLeast16Bit `], but also bounded to be unsigned.
pub trait AtLeast16BitUnsigned: AtLeast16Bit + Unsigned {}
impl<T: AtLeast16Bit + Unsigned> AtLeast16BitUnsigned for T {}
/// A meta trait for arithmetic.
///
/// Arithmetic types do all the usual stuff you'd expect numbers to do. They are guaranteed to