migrations: `take()`should consume read and write operation weight (#4302)
#### Problem
`take()` consumes only 1 read worth of weight in
`single-block-migrations` example, while `take()`
[is](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/support/src/storage/unhashed.rs#L63)
`get() + kill()`, i.e should be 1 read + 1 write. I think this could
mislead developers who follow this example to write their migrations
---------
Co-authored-by:
Bastian Köcher <git@kchr.de>
Showing
- prdoc/pr_4302.prdoc 15 additions, 0 deletionsprdoc/pr_4302.prdoc
- substrate/frame/balances/src/migration.rs 1 addition, 1 deletionsubstrate/frame/balances/src/migration.rs
- substrate/frame/democracy/src/migrations/v1.rs 2 additions, 2 deletionssubstrate/frame/democracy/src/migrations/v1.rs
- substrate/frame/examples/single-block-migrations/src/migrations/v1.rs 4 additions, 4 deletions...ame/examples/single-block-migrations/src/migrations/v1.rs
- substrate/frame/staking/src/migrations.rs 1 addition, 1 deletionsubstrate/frame/staking/src/migrations.rs
Please register or sign in to comment