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

Frame EVM balances #65

Merged
merged 43 commits into from
Jun 20, 2023
Merged

Conversation

dmitrylavrenov
Copy link

@dmitrylavrenov dmitrylavrenov commented May 22, 2023

Tasks

  • introduce the pallet to operate account data with balances
  • implement Currency and Inspect traits for the pallet required to be used at pallet-evm
  • set up mock to be used for tests
  • implement basic tests to verify logic (balances related tests from pallet-evm tests)

@dmitrylavrenov dmitrylavrenov changed the base branch from master to locked/polkadot-v0.9.38 May 22, 2023 16:36
@dmitrylavrenov dmitrylavrenov marked this pull request as draft May 22, 2023 16:37
@dmitrylavrenov dmitrylavrenov force-pushed the frame-evm-balances branch 4 times, most recently from ec6b547 to 8115493 Compare May 30, 2023 15:55
@dmitrylavrenov dmitrylavrenov marked this pull request as ready for review May 30, 2023 15:55
@dmitrylavrenov
Copy link
Author

@MOZGIII I think it's ready for review. Will add some evm transaction related tests.

Copy link

@MOZGIII MOZGIII left a comment

Choose a reason for hiding this comment

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

What about account creation and removal (i.e. DustRemoval and hooks invocation)?

@dmitrylavrenov
Copy link
Author

dmitrylavrenov commented Jun 19, 2023

What about account creation and removal (i.e. DustRemoval and hooks invocation)?

For account creation, are you talking about this one deposit_creating? If yes, then the test currency_deposit_creating_works has been added.

For DustRemoval, is it about mocking the interface and checking usage? If yes, it should be added. But the test that account is removed if the new balance is less than ED has been added - evm_system_account_should_be_reaped.

@MOZGIII
Copy link

MOZGIII commented Jun 19, 2023

Anything that can lead to an account being created or removed, generally, should be tested...

As for how to test the DustRemoval - yes, that would require a mock. But I think we also should test that the actual account was created, and the evm-system events are properly invoked in all the relevant cases. Pretty much everything that goes through the try_mutate_exists and can potentially cause problems if implemented incorrectly on the other end.

@dmitrylavrenov
Copy link
Author

Anything that can lead to an account being created or removed, generally, should be tested...

As for how to test the DustRemoval - yes, that would require a mock. But I think we also should test that the actual account was created, and the evm-system events are properly invoked in all the relevant cases. Pretty much everything that goes through the try_mutate_exists and can potentially cause problems if implemented incorrectly on the other end.

Account removing and creation is tested with

  • evm_system_account_should_be_reaped
  • currency_deposit_creating_works

@dmitrylavrenov
Copy link
Author

dmitrylavrenov commented Jun 19, 2023

@MOZGIII EvmSystem related events checks have been added now - 30d164e

@dmitrylavrenov dmitrylavrenov merged commit 07429a3 into locked/polkadot-v0.9.38 Jun 20, 2023
@dmitrylavrenov dmitrylavrenov deleted the frame-evm-balances branch June 20, 2023 12:19
dmitrylavrenov added a commit that referenced this pull request Oct 19, 2023
* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check
dmitrylavrenov added a commit that referenced this pull request Oct 23, 2023
* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check
dmitrylavrenov added a commit that referenced this pull request Oct 25, 2023
* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check
dmitrylavrenov added a commit that referenced this pull request Oct 30, 2023
* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove deprecated generate_store

* Apply some new logic

* Fix mock

* Fix tests

* Remove license
dmitrylavrenov added a commit that referenced this pull request Oct 31, 2023
* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check
dmitrylavrenov added a commit that referenced this pull request Oct 31, 2023
* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock
dmitrylavrenov added a commit that referenced this pull request Nov 22, 2023
* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock
dmitrylavrenov added a commit that referenced this pull request Nov 22, 2023
* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests
dmitrylavrenov added a commit that referenced this pull request Dec 21, 2023
* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests
dmitrylavrenov added a commit that referenced this pull request Dec 21, 2023
* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait
dmitrylavrenov added a commit that referenced this pull request Mar 6, 2024
* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait
dmitrylavrenov added a commit that referenced this pull request Mar 6, 2024
* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait
dmitrylavrenov added a commit that referenced this pull request Mar 18, 2024
* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait
dmitrylavrenov added a commit that referenced this pull request Mar 18, 2024
* Sovereign EVM balances layer (#100)

* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait

* Support `Mutate`, `Unbalanced`, `Balanced` fungible related traits for `pallet-evm-balances` (#102)

* Move currencies implementation into separate mod

* [substrate=apply] Deprecate Currency; introduce holds and freezing into fungible traits #12951

* Apply new balances logic to currency trait implementation

* Use DustRemoval over Credit instead of NegativeImbalance

* Implement Balanced, Unbalanced, Mutate fungible traits for pallet

* Revert using negative imbalance

* Apply formatter

* Fix withdraw_consequence method

* Move currency related tests to separate mod

* Add transfer_fails_funds_unavailable test to currency tests

* Add transfer_works_full_balance test to currency tests

* Fix slashing conditions

* Add slash_works_full_balance test to currency tests

* Add deposit_into_existing related fails tests

* Add withdraw_works_full_balance test to currency tests

* Add withdraw fails related tests to currency tests

* Add basic fungible tests

* Add reducable balance test to fungible tests

* Add can deposit related tests

* Fix can_withdraw logic

* Add can_withdraw related tests

* Add write_balance_works test

* Add set_total_issuance_works test

* Add decrease_balance related tests

* Add increase_balance related tests

* Add deactivate_reactivate_works test

* Add mint_into related tests

* Add burn_from related tests

* Add shelve related tests

* Add restored related tests

* Add transfer related tests

* Add balanced related tests

* Undo formatting

* Simplify reducible logic implementation

* Simplify can_deposit implementation

* Simplify can_withdraw implementation

* Properly use semantics of total and free balances

* Improve reducable_balance_works test

* Fix test race conditions
dmitrylavrenov added a commit that referenced this pull request Jun 11, 2024
* Sovereign EVM balances layer (#100)

* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait

* Support `Mutate`, `Unbalanced`, `Balanced` fungible related traits for `pallet-evm-balances` (#102)

* Move currencies implementation into separate mod

* [substrate=apply] Deprecate Currency; introduce holds and freezing into fungible traits #12951

* Apply new balances logic to currency trait implementation

* Use DustRemoval over Credit instead of NegativeImbalance

* Implement Balanced, Unbalanced, Mutate fungible traits for pallet

* Revert using negative imbalance

* Apply formatter

* Fix withdraw_consequence method

* Move currency related tests to separate mod

* Add transfer_fails_funds_unavailable test to currency tests

* Add transfer_works_full_balance test to currency tests

* Fix slashing conditions

* Add slash_works_full_balance test to currency tests

* Add deposit_into_existing related fails tests

* Add withdraw_works_full_balance test to currency tests

* Add withdraw fails related tests to currency tests

* Add basic fungible tests

* Add reducable balance test to fungible tests

* Add can deposit related tests

* Fix can_withdraw logic

* Add can_withdraw related tests

* Add write_balance_works test

* Add set_total_issuance_works test

* Add decrease_balance related tests

* Add increase_balance related tests

* Add deactivate_reactivate_works test

* Add mint_into related tests

* Add burn_from related tests

* Add shelve related tests

* Add restored related tests

* Add transfer related tests

* Add balanced related tests

* Undo formatting

* Simplify reducible logic implementation

* Simplify can_deposit implementation

* Simplify can_withdraw implementation

* Properly use semantics of total and free balances

* Improve reducable_balance_works test

* Fix test race conditions
dmitrylavrenov added a commit that referenced this pull request Jun 11, 2024
* Sovereign EVM balances layer (#109)

* Sovereign EVM balances layer (#100)

* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait

* Support `Mutate`, `Unbalanced`, `Balanced` fungible related traits for `pallet-evm-balances` (#102)

* Move currencies implementation into separate mod

* [substrate=apply] Deprecate Currency; introduce holds and freezing into fungible traits #12951

* Apply new balances logic to currency trait implementation

* Use DustRemoval over Credit instead of NegativeImbalance

* Implement Balanced, Unbalanced, Mutate fungible traits for pallet

* Revert using negative imbalance

* Apply formatter

* Fix withdraw_consequence method

* Move currency related tests to separate mod

* Add transfer_fails_funds_unavailable test to currency tests

* Add transfer_works_full_balance test to currency tests

* Fix slashing conditions

* Add slash_works_full_balance test to currency tests

* Add deposit_into_existing related fails tests

* Add withdraw_works_full_balance test to currency tests

* Add withdraw fails related tests to currency tests

* Add basic fungible tests

* Add reducable balance test to fungible tests

* Add can deposit related tests

* Fix can_withdraw logic

* Add can_withdraw related tests

* Add write_balance_works test

* Add set_total_issuance_works test

* Add decrease_balance related tests

* Add increase_balance related tests

* Add deactivate_reactivate_works test

* Add mint_into related tests

* Add burn_from related tests

* Add shelve related tests

* Add restored related tests

* Add transfer related tests

* Add balanced related tests

* Undo formatting

* Simplify reducible logic implementation

* Simplify can_deposit implementation

* Simplify can_withdraw implementation

* Properly use semantics of total and free balances

* Improve reducable_balance_works test

* Fix test race conditions

* Fix mock

* Apply formatter

* Fungible conformance tests: Inspect and Mutate (#110)

* Use u64 for evm system accounts at mock

* Apply required changes to current tests

* Include fungible conformance tests

* Add asserting total issuance invariant in tests
dmitrylavrenov added a commit that referenced this pull request Oct 21, 2024
* Sovereign EVM balances layer (#100)

* Sovereign EVM balances layer (#95)

* Sovereign EVM balances layer (#87)

* Frame EVM balances (#65)

* Add initital frame balances structure

* Add account data balances logic

* Define main types

* Add imbalances logic

* Add DustCleaner

* Implement balances related operations

* Implement currencies for the pallet

* Implement Inspect for the pallet

* Make account_data mod private

* Leave only free balance data for account

* Support try-runtime features

* Apply formatting

* Fix comment

* Add mock with evm, evm-system, evm-balances configs

* Add basic setup test

* Add fee deduction test

* Add issuance_after_tip test

* Add refunds_should_work test

* Add refunds_and_priority_should_work test

* Fix clippy in tests

* Fix basec setup works test with evm balances checks

* Remove redundant set block in tests

* Add call_should_fail_with_priority_greater_than_max_fee test

* Add call_should_succeed_with_priority_equal_to_max_fee test

* Use EvmSystem as AccountProvider in tests

* Add account_should_be_reaped test

* Add deposit_into_existing test

* Add balance_transfer_works test

* Add slashing_balance_works test

* Add withdraw_balance_works test

* Add transferring_too_high_value_should_not_panic test

* Rename test to transfer_works

* Add basic tests for currency

* Add burn and issue related tests

* Add deposit_creating_works test

* Add currency_make_free_balance_be test

* Rename evm logic related tests

* Fix comment

* Rename slashing related test

* Rename test with make free balance

* Rename test with transferring too high value

* Assert evm system account existence for currency_deposit_creating_works test

* Add EvmSystem events check

* Remove license

* Use workspace dep

* Fix mock

* Remove deprecated trait Store

* Remove deprecated storage getter

* Add Apache-2.0 license

* Fix tests

* Apply required changes for fungible inspect trait

* Support `Mutate`, `Unbalanced`, `Balanced` fungible related traits for `pallet-evm-balances` (#102)

* Move currencies implementation into separate mod

* [substrate=apply] Deprecate Currency; introduce holds and freezing into fungible traits #12951

* Apply new balances logic to currency trait implementation

* Use DustRemoval over Credit instead of NegativeImbalance

* Implement Balanced, Unbalanced, Mutate fungible traits for pallet

* Revert using negative imbalance

* Apply formatter

* Fix withdraw_consequence method

* Move currency related tests to separate mod

* Add transfer_fails_funds_unavailable test to currency tests

* Add transfer_works_full_balance test to currency tests

* Fix slashing conditions

* Add slash_works_full_balance test to currency tests

* Add deposit_into_existing related fails tests

* Add withdraw_works_full_balance test to currency tests

* Add withdraw fails related tests to currency tests

* Add basic fungible tests

* Add reducable balance test to fungible tests

* Add can deposit related tests

* Fix can_withdraw logic

* Add can_withdraw related tests

* Add write_balance_works test

* Add set_total_issuance_works test

* Add decrease_balance related tests

* Add increase_balance related tests

* Add deactivate_reactivate_works test

* Add mint_into related tests

* Add burn_from related tests

* Add shelve related tests

* Add restored related tests

* Add transfer related tests

* Add balanced related tests

* Undo formatting

* Simplify reducible logic implementation

* Simplify can_deposit implementation

* Simplify can_withdraw implementation

* Properly use semantics of total and free balances

* Improve reducable_balance_works test

* Fix test race conditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants