Skip to content

Add tests for each type of transaction#1040

Merged
joelamouche merged 10 commits intomoonbeam-polkadot-v0.9.13from
tgm-0.9.13-antoine-tests
Dec 1, 2021
Merged

Add tests for each type of transaction#1040
joelamouche merged 10 commits intomoonbeam-polkadot-v0.9.13from
tgm-0.9.13-antoine-tests

Conversation

@joelamouche
Copy link
Contributor

@joelamouche joelamouche commented Nov 30, 2021

What does it do?

  • add a new describeDevMoonbeamAllEthTxTypes util wrapper that runs the tests 3 times, once for each transaction type (Legacy, eip1559 and eip2930)
  • changes the way createTransaction adn affiliated functions work
  • use it everywhere we use a web3/ethers transaction
  • for now only ethers supports all 3

What important points reviewers should know?

Is there something left for follow-up PRs?

  • when web3 supports it as well, we might want to add a few tests

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@joelamouche joelamouche changed the base branch from master to moonbeam-polkadot-v0.9.13 November 30, 2021 16:55
@joelamouche joelamouche marked this pull request as draft November 30, 2021 16:55
@joelamouche joelamouche marked this pull request as ready for review December 1, 2021 14:26
@joelamouche joelamouche changed the title WIP : Tgm 0.9.13 antoine tests Add tests for each type of transaction Dec 1, 2021
@joelamouche joelamouche added A0-pleasereview Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low Does not elevate a release containing this beyond "low priority". labels Dec 1, 2021
Copy link
Contributor Author

@joelamouche joelamouche left a comment

Choose a reason for hiding this comment

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

LGTM :)

@joelamouche joelamouche requested a review from tgmichel December 1, 2021 14:34
@tgmichel
Copy link
Contributor

tgmichel commented Dec 1, 2021

Love the solution @joelamouche ! Super nice

@tgmichel tgmichel added A8-mergeoncegreen Pull request is reviewed well. and removed A0-pleasereview Pull request needs code review. labels Dec 1, 2021
@joelamouche joelamouche merged commit 0af366f into moonbeam-polkadot-v0.9.13 Dec 1, 2021
@joelamouche joelamouche deleted the tgm-0.9.13-antoine-tests branch December 1, 2021 15:14
tgmichel added a commit that referenced this pull request Dec 24, 2021
* v0.9.13 update

* update utils to revert instead of error (using gasometer)

* improve try_dispatch util

* update assets-erc20 precompile set

* update balances-erc20 precompile

* update crowdloan-rewards precompile

* update democracy precompile

* update parachain-staking precompile

* update relay-encoder precompile

* update xcm-transactor precompile

* update xtokens precompile + remove refactored file

* update utils tests

* update asset-erc20 precompile mock/test

* update balances-erc20 precompile mock/test

* update crowdloan-rewards precompile mock/test

* update pallet-democracy precompile mock/test

* update parachain-staking precompile mock/test

* update relay-encoder precompile mock/test

* update xcm-transactor precompile mock/test

* update xtokens precompile mock/test

* toml-sort

* line length

* `TxPoolRuntimeApi` version 2

* Ethereum typed transactions

* PrecompilesType / Value for runtimes

* Add pallet_utility PalletOrigin assoc type

* Add pallet_scheduler OriginPrivilegeCmp assoc type

* Update EthereumRuntimeRPCApi `call` and `create`

* Handle typed transactions in `impl_self_contained_call`

* Update precompiles `PrecompileResult` + `is_static` + `is_precompile`

* Just match for input.len

* fmt

* Fix Erc20AssetsPrecompileSet

* Update StorageProvider impl

* Update service ConvertTransaction

* Remove service deprecated fields

* Add spawn task groups

* Add genesis schema to `frontier-schema-cache-task`

* More fixes :)

* Update tests

* fmt

* Remove parachain_id cli arg usage

* tests precompiles reverts

* `call_max_size` test for runtimes

* Filtered calls now return CallFiltered error

* VersionedMultiLocation needs to be Boxed

* Update xm-transactor tests

* fmt

* Update pallet-maintenance-mode tests

* Update frontier pin

