-
Notifications
You must be signed in to change notification settings - Fork 14
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: migration for earned fees #4733
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dandanlen
force-pushed
the
fix/asset-map-migration-arb
branch
from
April 5, 2024 09:12
54a31d9
to
7e5acb5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4733 +/- ##
======================================
- Coverage 72% 72% -0%
======================================
Files 421 422 +1
Lines 70683 70586 -97
Branches 70683 70586 -97
======================================
- Hits 51220 51041 -179
- Misses 17037 17112 +75
- Partials 2426 2433 +7 ☔ View full report in Codecov by Sentry. |
kylezs
approved these changes
Apr 5, 2024
Janislav
reviewed
Apr 5, 2024
syan095
added a commit
that referenced
this pull request
Apr 8, 2024
…-validator * origin/main: fix: broker flakiness on bouncer CI (#4736) fix: migration for earned fees (#4733) feat: handle prewitness deposits (#4698) Update Sdk with Arbitrum support (#4720) chore: remove insta deprecated warning (#4734) refactor: move vanity names to account roles pallet (#4719) Arbitrum backup rpc (#4730) # Conflicts: # state-chain/pallets/cf-validator/src/lib.rs # state-chain/pallets/cf-validator/src/mock.rs # state-chain/pallets/cf-validator/src/tests.rs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Closes: PRO-1289
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
Converted the stored AssetMap to a StorageDoubleMap to allow looking up the value directly. This makes storage writes more efficient (and the storage is accessed quite frequently - see the weights files).
This also makes adding new assets simpler: adding a new asset won't require storage migrations in future since the amount defaults to zero.
I also added utilites to build and AssetMap from a (possibly incomplete) list of (Asset, T) pairs. This allows backward-compatible defaulting of the value in the asset map.