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

Port ERC20-XCM tests. Add excess gas tests #2410

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

fgamundi
Copy link
Contributor

@fgamundi fgamundi commented Jul 26, 2023

The new tests for bad ERC20s with excessive gas usage are in test-xcm-erc20-excess-gas.ts

@fgamundi fgamundi added B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime/client code not-breaking Does not need to be mentioned in breaking changes labels Jul 26, 2023
@fgamundi fgamundi marked this pull request as ready for review July 26, 2023 12:21
Copy link
Contributor

@timbrinded timbrinded left a comment

Choose a reason for hiding this comment

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

Love it! I'm very pleased to see using the context helper methods too as that has made this very easy to read and understand.

Few comments to remove use of any and casting so that we preserve types to make maintainance easier when XCM message shapes inevitably change between versions 😅

Might be worth creating a new XCM helper util to extract error if you think it's common enough task

test/suites/dev/test-xcm/test-xcm-erc20-excess-gas.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-fees-and-trap.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-fees-and-trap.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-fees-and-trap.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-fees-and-trap.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-fees-and-trap.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-transfer.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-transfer.ts Outdated Show resolved Hide resolved
test/suites/dev/test-xcm/test-xcm-erc20-v3.ts Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

Coverage generated "Tue Aug 8 17:20:12 UTC 2023":
https://d3ifz9vhxc2wtb.cloudfront.net/pulls/2410/html/index.html

Master coverage: 87.39%
Pull coverage:

test/helpers/xcm.ts Outdated Show resolved Hide resolved
@fgamundi
Copy link
Contributor Author

fgamundi commented Aug 7, 2023

Thanks for the review! I think I covered all of it, except from the other comment I made

Copy link
Contributor

@timbrinded timbrinded left a comment

Choose a reason for hiding this comment

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

Very nice - scenarios are very legible.
There was the one comment i made that your helper shouldn't have expect in it but otherwise is LGTM

@fgamundi fgamundi merged commit d63c5ac into timbo-migrate-dev-test-2 Aug 8, 2023
16 of 17 checks passed
@fgamundi fgamundi deleted the fg-er20xcm-tests branch August 8, 2023 16:42
timbrinded added a commit that referenced this pull request Aug 10, 2023
* progress on PoV tests

* started precompile migration

* finished author precompile tests

* bn and callpermit precompiles done

* collective precompile done

* beginning conviction voting tests

* Updated to moonwall4

* fix

* added erc20 precompile tests

* progress on local asset precompile

* Added Local assets tests

* modexp tests done

* Added proxy tests

* progress on proxy tests

* finished proxy tests

* updated precompile tests

* added more precompile tests

* progress

* added more precompile tests

* refactored wormhole tests

* added XCM transactor tests

* started xcm utils tests

* Precompile tests done

* done proxy tests

* randomness tests

* randomness tests

* randomness tests

* finished randomness tests

* added receipt tests

* staking tests

* more staking tests

* more staking

* progress

* completed staking tests

* added subscription tests

* added sudo tests

* added treasury tests

* update moonwall config

* added missing conviction tests

* txpool progress

* tx pool tests done

* CI fix

* updated prettier CI

* editorconfig

* pnpm cache

* changed CI

* fix CI

* changes

* fix CI

* fixed some tests

* more test fixes

* fixed tests

* lint

* editor config

* pkg fix

* updated lockfile

* pkg updates

* fix import

* fix import

* archived old-style dev-tests

* lint

* PR comments

