-
Notifications
You must be signed in to change notification settings - Fork 20
Implement bridges pot currency swap accounts inititialization #716
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
Merged
Merged
Changes from 33 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
bca632c
Initial basic implementation
dmitrylavrenov 8c0c96b
Inline implementations
dmitrylavrenov 14e2bf0
Docs and refactoring
dmitrylavrenov a71541e
Handle all bridges initial balances cases
dmitrylavrenov a976d20
Fix basic test
dmitrylavrenov 6a09b50
Properly handle edge cases
dmitrylavrenov 33f6956
Improve tests
dmitrylavrenov 96102f3
Add initialization_fails_treasury_insufficient_balance test
dmitrylavrenov b7f58c0
Update features snapshot
dmitrylavrenov 8c25bf4
Add weight value calculation
dmitrylavrenov 71c3178
Add runtime-upgrade logic
dmitrylavrenov 2d04e2a
Add runtime upgrade test
dmitrylavrenov a80bb29
Check is balanced before applying initialization
dmitrylavrenov 00cf8fc
Fix try-runtime feature related code
dmitrylavrenov 1ad8152
Rename pallet in mock
dmitrylavrenov 55ad986
Use runtime_lock and externalities logic as shared components
dmitrylavrenov 421ef86
More explicit mocks usage in tests
dmitrylavrenov 28836f8
Use a struct type for address/balance pair in tests
dmitrylavrenov 0dcc6c4
Rename version mocks
dmitrylavrenov d374d66
Add initialization idempotence test
dmitrylavrenov b2d8d28
Add initializer version storage
dmitrylavrenov 2a2617a
Add verify_balanced call
dmitrylavrenov 7e04f1c
Merge branch 'master' into pallet-bridges-init-currency-swap
dmitrylavrenov bc502f9
Edit docs
dmitrylavrenov c55b011
Twice immediate reinvocation idempotency
dmitrylavrenov 55a9f83
Add transfer with creating account to test
dmitrylavrenov f1b4304
Make is_balanced fn public
dmitrylavrenov 5ef7ed1
Fix typos
dmitrylavrenov 7bacc72
Improve docs and debug_assert for make_native_bridge_balance_be
dmitrylavrenov d10ea31
Improve docs and debug_assert for make_evm_bridge_balance_be
dmitrylavrenov 4f28682
Improve assert messages
dmitrylavrenov a5876ad
Proportionally equal natve and evm total issuances
dmitrylavrenov 63a5a27
Fix is_balanced logic to calculate different swappable balances
dmitrylavrenov 43fc65c
Rename pallet
dmitrylavrenov 5075aea
Use a helper function to calculate required bridges minimum balances
dmitrylavrenov a226350
Fix pallet renaming in tests
dmitrylavrenov 682cb95
Fix pallet renaming in features snapshot
dmitrylavrenov dc3ae88
Merge branch 'master' into pallet-bridges-init-currency-swap
dmitrylavrenov 7c7f031
Return test
dmitrylavrenov 53dde76
Add docs for tests
dmitrylavrenov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
crates/pallet-bridges-initializer-currency-swap/Cargo.toml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| [package] | ||
| name = "pallet-bridges-initializer-currency-swap" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| publish = false | ||
|
|
||
| [dependencies] | ||
| codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } | ||
| frame-support = { default-features = false, git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
| frame-system = { default-features = false, git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
| scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } | ||
| sp-std = { default-features = false, git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
| sp-tracing = { default-features = false, git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
|
|
||
| [dev-dependencies] | ||
| pallet-pot = { version = "0.1", path = "../pallet-pot", default-features = false } | ||
|
|
||
| pallet-balances = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
| sp-core = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.38" } | ||
|
|
||
| [features] | ||
| default = ["std"] | ||
| std = [ | ||
| "codec/std", | ||
| "frame-support/std", | ||
| "frame-system/std", | ||
| "pallet-balances/std", | ||
| "pallet-pot/std", | ||
| "scale-info/std", | ||
| "sp-std/std", | ||
| "sp-tracing/std", | ||
| ] | ||
| try-runtime = [ | ||
| "frame-support/try-runtime", | ||
| "frame-system/try-runtime", | ||
| "pallet-balances/try-runtime", | ||
| "pallet-pot/try-runtime", | ||
| ] | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.