Update Substrate with vesting (#1790)

* Update Substrate with vesting

* Update balances & vesting queries with compat)

* Split base account queries

* Linting, simpler referendum voters

* Fix (some) tests
This commit is contained in:
Jaco Greeff
2020-02-02 08:50:37 +01:00
committed by GitHub
parent f9d569ddd1
commit 9d4b0ea56a
27 changed files with 577 additions and 185 deletions
@@ -1133,71 +1133,22 @@
]
},
{
"name": "Vesting",
"modifier": "optional",
"type": {
"Map": {
"hasher": "blake2256",
"key": "AccountId",
"value": "VestingSchedule",
"linked": false
}
},
"fallback": "0x00",
"documentation": [
" Information regarding the vesting of a given account."
]
},
{
"name": "FreeBalance",
"name": "Account",
"modifier": "default",
"type": {
"Map": {
"hasher": "blake2256",
"key": "AccountId",
"value": "Balance",
"value": "AccountData",
"linked": false
}
},
"fallback": "0x00000000000000000000000000000000",
"fallback": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"documentation": [
" The 'free' balance of a given account.",
" The balance of an account.",
"",
" This is the only balance that matters in terms of most operations on tokens. It",
" alone is used to determine the balance when in the contract execution environment. When this",
" balance falls below the value of `ExistentialDeposit`, then the 'current account' is",
" deleted: specifically `FreeBalance`. Further, the `OnFreeBalanceZero` callback",
" is invoked, giving a chance to external modules to clean up data associated with",
" the deleted account.",
"",
" `frame_system::AccountNonce` is also deleted if `ReservedBalance` is also zero (it also gets",
" collapsed to zero if it ever becomes less than `ExistentialDeposit`."
]
},
{
"name": "ReservedBalance",
"modifier": "default",
"type": {
"Map": {
"hasher": "blake2256",
"key": "AccountId",
"value": "Balance",
"linked": false
}
},
"fallback": "0x00000000000000000000000000000000",
"documentation": [
" The amount of the balance of a given account that is externally reserved; this can still get",
" slashed, but gets slashed last of all.",
"",
" This balance is a 'reserve' balance that other subsystems use in order to set aside tokens",
" that are still 'owned' by the account holder, but which are suspendable.",
"",
" When this balance falls below the value of `ExistentialDeposit`, then this 'reserve account'",
" is deleted: specifically, `ReservedBalance`.",
"",
" `frame_system::AccountNonce` is also deleted if `FreeBalance` is also zero (it also gets",
" collapsed to zero if it ever becomes less than `ExistentialDeposit`.)"
" NOTE: THIS MAY NEVER BE IN EXISTENCE AND YET HAVE A `total().is_zero()`. If the total",
" is ever zero, then the entry *MUST* be removed."
]
},
{
@@ -1213,7 +1164,21 @@
},
"fallback": "0x00",
"documentation": [
" Any liquidity locks on some account balances."
" Any liquidity locks on some account balances.",
" NOTE: Should only be accessed when setting, changing and freeing a lock."
]
},
{
"name": "IsUpgraded",
"modifier": "default",
"type": {
"Plain": "bool"
},
"fallback": "0x00",
"documentation": [
" True if network has been upgraded to this version.",
"",
" True for new networks."
]
}
]
@@ -1251,8 +1216,7 @@
" - `ensure_can_withdraw` is always called internally but has a bounded complexity.",
" - Transferring balances to accounts that did not exist before will cause",
" `T::OnNewAccount::on_new_account` to be called.",
" - Removing enough funds from an account will trigger",
" `T::DustRemoval::on_unbalanced` and `T::OnFreeBalanceZero::on_free_balance_zero`.",
" - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`.",
" - `transfer_keep_alive` works the same way as `transfer`, but has an additional",
" check that the transfer will not kill the origin account.",
"",
@@ -1398,14 +1362,6 @@
" The minimum amount required to keep an account open."
]
},
{
"name": "TransferFee",
"type": "Balance",
"value": "0x0010a5d4e80000000000000000000000",
"documentation": [
" The fee required to make a transfer."
]
},
{
"name": "CreationFee",
"type": "Balance",
@@ -2669,6 +2625,23 @@
" Get the account (and lock periods) to which another account is delegating vote."
]
},
{
"name": "Locks",
"modifier": "optional",
"type": {
"Map": {
"hasher": "blake2256",
"key": "AccountId",
"value": "BlockNumber",
"linked": false
}
},
"fallback": "0x00",
"documentation": [
" Accounts for which there are locks in action which may be removed at some point in the",
" future. The value is the block number at which the lock expires and may be removed."
]
},
{
"name": "LastTabledWasExternal",
"modifier": "default",
@@ -3057,6 +3030,16 @@
" noted, if it's the same account doing it. If it's a different account, then it'll only",
" work an additional `EnactmentPeriod` later."
]
},
{
"name": "unlock",
"args": [
{
"name": "target",
"type": "AccountId"
}
],
"documentation": []
}
],
"events": [
@@ -3218,6 +3201,15 @@
"documentation": [
" A registered preimage was removed and the deposit collected by the reaper (last item)."
]
},
{
"name": "Unlocked",
"args": [
"AccountId"
],
"documentation": [
" An account has been unlocked successfully."
]
}
],
"constants": [
@@ -3414,6 +3406,18 @@
"documentation": [
" No proposals waiting"
]
},
{
"name": "NotLocked",
"documentation": [
" The target account does not have a lock."
]
},
{
"name": "NotExpired",
"documentation": [
" The lock on the account to be unlocked has not yet expired."
]
}
]
},
@@ -5209,7 +5213,7 @@
"type": {
"Plain": "Schedule"
},
"fallback": "0x0000000001000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000008700000000000000af0000000000000001000000000000000100000000000000040000000000010010000000004000000020000000",
"fallback": "0x0000000001000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000008700000000000000af00000000000000010000000000000001000000000000006400000000000000040000000000010010000000004000000020000000",
"documentation": [
" Current cost schedule for contracts."
]
@@ -5560,14 +5564,6 @@
" to removal of a contract."
]
},
{
"name": "TransferFee",
"type": "BalanceOf",
"value": "0x0010a5d4e80000000000000000000000",
"documentation": [
" The fee required to make a transfer."
]
},
{
"name": "CreationFee",
"type": "BalanceOf",
@@ -5817,14 +5813,19 @@
"prefix": "ImOnline",
"items": [
{
"name": "GossipAt",
"name": "HeartbeatAfter",
"modifier": "default",
"type": {
"Plain": "BlockNumber"
},
"fallback": "0x00000000",
"documentation": [
" The block number when we should gossip."
" The block number after which it's ok to send heartbeats in current session.",
"",
" At the beginning of each session we set this to a value that should",
" fall roughly in the middle of the session duration.",
" The idea is to first wait for the validators to produce a block",
" in the current session, so that the heartbeat later on will not be necessary."
]
},
{
@@ -6165,9 +6166,9 @@
" Emits `IdentitySet` if successful.",
"",
" # <weight>",
" - `O(X + R)` where `X` additional-field-count (deposit-bounded).",
" - `O(X + X' + R)` where `X` additional-field-count (deposit-bounded and code-bounded).",
" - At most two balance operations.",
" - One storage mutation (codec `O(X + R)`).",
" - One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`).",
" - One event.",
" # </weight>"
]
@@ -6573,6 +6574,12 @@
"documentation": [
" The target is invalid."
]
},
{
"name": "TooManyFields",
"documentation": [
" Too many additional fields."
]
}
]
},
@@ -8021,6 +8028,115 @@
]
}
]
},
{
"name": "Vesting",
"storage": {
"prefix": "Vesting",
"items": [
{
"name": "Vesting",
"modifier": "optional",
"type": {
"Map": {
"hasher": "blake2256",
"key": "AccountId",
"value": "VestingInfo",
"linked": false
}
},
"fallback": "0x00",
"documentation": [
" Information regarding the vesting of a given account."
]
}
]
},
"calls": [
{
"name": "vest",
"args": [],
"documentation": [
" Unlock any vested funds of the sender account.",
"",
" The dispatch origin for this call must be _Signed_ and the sender must have funds still",
" locked under this module.",
"",
" Emits either `VestingCompleted` or `VestingUpdated`.",
"",
" # <weight>",
" - `O(1)`.",
" - One balance-lock operation.",
" - One storage read (codec `O(1)`) and up to one removal.",
" - One event.",
" # </weight>"
]
},
{
"name": "vest_other",
"args": [
{
"name": "target",
"type": "Address"
}
],
"documentation": [
" Unlock any vested funds of a `target` account.",
"",
" The dispatch origin for this call must be _Signed_.",
"",
" - `target`: The account whose vested funds should be unlocked. Must have funds still",
" locked under this module.",
"",
" Emits either `VestingCompleted` or `VestingUpdated`.",
"",
" # <weight>",
" - `O(1)`.",
" - Up to one account lookup.",
" - One balance-lock operation.",
" - One storage read (codec `O(1)`) and up to one removal.",
" - One event.",
" # </weight>"
]
}
],
"events": [
{
"name": "VestingUpdated",
"args": [
"AccountId",
"Balance"
],
"documentation": [
" The amount vested has been updated. This could indicate more funds are available. The",
" balance given is the amount which is left unvested (and thus locked)."
]
},
{
"name": "VestingCompleted",
"args": [
"AccountId"
],
"documentation": [
" An account (given) has become fully vested. No further vesting can happen."
]
}
],
"constants": [],
"errors": [
{
"name": "NotVesting",
"documentation": [
" The account given is not vesting."
]
},
{
"name": "ExistingVestingSchedule",
"documentation": [
" An existing vesting schedule already exists for this account that cannot be clobbered."
]
}
]
}
],
"extrinsic": {
File diff suppressed because one or more lines are too long