* Port ERC20-XCM tests. Add excess gas tests (#2410)

* ERC20XCM tests

* Add tsx

* Moved expect out of xcm helper

* Removed unused imports

* removed old tests

* editorconfig grr

* removed smoke tests

* Upgraded randomness smoketest

* updated randomness comments

* Fix conviction MaxVotes (#2401)

* Reduce the ConvictionVoting MaxVotes from 512 to 30

* Set MaxVote to 20

* Run toml-sort and update repo reference (#2426)

* [MOON-2434] remove deprecated leave delegator functionality (#2349)

* remove leave delegator functionality

* remove precompile methods

* return error for removed call indices

* removed scheduleLeaveDelegators calls

* de-bun 🫓 the CI

* fix

* smoke-fix

* fixed ci

---------

Co-authored-by: Francisco Gamundi <52399794+fgamundi@users.noreply.github.com>
Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
Agusrodri added a commit that referenced this pull request Aug 24, 2023
* progress on PoV tests

* started precompile migration

* finished author precompile tests

* bn and callpermit precompiles done

* collective precompile done

* beginning conviction voting tests

* Updated to moonwall4

* fix

* added erc20 precompile tests

* progress on local asset precompile

* Added Local assets tests

* modexp tests done

* Added proxy tests

* progress on proxy tests

* finished proxy tests

* updated precompile tests

* added more precompile tests

* progress

* added more precompile tests

* refactored wormhole tests

* added XCM transactor tests

* started xcm utils tests

* Precompile tests done

* done proxy tests

* randomness tests

* randomness tests

* randomness tests

* finished randomness tests

* added receipt tests

* staking tests

* more staking tests

* more staking

* progress

* completed staking tests

* added subscription tests

* added sudo tests

* added treasury tests

* update moonwall config

* added missing conviction tests

* txpool progress

* tx pool tests done

* CI fix

* updated prettier CI

* editorconfig

* pnpm cache

* changed CI

* fix CI

* changes

* fix CI

* fixed some tests

* more test fixes

* fixed tests

* lint

* editor config

* pkg fix

* updated lockfile

* pkg updates

* fix import

* fix import

* archived old-style dev-tests

* lint

* PR comments

* Port ERC20-XCM tests. Add excess gas tests (#2410)

* ERC20XCM tests

* Add tsx

* Moved expect out of xcm helper

* Removed unused imports

* removed old tests

* editorconfig grr

* begin xcm migration

* migrate more xcm tests to moonwall using xcmv3

* removed smoke tests

* Upgraded randomness smoketest

* updated randomness comments

* Fix conviction MaxVotes (#2401)

* Reduce the ConvictionVoting MaxVotes from 512 to 30

* Set MaxVote to 20

* Run toml-sort and update repo reference (#2426)

* [MOON-2434] remove deprecated leave delegator functionality (#2349)

* remove leave delegator functionality

* remove precompile methods

* return error for removed call indices

* removed scheduleLeaveDelegators calls

* de-bun 🫓 the CI

* fix

* migrate hrmp-asset-transfer tests

* apply some fixes

* migrate test-mock-hrmp-transact-ethereum

* small fixes

* migrate test-mock-hrmp-transact

* migrate more tests to moonwall

* migrate test-xcmv3-new-instructions and max weight

* create separate folders for v2 and v3

* migrate test-mock-hrmp-transact tests to v3

* migrate mock-hrmp-transact-ethereum tests to v3

* fix network "Any" in tests

* fix order in xcmv2 tests

* fix order in xcmv3 tests

* remove replaceNetworkAny

* prettier

* fmt

* fix orders

* remove "Any" type from test-xcm-erc20-v3-filter

* use proper GLMR constant

* remove cast to any in xcmv2 tests

* remove cast to any in xcmv3 tests and re-org

* small fixes

* add expect messages

* refactor registerForeignAsset

* fixes in test-mock-dmp-queue

* remove BN from AssetMetadata

* use proper readContract function

* use proper deployContract function

* remove BN from requireWeightAtMost

* use sovereignAccountOfSibling helper function

* remove expectOk

---------

Co-authored-by: timbrinded <79199034+timbrinded@users.noreply.github.com>
Co-authored-by: Francisco Gamundi <52399794+fgamundi@users.noreply.github.com>
Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
grw-ms pushed a commit that referenced this pull request Aug 28, 2023
* progress on PoV tests

* started precompile migration

* finished author precompile tests

* bn and callpermit precompiles done

* collective precompile done

* beginning conviction voting tests

* Updated to moonwall4

* fix

* added erc20 precompile tests

* progress on local asset precompile

* Added Local assets tests

* modexp tests done

* Added proxy tests

* progress on proxy tests

* finished proxy tests

* updated precompile tests

* added more precompile tests

* progress

* added more precompile tests

* refactored wormhole tests

* added XCM transactor tests

* started xcm utils tests

* Precompile tests done

* done proxy tests

* randomness tests

* randomness tests

* randomness tests

* finished randomness tests

* added receipt tests

* staking tests

* more staking tests

* more staking

* progress

* completed staking tests

* added subscription tests

* added sudo tests

* added treasury tests

* update moonwall config

* added missing conviction tests

* txpool progress

* tx pool tests done

* CI fix

* updated prettier CI

* editorconfig

* pnpm cache

* changed CI

* fix CI

* changes

* fix CI

* fixed some tests

* more test fixes

* fixed tests

* lint

* editor config

* pkg fix

* updated lockfile

* pkg updates

* fix import

* fix import

* archived old-style dev-tests

* lint

* PR comments

* Port ERC20-XCM tests. Add excess gas tests (#2410)

* ERC20XCM tests

* Add tsx

* Moved expect out of xcm helper

* Removed unused imports

* removed old tests

* editorconfig grr

* begin xcm migration

* migrate more xcm tests to moonwall using xcmv3

* removed smoke tests

* Upgraded randomness smoketest

* updated randomness comments

* Fix conviction MaxVotes (#2401)

* Reduce the ConvictionVoting MaxVotes from 512 to 30

* Set MaxVote to 20

* Run toml-sort and update repo reference (#2426)

* [MOON-2434] remove deprecated leave delegator functionality (#2349)

* remove leave delegator functionality

* remove precompile methods

* return error for removed call indices

* removed scheduleLeaveDelegators calls

* de-bun 🫓 the CI

* fix

* migrate hrmp-asset-transfer tests

* apply some fixes

* migrate test-mock-hrmp-transact-ethereum

* small fixes

* migrate test-mock-hrmp-transact

* migrate more tests to moonwall

* migrate test-xcmv3-new-instructions and max weight

* create separate folders for v2 and v3

* migrate test-mock-hrmp-transact tests to v3

* migrate mock-hrmp-transact-ethereum tests to v3

* fix network "Any" in tests

* fix order in xcmv2 tests

* fix order in xcmv3 tests

* remove replaceNetworkAny

* prettier

* fmt

* fix orders

* remove "Any" type from test-xcm-erc20-v3-filter

* use proper GLMR constant

* remove cast to any in xcmv2 tests

* remove cast to any in xcmv3 tests and re-org

* small fixes

* add expect messages

* refactor registerForeignAsset

* fixes in test-mock-dmp-queue

* remove BN from AssetMetadata

* use proper readContract function

* use proper deployContract function

* remove BN from requireWeightAtMost

* use sovereignAccountOfSibling helper function

* remove expectOk

---------

Co-authored-by: timbrinded <79199034+timbrinded@users.noreply.github.com>
Co-authored-by: Francisco Gamundi <52399794+fgamundi@users.noreply.github.com>
Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime/client code not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants