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

Add tests for each type of transaction #1040

Merged
merged 10 commits into from
Dec 1, 2021

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 :)

tests/tests/test-block/test-block-gas.ts Show resolved Hide resolved
tests/tests/test-contract/test-contract-incr-loop.ts Outdated Show resolved Hide resolved
tests/util/transactions.ts Outdated Show resolved Hide resolved
@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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Stephen Shelton <[email protected]>
Co-authored-by: Amar Singh <[email protected]>
Co-authored-by: Joshy Orndorff <[email protected]>

* 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 <[email protected]>
Co-authored-by: Antoine Estienne <[email protected]>
Co-authored-by: Éloïs <[email protected]>
Co-authored-by: Alan Sapede <[email protected]>
Co-authored-by: Stephen Shelton <[email protected]>
Co-authored-by: Amar Singh <[email protected]>
Co-authored-by: Joshy Orndorff <[email protected]>
Co-authored-by: girazoki <[email protected]>
Co-authored-by: Crystalin <[email protected]>
Co-authored-by: Joshy Orndorff <[email protected]>
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