* (ts test) update polkadotApi.tx.evm.call args

* Update frontier pin

* Add storage_schema to pallet-ethereum GenesisConfig

* Include EthereumStorageSchema::V2 in map + update frontier-schema-cache-task

* fmt

* toml-sort

* Update tests

* Add `pallet-base-fee`

* Use current base fee on precompile ts tests

* Update frontier pin

* Remove pallet ethereum configurable genesis schema

* Add tests for each type of transaction (#1040)

* Update `TransactionOptions` iface to 1559 fields

* Update tests to pass full `context` instead `web3`

* Include type and chainId in `createTransaction`

* add describeDevMoonbeamAllEthTxTypes to relevant tests

* Remove create blocks not needed

Co-authored-by: tgmichel <telmo@purestake.com>

* Impl `OnChargeEVMTransaction` in moonbase runtime

* Fix eth txn fee handling for `verifyLatestBlockFees` tests

* checker

* Update `open-runtime-module-library` pin

* Update dep pin

* Update polkadot pin

* usee struct literal syntax

* Pin substrate democracy vote events

* fmt

* Remove unused import

* Fix crowdloan ts test

* add feature force-debug for all runtimes (#1053)

* add feature force-debug for all runtimes

* apply toml_sort

* fix: AccountId20 must impl Debug (#1054)

* Adds github token to generate runtime script (#1055)

* Fix staking try runtime (attempt #2) (#1056)

* Add missing imports

* Make staking compile for try-runtime tests (#1014)

* fix

* fix lack of From impl compilation error

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Bake Moonbeam spec into the binary (#1063)

* copy spec from moonbeam-networks

* add bootnodes

* 👩‍🍳 Bake it

* Add CI workflow "Create client release ticket" (#1047)

* Add CI workflow "Create client release ticket"

* make the text impersonal

* editorconfig

* commit suggestions

* Add CI workflow "Create runtime release ticket" (#1062)

* Add CI workflow "Create runtime release ticket"

* add substitutes step

Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
Co-authored-by: Stephen Shelton <steve@brewcraft.org>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>

* Girazoki xtokens fee with extrinsic (#1007)

* change xtokens precompile to accept new extrinsic

* Remove left over encoding file

* Cleanup

* Rust integration tests

* MOdify typescript tests to try with_Fee extrinsics

* Commit the compiled contract

* Point to latest

* Re-update cargo lock

* Mimic upstream changes

* Update lock

* toml formatter

* Fix test

* Fix test

* Adapt to distinct eth tx type

* Updates test setup for parachain tests

* Updates polkadot-launch version

* Naming convention

* Update crowdloan-rewards pin

* Re-introduce `parachain-id` cli arg

* Upate nimbus pin

* Update pallet democracy precompile tests

* pin shiny new nimbus branch

* fix Cargo.lock reversions. I wonder why that happened.

* Bring manual seal hotifx into substrate hotfix branch

* Fix tests

* Update `is_precompile` fn

* Update `open-runtime-module-library` pin

* Update frontier pin

* Follow up merge

* FMT

* Prettier

* Adapt new precompiles to 0.9.13

* unused import after merge

* New for precompileset

* Fix errors in unitests

* Fix unitests

* Calls are unfiltered now

* Update frontier pin

* Update ts test `test-balance-transfer` with pending

* Update ts test `test-contract-creation` with pending

* Prettify

* Update `test-pallet-maintenance-mode`

* Fix substrate version

* Fixes test setup

Co-authored-by: nanocryk <6422796+nanocryk@users.noreply.github.com>
Co-authored-by: Antoine Estienne <antoine@purestake.com>
Co-authored-by: Éloïs <c@elo.tf>
Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
Co-authored-by: Stephen Shelton <steve@brewcraft.org>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-authored-by: girazoki <gorka.irazoki@gmail.com>
Co-authored-by: Crystalin <alan@purestake.com>
Co-authored-by: Joshy Orndorff <admin@joshyorndorff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A8-mergeoncegreen Pull request is reviewed well. B0-silent Changes should not be mentioned in any release notes C1-low Does not elevate a release containing this beyond "low priority".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants