-
Notifications
You must be signed in to change notification settings - Fork 19
Separate balances between native and EVM accounts #673
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 all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
fe81abd
Use frontier fork with frame-evm-balances
dmitrylavrenov 62784a0
Update frontier
dmitrylavrenov 57888c0
Use own AccountId at precompile_set
dmitrylavrenov bf5df71
Use AccountId from pallet_evm account provider for EvmTransactionCharger
dmitrylavrenov 6802258
Update frontier
dmitrylavrenov 6aafeed
Define and use evm treasury pot account at runtime
dmitrylavrenov d394cf4
Use DustRemoval for evm balances with evm treasury pot account
dmitrylavrenov b055ae2
Define and use evm fee pot account at runtime
dmitrylavrenov d4a8375
Fix EvmTransactionCharger with account id from account provider
dmitrylavrenov cdb3351
Use EvmTransactionCharger for pallet_evm with EvmBalances and EvmFeesPot
dmitrylavrenov eabdca4
Define full account id type
dmitrylavrenov ae3cc45
Update frontier
dmitrylavrenov cf83dbc
Add evm fees and evm treasurey pot accounts into testnet genesis
dmitrylavrenov 5762e4a
Fix genesis_config test at runtime
dmitrylavrenov 2430c22
Fix fees tests at runtime
dmitrylavrenov a7d9698
Fix claims and vesting tests
dmitrylavrenov 07cefa3
Refactor genesis for fees tests
dmitrylavrenov 4adc9c9
Define a helper function to get EvmAccountId
dmitrylavrenov dfb165e
Fix fixed_supply tests
dmitrylavrenov dd7ed4a
Use EnsureAddressNever for CallOrigin at pallet-evm
dmitrylavrenov db2ac8e
Add ethereum execute test transaction into fixed supply tests
dmitrylavrenov 60cde20
Proper evm accounts info setting up at chain spec
dmitrylavrenov e94b0b2
Update frontier
dmitrylavrenov 6ed3a47
Add try-runtime features
dmitrylavrenov 67f5d45
Update frontier
dmitrylavrenov fc6d1c1
Rename AccountIdOf into EvmAccountIdOf
dmitrylavrenov bfe8b22
Update frontier
dmitrylavrenov e8c4ced
Use EvmSystem as AccountProvider for pallet_evm
dmitrylavrenov 3d47fbd
Use frontier locked/polkadot-v0.9.38 version
dmitrylavrenov dd2dcba
Merge branch 'master' into separate-evm-accounts
dmitrylavrenov d2e7d49
Remove evm fees and treasure accounts usage
dmitrylavrenov 7f4a4fb
Merge branch 'master' into separate-evm-accounts
dmitrylavrenov 57febbf
Implement configs for NativeToEvmOneToOne and EvmToNativeOneToOne
dmitrylavrenov 3d0c685
Add required pot accounts and pallet_currency_swap
dmitrylavrenov f2bae2a
Add genesis pot accounts
dmitrylavrenov 71b99ff
Integrate precompile-currency-swap into runtime
dmitrylavrenov d051113
Remove redundant genesis config field for tests
dmitrylavrenov c01527c
Properly setup dust removal and fees logic using currency swap proxy …
dmitrylavrenov 1b3dd55
Add required pot accounts at testnet genesis logic
dmitrylavrenov 16149ad
Fix tests with introduced logic
dmitrylavrenov 8e4fa80
Merge branch 'master' into separate-evm-accounts
dmitrylavrenov 28787a3
Add currency swap related tests
dmitrylavrenov 5685181
Rename BalancesPot to NativeToEvmSwapBridgePot
dmitrylavrenov 97c3884
Rename EvmBalancesPot to EvmToNativeSwapBridgePot
dmitrylavrenov c186f28
Rename evm_non_system_genesis_account to evm_genesis_account
dmitrylavrenov bb2fe07
Rename pallet ids at runtime
dmitrylavrenov 0507c03
Rename EvmToNativeProxy to EvmToNativeProxyConfig and move defintions…
dmitrylavrenov 47e31fb
Update pallets ids with numeric at the end
dmitrylavrenov 0509c17
More explisit use of EvmToNativeOneToOne at frontier precompiles
dmitrylavrenov ff44e47
More explicit use of CurrencySwap
dmitrylavrenov f8efc66
Use a vec of tuples form fot genesis evm accounts in tests
dmitrylavrenov adc89d5
Merge branch 'master' into separate-evm-accounts
dmitrylavrenov 5ed73b4
Improve docs for evm genesis account creation helper function
dmitrylavrenov 557cdcd
Remove redundant BTreeMap
dmitrylavrenov af4a45f
Fix genesis pot accounts with new pallet ids
dmitrylavrenov 9858247
Rename total_issuance_ethereum_execute to total_issuance_ethereum_tra…
dmitrylavrenov d6a0a80
Return total_issuance_evm_withdraw test
dmitrylavrenov 462f06e
Remove misadded test file
dmitrylavrenov ee64028
Change test place
dmitrylavrenov fed6101
Return evm call and create tests for fixed supply
dmitrylavrenov e6de3ea
Improve total issuance checks
dmitrylavrenov 25c5312
Add assert_total_issuance helper function
dmitrylavrenov a45c594
Add fees and dust removal related tests
dmitrylavrenov 88f01c7
Add currency_swap_precompile test
dmitrylavrenov 0c698b7
Merge branch 'master' into separate-evm-accounts
dmitrylavrenov 2bfca2d
Revert humanode prefix
dmitrylavrenov 613e324
Add total issuance assert
dmitrylavrenov aec3bd2
Properly init genesis with bridge accounts for some tests mods
dmitrylavrenov 3c08bdd
Return removed comment
dmitrylavrenov fb74ec2
Add todo to calculate proper dynamoc gas cost estimation for currency…
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.
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
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
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,62 @@ | ||
| use bridge_pot_currency_swap::ExistenceRequired; | ||
| use sp_runtime::traits::Identity; | ||
|
|
||
| use crate::{ | ||
| parameter_types, AccountId, Balances, EvmAccountId, EvmBalances, EvmToNativeSwapBridgePot, | ||
| FeesPot, NativeToEvmSwapBridgePot, TreasuryPot, | ||
| }; | ||
|
|
||
| parameter_types! { | ||
| pub NativeToEvmSwapBridgePotAccountId: AccountId = NativeToEvmSwapBridgePot::account_id(); | ||
| pub EvmToNativeSwapBridgePotAccountId: EvmAccountId = EvmToNativeSwapBridgePot::account_id(); | ||
| } | ||
|
|
||
| pub type NativeToEvmOneToOne = | ||
| bridge_pot_currency_swap::CurrencySwap<NativeToEvmOneToOneConfig, ExistenceRequired>; | ||
|
|
||
| pub struct NativeToEvmOneToOneConfig; | ||
|
|
||
| impl bridge_pot_currency_swap::Config for NativeToEvmOneToOneConfig { | ||
| type AccountIdFrom = AccountId; | ||
| type AccountIdTo = EvmAccountId; | ||
| type CurrencyFrom = Balances; | ||
| type CurrencyTo = EvmBalances; | ||
| type BalanceConverter = Identity; | ||
| type PotFrom = NativeToEvmSwapBridgePotAccountId; | ||
| type PotTo = EvmToNativeSwapBridgePotAccountId; | ||
| } | ||
|
|
||
| pub type EvmToNativeOneToOne = | ||
| bridge_pot_currency_swap::CurrencySwap<EvmToNativeOneToOneConfig, ExistenceRequired>; | ||
|
|
||
| pub struct EvmToNativeOneToOneConfig; | ||
|
|
||
| impl bridge_pot_currency_swap::Config for EvmToNativeOneToOneConfig { | ||
| type AccountIdFrom = EvmAccountId; | ||
| type AccountIdTo = AccountId; | ||
| type CurrencyFrom = EvmBalances; | ||
| type CurrencyTo = Balances; | ||
| type BalanceConverter = Identity; | ||
| type PotFrom = EvmToNativeSwapBridgePotAccountId; | ||
| type PotTo = NativeToEvmSwapBridgePotAccountId; | ||
| } | ||
|
|
||
| pub struct EvmToNativeProxyConfig; | ||
|
|
||
| impl primitives_currency_swap_proxy::Config for EvmToNativeProxyConfig { | ||
| type AccountIdFrom = EvmAccountId; | ||
| type AccountIdTo = AccountId; | ||
| type CurrencySwap = EvmToNativeOneToOne; | ||
| } | ||
|
|
||
| pub type FeesPotProxy = primitives_currency_swap_proxy::SwapUnbalanced< | ||
| EvmToNativeProxyConfig, | ||
| FeesPot, | ||
| EvmToNativeSwapBridgePot, | ||
| >; | ||
|
|
||
| pub type TreasuryPotProxy = primitives_currency_swap_proxy::SwapUnbalanced< | ||
| EvmToNativeProxyConfig, | ||
| TreasuryPot, | ||
| EvmToNativeSwapBridgePot, | ||
| >; |
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.