Commit c23da44
authored
Create E2E test suite for accounts and balances (#377)
* Init balances e2e tests (wip)
* Rework initial tests for clarity
Most of them were written with recourse to Cursor, and were just not
very useful.
* Refactor `transfer_allow_death` test
It scrutinizes the extrinsic's events and their inner data.
* Recreate tests for all Polkadot/Kusama relay/SPs
* Rework networks that run `transferAllowDeath` test
Now, at the calling site of the test tree creation function, chains can
signal whether their ED is too low to run the basic `transferAllowDeath`
test.
* Scrutinize more events in `transferAllowDeath` test
* Test non-destructive `transfer_allow_death`
* Test `force_transfer` with account reaping
* Test to `force_transfer` reaping
* Test `transfer_allow_death` below ED
* Test `force_transfer` below ED
* Test overtransferring account
* Update comments and snapshots
* Test `force_transfer` with insufficient funds
* Test self `transfer_allow_death` of near-entire balance
* Update snapshots
* Update accounts tests after merge from `master`
PR #384 required some additional fixes that auto-merge could not perform.
* Update snapshots
* Fund new test account on Bridge Hub
* Revert change to Polkadot AH multisig suite name
* Create test to liquidity restrictions bug
See paritytech/polkadot-sdk#9560 and
paritytech/polkadot-sdk#8108.
TL;DR proxy and multisig pallets are using the old `Currency` trait
and not the new fungible traits, it is possible for an operation that
is permissible to an account at a given point in time and state to
fail.
See #401
* Test liquidity restrictions when creating proxy
* Parametrize deposit-requiring action liquidity restriction test
The `balances.LiquidityRestrictions` error can occur is different
contexts, as multiple pallets still use the old `Currency::reserve`
operation.
This commit parametrizes the test to allow for different kinds of
actions to be tested, not just proxy addition.
* Extend liquidity restriction tests to cover more cases
The test now combinatorially covers several cases:
1. Reserve action can vary between staking bond and nomination pool creation
2. Lock action is always vested transfer (for now)
3. Deposit action can vary between proxy creation, referendum submission
and staking bond
* Test manual reserve/lock in liquidity restriction tests
This adds the possibility of manually set reserve/locks to the reserve/
lock actions used to combinatorially generate tests to liquidity
restrictions.
This is needed because some chains have no vesting or staking, but the
behavior should still be tested.
* Fix manual reserve/lock actions in liq. restriction tests
Fees were not being accounted for correctly when performing checks
on free/frozen balances.
* Update snapshots and accounts E2E test tree call sites
* Filter vesting as locking action on Asset Hubs
... while the AHM is pending - vesting operations are filtered, and
thus cannot be used.
* Add more comments to liquidity restriction test
Especially the action interfaces.
* Add more comments to liquidity restriction tests
* Remove leftover debug code from self-transfer test
* Fix Asset Hub test suites' use of relay chain
An invalid argument was being passed to the `scheduleInlineCallWithOrigin`
function: the base's chains block provider, instead of the relay chain's,
which is always `Local`.
* Snapshot skipped liquidity restriction tests
... instead of logging a message. Logs add some noise to CI test output.
* Apply lint fixes
* Update block numbers
* Change lock identifier used
* Remove unstable `Transfer` event from snapshots
* Update snapshots
* Simplify liquidity restriction tests
The `Balance.locks` storage is no longer modified - Polkadot Relay is
failing for an undetermined reason.
* Use nonces when setting storage
* Test `transfer_allow_death` with reserve
* Add test to `transfer_all` with reserve
* Add `force_transfer` with reserve test
* Add origin check tests for gated extrinsics
* Add tests to transfer functions with insufficient funds
* Test `transfer_all` with `keepAlive = true`
* Correct previous transfer all test snapshot
* Test `transfer_all` with `keep_alive = false`
* Correct snapshots of accounts tests
* Test `transfer_keep_alive` with source left below ED
* Split `transfer_keep_alive` tests
... into two separate tests:
1. one for chains with low ED (below a typical transfer fee)
2. one for chains with normal ED
* Test `force_adjust_total_issuance` with zero delta
* Test total issuance changes
* Test `force_unreserve` no-op cases
* Update accounts E2E test snapshots
* Update liquidity restriction test snapshots for AHs
* Test forceful unreservation of funds
* Add more self-transfer tests
* Add self-transfer test to `force_transfer`
* Add tests to `force_set_balance`
* Refactor `burn` tests into low/normal ED tests
* Update snapshots with new `burn` tests
* Test burning from account with consumer reference
* Add test to burning of entire balance (or more than it)
* Update snapshots to remove obsolete data
* Improve documentation and `README`1 parent c4d79f1 commit c23da44
29 files changed
Lines changed: 8357 additions & 42 deletions
File tree
- packages
- kusama/src
- __snapshots__
- networks/src/chains
- polkadot/src
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
91 | | - | |
| 109 | + | |
| 110 | + | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
| |||
Lines changed: 244 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
0 commit comments