Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@gavofyork
Copy link
Member

Supersedes #2028

This introduces a new funky type Imbalance, which is move-only and wannabe Linear. You get one back whenever you alter a balance in a one-sided way (deposit, slash, withdraw, ...). By default when it gets dropped it'll square things up regarding the module it comes from (for balances, it will update the total issuance), but you can also split it and cancel it out with other opposing operations.

@gavofyork gavofyork added the A0-please_review Pull request needs code review. label Mar 19, 2019
Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good now, much clearer for me.

@gavofyork gavofyork dismissed joepetrowski’s stale review March 20, 2019 12:50

grumbles addressed/answered

@rphmeier rphmeier added A8-looksgood and removed A0-please_review Pull request needs code review. labels Mar 20, 2019
@rphmeier rphmeier merged commit cc8f93c into master Mar 20, 2019
@gavofyork gavofyork deleted the gav-linear-imbalance branch March 20, 2019 13:43
@xlc xlc mentioned this pull request Mar 21, 2019
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Apr 12, 2019
* Be a little safer with total issuance.

* PairT instead of _Pair

* Remove rev causing upset

* Remove fees stuff.

* Fix build (including tests)

* Update runtime, bump version

* Fix

* Handle gas refunds properly.

* Rename identifier

ala paritytech#2025

* Address grumbles

* New not-quite-linear-typing API

* Slimmer API

* More linear-type test fixes

* Fix tests

* Tidy

* Fix some grumbles

* Keep unchecked functions private

* Remove another less-than-safe currency function and ensure that
contracts module can never create cash.

* Address a few grumbles and fix tests
@4meta5 4meta5 mentioned this pull request Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants