Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Tests for pallet-tx-pause #12259

Merged
merged 8 commits into from
Sep 21, 2022
Merged

Tests for pallet-tx-pause #12259

merged 8 commits into from
Sep 21, 2022

Conversation

nuke-web3
Copy link
Contributor

@nuke-web3 nuke-web3 commented Sep 13, 2022

Ready for first draft quick review

  • Confirm all positive and negative test cases complete coverage we need
  • benchmarking complete
  • outstanding TODOs resolved
  • Review ecosystem pallets for logic and test for related pallets

@nuke-web3 nuke-web3 self-assigned this Sep 13, 2022
@nuke-web3 nuke-web3 marked this pull request as draft September 13, 2022 19:23
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Sep 13, 2022
@nuke-web3 nuke-web3 marked this pull request as ready for review September 21, 2022 21:02
@nuke-web3 nuke-web3 added A3-needsresolving B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Sep 21, 2022
@nuke-web3
Copy link
Contributor Author

moving to complete on #12092

@nuke-web3 nuke-web3 merged commit 7f8688e into oty-safe-mode Sep 21, 2022
@nuke-web3 nuke-web3 deleted the ds/test-tx-pause branch September 21, 2022 21:05
paritytech-processbot bot pushed a commit that referenced this pull request Aug 25, 2023
* Add safe-mode

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update pallet

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add to kitchensink-runtime

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Spelling

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Rename to tx-pause

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add SafeMode pallet

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Automatically disable safe-mode in on_init…

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add permissionless enable+extend

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add repay+slash stake methods

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix stakes storage

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Genesis config for safe-mode pallet

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Genesis config for safe-mode pallet

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Rename ExtrinsicName to FunctionName

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Origin variable duration

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Rename FunctionName -> CallName

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Rename and docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Pallet safe mode tests (#12148)

* Add safe-mode mock runtime
* Add safe-mode tests
* Add ForceEnable- and ForceExtendOrigin
* Start dummy benchmarks
Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Tests for `pallet-tx-pause` (#12259)

* mock added
* tests added
* dummy benchmarks started

* rename to active/inactive
tests broken, in progress

* Runtime types, fix tests

* WIP safe mode and tx pause {continued} (#12371)

* test coverage on safe mode and tx pause
* benchmarks & tests
* tests passing, use FullNameOf to check tx-pause unfilterables
* naming updates

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Set block number

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* dummy weights generated, safe mode

* add repay_reservation call with RepaymentDelay per #10033 feature requirements

* make call name optional to allow pausing pallets, handle `Contains` correctly for this throughout, doc comments started

* move to full_name notation for all interfaces, last commit introduced 1 more storage read.

* refactor is_paused

* safe math on safe mode

* Make stuff compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Cleanup & renames

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Cleanup TxPause pallet

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix benches

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Refactor to fungibles::* and rename stuf

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix node config

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Typos

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove CausalHoldReason

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Refactor benchmarks and runtime configs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add traits

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove old code

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Cleanup safe-mode benches

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update frame/safe-mode/Cargo.toml

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/safe-mode/Cargo.toml

Co-authored-by: Liam Aharon <[email protected]>

* Docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove getters

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove phantom

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove phantom

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Liam Aharon <[email protected]>

* Use new as Origin benchmarking syntax

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix node

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix tx-pause benches

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Renames

* Remove duplicate test

* Add docs

* docs

* Apply suggestions from code review

Co-authored-by: Liam Aharon <[email protected]>
Co-authored-by: Muharem Ismailov <[email protected]>
Co-authored-by: Gonçalo Pestana <[email protected]>

* Cleanup tests

* docs

* Cleanup GenesisConfigs

* Doc traits

* Remove PauseTooLongNames

* docs

* Use V2 benchmarking

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use RuntimeHoldReason

* Fix kitchensink runtime

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Rename Stake to Deposit

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add Notify and test it

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix kitchensink

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update frame/safe-mode/src/tests.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/safe-mode/src/tests.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/tx_pause.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/tx-pause/src/lib.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/tx-pause/src/lib.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/tx-pause/src/mock.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Simplify code

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Update frame/support/src/traits/safe_mode.rs

Co-authored-by: Liam Aharon <[email protected]>

* Fixup merge

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make stuff compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make tx-pause compile again

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix features

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix more features

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_safe_mode

* Update weights

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Dan Shields <[email protected]>
Co-authored-by: Dan Shields <[email protected]>
Co-authored-by: Liam Aharon <[email protected]>
Co-authored-by: Muharem Ismailov <[email protected]>
Co-authored-by: Gonçalo Pestana <[email protected]>
Co-authored-by: command-bot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants