Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Transfer debt #1615

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Fix: Transfer debt #1615

merged 4 commits into from
Nov 21, 2023

Conversation

mustermeiszer
Copy link
Collaborator

Description

Issuers need to have the possibility to transfer debt between loans without restrictions. In the future we might add restrictions back, but based on a per pool setup, so investors know for each pool what to expect.

Fixes issues that our issuers are having.

Furthermore, this change allows to deterministically derive a ChangeId for a given proposed change, as we exclude the time of submission from the hash. This means, that equal changes will overwrite past onces, but that is fine as it just means we are extending the time of execution for that change.

Changes and Descriptions

  • ChangeId now Blake256(Change)
  • Change::TransferDebt has no restrictions

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

hieronx
hieronx previously approved these changes Nov 21, 2023
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

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

@lemunozm should approve but LGTM!

lemunozm
lemunozm previously approved these changes Nov 21, 2023
Comment on lines 409 to 411
// NOTE: Essentially, this key-generation allows to override previously
// submitted changes, if they are identical.
let change_id: Self::ChangeId = T::Hashing::hash(&change.encode());
Copy link
Contributor

Choose a reason for hiding this comment

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

I like it!

@wischli wischli added I3-annoyance The code behaves as expected, but "expected" is an issue. P7-asap Issue should be addressed in the next days. D2-notify Pull request can be merged and notification about changes should be documented. labels Nov 21, 2023
@mustermeiszer mustermeiszer dismissed stale reviews from lemunozm and hieronx via c35d0b7 November 21, 2023 12:02
@mustermeiszer mustermeiszer enabled auto-merge (squash) November 21, 2023 12:02
lemunozm
lemunozm previously approved these changes Nov 21, 2023
hieronx
hieronx previously approved these changes Nov 21, 2023
@mustermeiszer mustermeiszer dismissed stale reviews from hieronx and lemunozm via 8d6aa2f November 21, 2023 16:46
@mustermeiszer mustermeiszer merged commit 1a952f3 into main Nov 21, 2023
9 checks passed
wischli pushed a commit that referenced this pull request Nov 22, 2023
* fix: blocking transfer debt by epoch and redemptions.

* feat: make change_id deterministic

* fix: build
wischli added a commit that referenced this pull request Dec 7, 2023
* feat: new weights altair

* feat: new weights centrifuge

* wip

* migrations: Add migration for account data

* migrations: Adjust pre upgrade logic for accounts

* migrations: Log total count for accounts

* migrations: Log total count for accounts with frozen and reserved balance

* deps: Remove double orml-tokens dep

* migrations: Add test account data for balances

* fix: account info checks

* fix: local docker setup

* CI release bug fixes  (#1611)

* Fix main branch detection for docker build

* Try out GHA for Pages deployment

* Docker build clean up workflow

* publish docker in all non-PR events

* fix docs cache (github token)

* Deploy docs only from main branch

* revert docker build machine size

* Fix: Transfer debt (#1615)

* fix: blocking transfer debt by epoch and redemptions.

* feat: make change_id deterministic

* fix: build

* chore(deps): bump google-github-actions/auth from 1.1.1 to 1.2.0 (#1614)

Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](google-github-actions/auth@35b0e87...f105ef0)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guillermo Perez <gpmayorga@users.noreply.github.com>

* fix: minor stuff balances migration

* chore: bump development version, rm dummy migration

* chore: bump MaxFeedValues from 10 to 500

* fix: toml versions

* fix: remove balance migration from runtimes

* refactor: remove balance migration from codebase

* chore: update dev weights

* chore: update cfg weights

* chore: altair weights

* fix: enable XCM benches for dev

* chore: bump dev to 1035

chore: bump lock

* fix: missed renaming

fix: weights

fix: allowlist weights

* chore: bump client to 0.10.35

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: cdamian <17934949+cdamian@users.noreply.github.com>
Co-authored-by: William Freudenberger <w.freude@icloud.com>
Co-authored-by: Guillermo Perez <gpmayorga@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D2-notify Pull request can be merged and notification about changes should be documented. I3-annoyance The code behaves as expected, but "expected" is an issue. P7-asap Issue should be addressed in the next days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants