* Move `IsSubType` and write some docs for the trait
This moves the `IsSubType` trait from dispatch.rs to traits.rs. It also
adds docs to make the trait better understandable.
* Update frame/support/src/traits.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Rename `ModuleToIndex` to `PalletRuntimeSetup`
Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.
* Rename it to `PalletInfo`
* Remove accidentally added files
* init_logger: switch from log-based to tracing-based and add compatibility layer
* Move tracing profiling subscriber related config realization
* sp-tracing: change profiling to be a layer instead of a subscriber
* Enable profiling layer in cli
* Change all test env_logger init to sp_tracing::try_init_simple
* Remove all local env_logger dependency
* Add missing tracing-subscriber dependency
* frame-sudo: fix tests
* frame-support: fix tests
* Fix frame/pallet and executor tests
* Fix the remaining tests
* Use subscriber's try_init as recommended by @davidbarsky
* Be explict that the tracing-log feature is needed
* Set subscriber writer to stderr
* Shorter line width
* Update cargo lock tracing version
* Fix sc_tracing crate compile
* Fix sc_authority_discovery crate test
* unremove default-features
* Leave enabled to default true
* Warn if global default cannot be set
* Fix unused import
* Remove unused PROXY_TARGET
* Change all reference from rc5 to rc6
* Change all reference of rc2 to rc6
* Fix styling
* Fix typo
* make logger init error'ing
* re-fixing the test issue
Co-authored-by: Benjamin Kampmann <ben@parity.io>
* Fixes and tests
* Don't set subs be re-registered.
Also allow subs to de-register themselves and collect the deposit.
Also allow individual registering and removal of subs.
* Make it build
* Update frame/identity/src/lib.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Tests
* Add benchmarks
* Add some reasonable weights
* Docs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Only check single extrinsics weight limit in validate_transaction.
* Add missing parameter to all pallets.
* Add tests, fix default configuration.
* Bump spec version.
* Use AvailableBlockRation to calculate MaxExtrinsicWeight
* Introduce `BlockExectionWeight` and `ExtrinsicBaseWeight`
* Add new traits everywhere
* Missed one update
* fix tests
* Update `check_weight` logic
* introduce `max_extrinsic_weight` function
* fix + add tests
* format nits
* remove println
* make test a bit more clear
* Remove minimum weight
* newlines left over from find/replace
* Fix test, improve clarity
* Fix executor tests
* Extrinsic base weight same as old `MINIMUM_WEIGHT`
* fix example test
* Expose constants
* Add test for full block with operational and normal
* Initiate test environment with `BlockExecutionWeight` weight
* format nit
* Update frame/system/src/lib.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Replace `TransactionBaseFee` with `ExtrinsicBaseWeight` (#5761)
* Replace `TransactionBaseFee` with `ExtrinsicBaseFee`
* Fix stuff
* Fix and make tests better
* Forgot to update this test
* Fix priority number in test
* Remove minimum weight from merge
* Fix weight in contracts
* remove `TransactionBaseFee` from contract tests
* Let `register_extra_weight_unchecked` go past `MaximumBlockWeight`
* address feedback
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update to latest staking
* generate tests for benchmarking
* add tests, fix warnings
* starting on democracy
* impl_benchmark_tests
* Way more readable
* add test feature flag (does this work?)
* Fix `successful_origin` impl
* democracry benchmark tests
* Fix example benchmarks, add tests
* identity benchmark tests
* Update im-online benchmark tests
* try to add session benchmarking tests (problem with mock)
* staking and timestamp
* add test for treasury, issue with dynamic contains
* utility
* Vesting
* test instead of check
* hide until we figure out what is wrong
* add docs
* close code
* Create custom mock for session-pallet-benchmarking
* Use refcell pattern
* make un-pub
* test-linux-stable includes `runtime-benchmarks` feature
* Revert "test-linux-stable includes `runtime-benchmarks` feature"
This reverts commit a2dab38abd18ac3eb8a6220e4a00e687740bd38c.
* run tests in `--release`
* undo balance change
* build wasm
* Run benchmarks on block 1
* Put example benchmarks behind feature flag
* add feature to cargo.toml
* typo
* Add `frame_system` trait bound
* Update instance benchmarks too
* Benchmark pallet
* Add a bunch more benchmarks
* do nothing test
* new benchmarks
* Clean up extra tests
* Encode and Decode Vec<T::AccountId>
* Starting to migrate benchmarks to macro
* Use macro
* Remove call and storage
* Update Cargo.toml
* Add storage recalc benchmark
* Add support for custom functions in benchmark! macro
* Reset DB for storage recalc
* Feedback from review
* Add more comments
* Remove benchmark pallet from node
* Fix cargo files
* Fix comments
* Change `crate` to `super`
* missed one
* Use results of benchmark encode/decode
* Pass generic to extra functions
* reset macro to master
* Update lib.rs
* Update to use standard syntax
* Give perthigns the trait it always deserved.
* Make staking and phragmen work with the new generic per_thing
* Make everything work together 🔨
* a bit of cleanup
* Clean usage
* Bump.
* Fix name
* fix grumbles
* hopefully fix the ui test
* Some grumbles
* revamp traits again
* Better naming again.
* Add non-zero ed check on Balances genesis
* Update ED from 0 to 1
* bump impl
* bump spec
* Found remove more ed = 0
* Fix some contract tests
* Use ctx.overlay.set_balance for contracts
* Fix staking test
* Remove obsolete logic
* Allow death of payout account in society
* Update frame/balances/src/lib.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Dont create genesis balances if balance is zero in transaction payment pallet
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
* Initially scoping out of the problem
* Remove need for exiry in balance locks.
* Remove expiry from locks.
* Remove supefluous balance test
* Amalgamate pieces of balance module
* Split out vesting
* Fix tests
* Fixes for vesting.
* Docs.
* Weight docs.
* Refactor things in terms of set_balances.
* Switch out ED to be free + reserved.
* Remove on_free_balance_zero and some docs.
* Build fixes
* Update frame/vesting/src/lib.rs
Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com>
* Update frame/vesting/src/lib.rs
Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com>
* Migration
* Remove superfluous code.
* Test fixes
* Fix some tests
* Fix repatriate reserve
* Fixes
* Add test for migration
* Final cleanups
* Fix
* Indentation.
* Undo unneeded referencing
* Bump runtime version
* Fixes
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
* Expose information about the extrinsic in the metadata
This pr exposes some information about the extrinsic used in the runtime
via metadata. The following information are exposed:
- Version of the extrinsic
- List of all signed extensions used by the extrinsic.
* Increment `spec_version`
* Initial run and gun at `OnReapAccount`
* Fix some imports
* More fixes
* Whitespace
* More wack-a-mole
* Gotta catch em all
* Update lib.rs
* Small doc update
* Whitespace
* Make `decl_error!` errors usable
This pr implements support for returning errors of different pallets in
a pallet. These errors need to be declared with `decl_error!`.
The pr changes the following:
- Each dispatchable function now returns a `DispatchResult` which is an
alias for `Result<(), DispatchError>`.
- `DispatchError` is an enum that has 4 variants:
- `Other`: For storing string error messages
- `CannotLookup`: Variant that is returned when something returns a
`sp_runtime::LookupError`
- `BadOrigin`: Variant that is returned for any kind of bad origin
- `Module`: The error of a specific module. Contains the `index`,
`error` and the `message`. The index is the index of the module in
`construct_runtime!`. `error` is the index of the error in the error
enum declared by `decl_error!`. `message` is the message to the error
variant (this will not be encoded).
- `construct_runtime!` now creates a new struct `ModuleToIndex`. This
struct implements the trait `ModuleToIndex`.
- `frame_system::Trait` has a new associated type: `ModuleToIndex` that
expects the `ModuleToIndex` generated by `construct_runtime!`.
- All error strings returned in any module are being converted now to `DispatchError`.
- `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
* Fix frame system benchmarks
* Adding script for rename, could be applicable for nodes on top of it, too
* add stderr and gitlab ci features
* apply script
* fix now minor details in expected stderr
* Update the Cargo.lock
* fix name: sc-transaction -> sc-tracing
* fix rename in script, too