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

Migrate XCM TS tests to Moonwall #2441

Merged
merged 115 commits into from
Aug 24, 2023
Merged

Migrate XCM TS tests to Moonwall #2441

merged 115 commits into from
Aug 24, 2023

Conversation

Agusrodri
Copy link
Contributor

@Agusrodri Agusrodri commented Aug 16, 2023

What does it do?

Performs the entire migration of the XCM TS tests to Moonwall framework. I have also adapted all the XCM tests that were written in XCM V2 (mostly building messages using this version) to also test them against XCM V3.

Notes

  • Tests that make use of V2 are present inside test-xcm-v2 folder.
  • Tests that make use of V3 are present inside test-xcm-v3 folder.
  • Tests that don't make use of any specific version to test XCM related features, are present inside the test-xcm-v3 folder (like test-xcm-transactor ones for instance).

@Agusrodri Agusrodri added D2-notlive PR doesn't change runtime/client code not-breaking Does not need to be mentioned in breaking changes labels Aug 16, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 16, 2023

Coverage generated "Tue Aug 22 15:08:19 UTC 2023":
https://d3ifz9vhxc2wtb.cloudfront.net/pulls/2441/html/index.html

Master coverage: 87.39%
Pull coverage:

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.

I realise that a lot of these tests are ported over from old ones, but there is a lot of unnecessary casting to any across tests - presumably from when the tests predated the api-augment package we have lovingly made. This should be removed as we want type safety in our tests where possible.

I've only done one comment for each new change, because there is a lot of overlapping copypasting (so probably best solved with find& replace).

Other than that, theres a few comments to use some of the moonwall library functions and polkadotJs types, so we dont rely on hardcoded string/replaces.

test/helpers/constants.ts Outdated Show resolved Hide resolved
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.

I was mistaken with previous comment, V1 & V2 referred to XcmPrimitivesEthereumXcmEthereumXcmTransaction not XCM version.

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.

Looks great 💪

@Agusrodri Agusrodri merged commit a395d45 into master Aug 24, 2023
26 checks passed
@Agusrodri Agusrodri deleted the agustin-xcm-test-migration branch August 24, 2023 15:17
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

4 participants