7db4d74c43
Restructure macro-related exports into private mods for frame ( #14375 )
...
* minor refactor
* Update frame/election-provider-support/src/lib.rs
* Update frame/election-provider-support/solution-type/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* ".git/.scripts/commands/fmt/fmt.sh"
---------
Co-authored-by: Bastian Köcher <git@kchr.de >
Co-authored-by: command-bot <>
2023-06-14 12:44:01 +00:00
e71c7b259d
new pallet: whitelist pallet ( #10159 )
...
* pallet whitelist
* refactor a bit
* fmt
* address audit
* improve tests
* return Ok + refund
* add test for dispatching failing
* add dispatch_whitelisted_call_with_preimage
* fmt
* better name
* Consume all data on decode
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add error docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove phantom data
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use rust 2021
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update crate features
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_whitelist --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/whitelist/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Bump Preimage max size
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_whitelist --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/whitelist/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Parity Bot <admin@parity.io >
2022-03-01 13:31:51 +00:00
Guillaume Thiolliere
137628b4d7
Add feature: no-metadata-doc which removes doc from metadata and full-metadata which build metadata with all doc ( #10493 )
...
* add features to remove or add doc
* fmt
* add test for event/error/call
* fmt
2022-01-17 22:21:19 +01:00
Guillaume Thiolliere
cf1eb73046
Deny warning when building doc ( #10387 )
...
* deny warning
* add new job
* fix doc
* fmt
2021-12-15 20:28:18 +01:00
Guillaume Thiolliere
7f6f3322ad
improve doc ( #10431 )
2021-12-09 06:31:31 +00:00
9756615d5b
Fix pallet bags list and doc ( #10231 )
...
* fix bags list
* improve doc
* doc
* inner doc
* fix test
* Update docs in frame/election-provider-support/src/lib.rs
* fix staking impl
* prepend unsafe to clear and regenerate
* fix test
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-12-03 05:58:12 +00:00
Guillaume Thiolliere and Alexander Popiak
db28ba9dfd
Fix order of hook execution ( #10043 )
...
* fix order
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* format
* more accurate description
* format
* better explicit types
* fix tests
* address feedback
* add a type to ease non breaking implementation
* add comment about constraint
* fix test
* add test for generated types
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
2021-12-01 00:59:09 +00:00
Guillaume Thiolliere
d91125389a
ignoring errors and some fix ( #10344 )
2021-11-29 08:16:23 +00:00
Guillaume Thiolliere
76737891bb
remove unused file ( #10343 )
2021-11-23 10:28:58 +00:00
Guillaume Thiolliere
7ed4a7f022
fix ( #10342 )
2021-11-23 10:06:33 +00:00
Guillaume Thiolliere
fcfb766366
Fix some doc link ( #10329 )
...
* fix some doc link
* fmt
2021-11-22 10:48:53 +00:00
Guillaume Thiolliere and joe petrowski
1ae674dd76
Warn about usage of pallet collective set members call. ( #10156 )
...
* warn
* Apply suggestions from code review
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* fmt
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
2021-11-11 22:53:43 +00:00
Guillaume Thiolliere
2755a97fa3
handle doc on type_value ( #10132 )
2021-11-04 10:11:39 +00:00
20c9afcdc1
Better error for when origin filter prevent the call to be dispatched ( #10134 )
...
* better error
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* remove unused
* fix error
* fmt
* fix tests
* fmt
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* fix typo
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2021-11-02 14:20:00 +00:00
4292e18e50
Automatic pallet parts in construct_runtime ( #9681 )
...
* implement automatic parts
* ui tests
* rename
* remove unnecessary exclude
* better doc
* better doc
* fix genesis config
* fix UI tests
* fix UI test
* Revert "fix UI test"
This reverts commit a910351c0b24cfe42195cfd97d83a416640e3259.
* implemented used_parts
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* doc + fmt
* Update frame/support/procedural/src/construct_runtime/parse.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* add doc in the macro
* remove yet some more parts
* fix ui test
* more determnistic error message + fix ui tests
* fix ui test
* Apply suggestions from code review
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* do refactor + fix ui tests
* fmt
* fix test
* fix test
* fix ui test
* Apply suggestions from code review
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* refactor
* remove even more part in node-runtime
* fix test
* Add flow chart for the construct_runtime! execution flow
* Fix typo
* Ignore snippets that don't contain code
* Refactor some code in expand_after
* Rename expand_after to match_and_insert
* cargo fmt
* Fix rename
* Remove frame_support argument to construct_runtime_parts
* Make use of tt-call to simplify intermediate expansions
* cargo fmt
* Update match_and_insert documentation
* Reset cursor to 0 when no matching patterns are found
* Reorder struct fields on MatchAndInsertDef
* Add test for dependency renames and fix frame-support import
* Add more doc comments
* Update frame/support/test/compile_pass/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-10-31 13:55:10 +00:00
Guillaume Thiolliere
0214fde9a6
fix query details ( #10107 )
2021-10-31 10:36:26 +00:00
Guillaume Thiolliere
403b348d19
Update lowest unbaked storage. ( #9750 )
...
* update lowest unbaked
* fix format
* add note
* fmt
2021-10-18 09:19:35 +00:00
Guillaume Thiolliere and Keith Yeung
e81a425241
Root origin always bypass all filter, other origin cannot bypass BaseCallFilter even when constructed from Root origin ( #9948 )
...
* improve root filter bypass
* improve doc
* fmt
* refactor test for more understandable flow
* Update frame/support/procedural/src/construct_runtime/expand/origin.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* match
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2021-10-07 15:46:06 +00:00
Guillaume Thiolliere
f71d87ad28
remove unidiomatic ( #9895 )
2021-09-29 12:44:04 +02:00
Guillaume Thiolliere
8684b73b46
Fix WrapperOpaque max encded len and type info ( #9881 )
...
* fix wrapper opaque
* fix compilation
* improve more precise implementation
* spacing
* fmt
2021-09-29 07:48:26 +00:00
Guillaume Thiolliere and Kian Paimani
1ebcbe1c34
pallet macro: allow to declare individual unbounded storage for those who cannot go into PoV ( #9670 )
...
* allow unbounded individual storage
* better doc
* fix UI tests
* update doc
* Update frame/support/procedural/src/pallet/parse/storage.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-09-27 08:25:24 +00:00
Guillaume Thiolliere
6845666c5c
improve test ( #9835 )
2021-09-23 12:19:59 +00:00
Guillaume Thiolliere
15ecbfef16
add test ( #9822 )
2021-09-23 11:51:40 +00:00
Guillaume Thiolliere
e2dcb4b657
Improve post and pre migration checks for pallet-membership ( #9746 )
...
* improve post and pre migration checks
* prevent some more false positive
* prevent another false positive
* fix unused import
* Apply suggestions from code review
2021-09-21 12:36:53 +00:00
Guillaume Thiolliere
0930948580
add feature and fix ci ( #9800 )
2021-09-20 16:49:04 +02:00
65e5fa3aa3
Implement a CountedStorageMap ( #9125 )
...
* initial impl
* expose in pallet_prelude
* temp test
* Apply suggestions from code review
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com >
* implement with macro help.
* test for macro generation
* add iterable functions, some test and fixes
* fix merge
* doc
* Update frame/support/src/storage/types/counted_map.rs
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com >
* fix merge
* fmt
* fix spelling
* improve on removal
* fix partial storage info
* fmt
* add license
* suggested renames
* fix typo
* fix test
* fmt
* fix ui tests
* clearer doc
* better doc
* add metadata test
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com >
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com >
2021-09-16 13:20:29 +00:00
Guillaume Thiolliere
be3c59f59c
remove unused state machine ( #9747 )
2021-09-10 16:32:46 +02:00
Guillaume Thiolliere
1309adf247
remove unused origin ( #9679 )
2021-09-02 15:14:41 +00:00
Guillaume Thiolliere
6c8946ae21
fix tracker repeat writes ( #9653 )
2021-08-31 12:41:44 +00:00
Guillaume Thiolliere
a44527b288
Fix benchmark writer ( #9626 )
...
* fix benchmark writer
* update doc to show the more general implementation
2021-08-27 13:43:01 +00:00
Guillaume Thiolliere
10268c5b76
fix perthing add ( #9638 )
2021-08-27 13:07:26 +00:00
Guillaume Thiolliere
0f1896e7a2
improve doc of pallet macro ( #9625 )
...
* improve doc
* fmt
2021-08-26 01:14:09 +00:00
38db14089b
Improve call, and usage in pallet utility ( #9418 )
...
* WIP
* WIP
* WIP
* add some tests and limit
* remove wip test
* fmt
* Update bin/node/runtime/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* fmt
* use primitives allocation limit
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-08-07 09:34:25 +00:00
Guillaume Thiolliere
8f388559a1
Fix benchmarking macro for pallet with instance and where clause ( #9485 )
...
* fix benchmarking instance with where clause
* fmt
* add tests
* remove unused import
* fix tests
* doc
2021-08-04 08:45:56 +00:00
Guillaume Thiolliere
98b2455326
Refactor codec implementation for header ( #9489 )
...
* add test
* refactor
2021-08-03 15:03:06 +00:00
Guillaume Thiolliere
988c399983
fix codec ( #9445 )
2021-07-27 23:02:55 +02:00
Guillaume Thiolliere and Shawn Tabrizi
23e8088c1c
Make allocator limit available for the runtime ( #9393 )
...
* make allocator limit available
* better inner doc
* move const
* fmt
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-07-27 13:04:11 +00:00
e18f388dac
Benchmarking also benchmark for decoding the call ( #9343 )
...
* benchmark for decoding of call
* better names
* fix benchmarks
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_lottery --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/lottery/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Update frame/system/src/weights.rs
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-07-22 09:29:44 +00:00
Guillaume Thiolliere
1e8035a273
Fix invalid link in doc ( #9351 )
...
* fix invalid link
* Update client/executor/common/src/runtime_blob/globals_snapshot.rs
* more fix
2021-07-16 07:24:26 +00:00
Guillaume Thiolliere
4856b6fcf4
Remove impl_outer_ macros ( #9307 )
...
* remove impl_outer_*
* continue to reexport some unsigned in order not to break users
2021-07-12 08:50:50 +00:00
Guillaume Thiolliere
d969da8aa5
fix link ( #9289 )
2021-07-06 14:14:30 +00:00
Guillaume Thiolliere
3127eac4d7
fix storage info for decl_storage ( #9274 )
2021-07-06 01:58:24 +00:00
Guillaume Thiolliere and Keith Yeung
f96c5df754
pallet macro: always generate storage info on pallet struct ( #9246 )
...
* always implement storage info on Pallet
* fix UI test
* Fold span computation into trait and method computation
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2021-07-05 11:23:43 +00:00
Guillaume Thiolliere
0af5d6ff32
fix typo ( #9184 )
2021-06-23 10:34:54 +00:00
Guillaume Thiolliere
205ab6dee1
Avoid running some test 2 times when unneeded ( #9124 )
...
* avoid running some test 2 times when unneeded
* Update frame/support/test/Cargo.toml
2021-06-16 16:19:09 +00:00
Guillaume Thiolliere
5fa96f2ed2
Do not run pallet_ui test with conditional-storage feature ( #9122 )
...
* do not run pallet_ui test with conditional-compilation feature
* fix
2021-06-16 09:09:24 +00:00
Guillaume Thiolliere
65d3d5d4ab
execute system integrity_test also ( #9104 )
2021-06-14 21:31:04 +01:00
Guillaume Thiolliere
fdc29180f6
improve variable name ( #9108 )
2021-06-14 21:16:58 +02:00
ebf5e771fc
staking/election: prolonged era and emergency mode for governance submission. ( #8912 )
...
* Implementation but weird initial era in tests
* Emergency mode for elections. (#8918 )
* do some testing, some logging.
* some testing apparatus
* genesis election provider (#8970 )
* genesis election provider
* fix historical stuff
* Fix test
* remove dbg
* Apply suggestions from code review
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com >
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
* capitalize comment and name without conflict
* fix log
* Update frame/election-provider-multi-phase/src/lib.rs
* Update frame/election-provider-multi-phase/src/lib.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
* apply suggestion on tests
* remove testing modifications
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Dmitry Kashitsyn <korvin@deeptown.org >
* apply suggestion
* fix master merge
Co-authored-by: kianenigma <kian@parity.io >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com >
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
Co-authored-by: Dmitry Kashitsyn <korvin@deeptown.org >
2021-06-14 14:02:45 +00:00
d31e607bda
Enforce pub calls in pallets ( #9085 )
...
* make all extrinsics public so they are available from outside
* Impl
* fix
* more fix
* more pub
* few more
* merge fix
* fix ui test
* fix ui test
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Bastian Köcher <info@kchr.de >
2021-06-12 16:15:21 +00:00
Guillaume Thiolliere and Shawn Tabrizi
ea6831e398
put the validate_unsigned implementation inside the pallet definition ( #9044 )
...
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-06-08 20:54:06 +00:00
Guillaume Thiolliere and Peter Goodspeed-Niklaus
25625a0f0c
Introduce WeakBoundedVec, StorageTryAppend, and improve BoundedVec API ( #8842 )
...
* fix bounded vec doc and unsafe
* fix btree map and set and tests
* introduce weak_bounded_vec and StorageTryAppend
* fix tests and reorganize tests
* improve doc
* add doc
* Update frame/support/src/storage/weak_bounded_vec.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
* fix inner doc
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
2021-05-21 09:07:00 +00:00
Guillaume Thiolliere
693529df63
Fix transaction payment fee/tip unbalanceds ( #8860 )
...
* fix and test
* fmt
2021-05-19 18:44:50 +02:00
Guillaume Thiolliere
c48b460b2e
Improve pallet macro error message by deriving codec with no bound for Call enum ( #8851 )
...
* improve span for call
* fix stderr file paths
2021-05-19 09:23:06 +00:00
Guillaume Thiolliere
0b30049417
Allow to name the generic for storages in #[pallet::storage] ( #8751 )
...
* implement named generic for storages
* fix error message on unexpected name for generic
2021-05-19 07:11:11 +00:00
Guillaume Thiolliere and Peter Goodspeed-Niklaus
9bf62ef65d
Allow to specify some max number of values for storages in pallet macro. ( #8735 )
...
* implement max_values + storages info
* some formatting + doc
* rename StoragesInfo -> PalletStorageInfo
* merge both StorageInfoTrait and PalletStorageInfo
I think it is more future proof. In the future some storage could make
use of multiple prefix. Like one to store how much value has been
inserted, etc...
* Update frame/support/procedural/src/storage/parse.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
* Update frame/support/procedural/src/storage/storage_struct.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
* Fix max_size using hasher information
hasher now expose `max_len` which allows to computes their maximum len.
For hasher without concatenation, it is the size of the hash part,
for hasher with concatenation, it is the size of the hash part + max
encoded len of the key.
* fix tests
* fix ui tests
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
2021-05-17 13:44:24 +00:00
Guillaume Thiolliere
34e83e0be8
add test for store trait ( #8711 )
2021-05-04 19:57:26 +00:00
Guillaume Thiolliere
9ca6abe9eb
make custom on runtime upgrade prior to pallet ones ( #8687 )
2021-05-03 08:57:25 +00:00
Guillaume Thiolliere
ea10494ca9
Make pallet macro generate accessor to PalletInfo information on pallet placeholder ( #8630 )
...
* generate accessor to PalletInfo information on pallet placeholder
* remove unused
* use trait, and add tests
* less verbose doc
* add PalletInfoAccess to prelude for ease usage
2021-04-19 10:09:23 +00:00
Guillaume Thiolliere
bb343c7c26
fix doc and dyn ( #8631 )
2021-04-17 17:01:31 +02:00
Guillaume Thiolliere and Kian Paimani
a4ed9bb9b2
Ensure inherent are first ( #8173 )
...
* impl
* fix tests
* impl in execute_block
* fix tests
* add a test in frame-executive
* fix some panic warning
* use trait to get call from extrinsic
* remove unused
* fix test
* fix testing
* fix tests
* return index of extrinsic on error
* fix test
* Update primitives/inherents/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* address comments
rename trait, and refactor
* refactor + doc improvment
* fix tests
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-04-13 09:30:13 +00:00
Guillaume Thiolliere
da4518e518
Upgrade pallet atomic swap ( #8452 )
...
* upgrade pallet atomic swap
* fix doc
2021-03-26 06:46:03 +00:00
Guillaume Thiolliere
c529f13878
fix local variable names ( #8450 )
2021-03-25 10:43:20 +01:00
Guillaume Thiolliere
aeff56260c
remove outdated comment ( #8442 )
2021-03-24 10:06:41 +00:00
Guillaume Thiolliere
d343683ca9
improve doc ( #8437 )
2021-03-23 17:40:52 +01:00
1602f8dd2d
Add tracing logic in pallet macro for hooks and dispatchables ( #8305 )
...
* span in hooks
* add span for dispatchable
* Update frame/support/src/lib.rs
* Update frame/support/src/lib.rs
Co-authored-by: David <dvdplm@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: David <dvdplm@gmail.com >
2021-03-23 15:53:46 +01:00
Guillaume Thiolliere and Gavin Wood
28fa5c2b6c
Compute yearly inflation on-chain allowing to change x_ideal according to number of slots. ( #8332 )
...
* new crate
* Update frame/staking/reward-fn/src/lib.rs
Co-authored-by: Gavin Wood <gavin@parity.io >
* fix doc
Co-authored-by: Gavin Wood <gavin@parity.io >
2021-03-19 09:32:22 +01:00
Guillaume Thiolliere
9c4e4d453c
Fix doc build with --all-features ( #8277 )
...
* implement
* make default pre/post_upgrade
* simplify Cargo.toml
* revert removal of outdated/private links
* link in pallet-mmr
2021-03-05 16:08:44 +01:00
Guillaume Thiolliere
ddbdfc9e57
update nb-connect pin-project-lite rand_core ( #8249 )
2021-03-04 09:49:49 +01:00
Guillaume Thiolliere
fb8da7ea92
Allow pallet::call to return DispatchResult ( #8241 )
...
* allow dispatch result
* remove custom error message
* format
* add forgotten UI test
* fix test
* fix tests
2021-03-03 13:14:07 +01:00
Guillaume Thiolliere and Bastian Köcher
aca3332953
Add some migration helper to help migrating pallet changing pallet prefix ( #8199 )
...
* migration helper
* fix move_storage
* format
* doc
* improve doc
* Update frame/support/src/storage/migration.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-03-02 19:13:47 +01:00
Guillaume Thiolliere
9af70e93b7
make use of matches ( #8211 )
2021-03-02 19:03:05 +01:00
Guillaume Thiolliere and Shawn Tabrizi
65df4a9333
Fix ignored error in benchmark tests ( #8214 )
...
* fix ignored error in benchmark tests
* use normal format for str
* explicit match
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-26 19:50:58 +01:00
Guillaume Thiolliere and Peter Goodspeed-Niklaus
f2436b87b5
pallet macro broke benchmarks_instance, fix by introducing benchmarks_instance_pallet ( #8190 )
...
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
2021-02-25 16:25:08 +01:00
Guillaume Thiolliere
5232e8ad5c
allow to write pre and post runtime upgrade in pallet macro ( #8194 )
2021-02-25 11:43:48 +01:00
Guillaume Thiolliere
115dcd81dc
Fix: stash account reaped when ledger.active == ED ( #8170 )
...
* do not reap account when active == ed
* add tests + refactor
2021-02-22 16:46:45 +00:00
Guillaume Thiolliere
ecf4404903
Migrate examples to use pallet macro ( #8138 )
2021-02-22 12:33:35 +01:00
Guillaume Thiolliere
1b2dd6117b
Allow transfer_keep_alive to transfer all free balance ( #8125 )
2021-02-22 12:32:41 +01:00
Guillaume Thiolliere
f35a27cca0
Remove inherent in pallet-babe ( #8124 )
2021-02-16 19:03:59 +01:00
Guillaume Thiolliere
f49aae65a8
fix deprecated usage of panic ( #8134 )
2021-02-16 19:02:53 +01:00
Guillaume Thiolliere
e78d139676
pallet macro: easier syntax for #[pallet::pallet] with struct Pallet<T>(_) ( #8091 )
2021-02-10 10:27:05 +01:00
Guillaume Thiolliere and Kian Paimani
9fbbecc195
Replace last usages of <() as PalletInfo> in substrate ( #8080 )
...
* replace last occurences
* Update frame/support/src/traits.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/support/test/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* fix dispatch test
* move PanicPalletInfo to tests module
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-02-09 15:28:34 +00:00
Guillaume Thiolliere and Shawn Tabrizi
0ed683ca13
Use construct_runtime in tests ( #8059 )
...
* impl some more
* add serde
* remove unused
* fix staking fuzz
* fix system bench
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-06 20:12:46 +00:00
Guillaume Thiolliere
86498a1a0c
move some pallet test to use construct_runtime ( #8049 )
...
* migrate some more pallets
* revert example-offcahin-worker as not straightforward
* fix mmr
2021-02-04 15:57:59 +00:00
Guillaume Thiolliere
f48296e9ad
Update parity-scale-codec to 2.0 ( #7994 )
...
* update cargo.toml
* use 2.0 in mmmr
2021-01-29 12:22:45 +00:00
Guillaume Thiolliere
4e1f112059
Ensure transactional with ? works in frame v2 ( #7982 )
2021-01-26 16:42:27 +01:00
Guillaume Thiolliere
b1888395e8
Make pallet use construct_runtime in tests instead of impl_* ( #7986 )
2021-01-26 15:25:04 +01:00
Guillaume Thiolliere
681f8408ce
use construct_runtime for more pallet ( #7974 )
2021-01-25 16:24:38 +01:00
48810cd75b
Make pallets use construct_runtime ( #7950 )
...
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: David <dvdplm@gmail.com >
2021-01-25 13:20:47 +01:00
703c263079
pallet minor doc improvment ( #7922 )
...
* doc improvment
* additional fixes
* another fix
* better code suggestion
* Apply suggestions from code review
Co-authored-by: David <dvdplm@gmail.com >
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* apply suggestion
* apply suggestion
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* apply suggestion
* better guideline on reexport
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* apopiak suggestion
* clearer check suggestion
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Update frame/support/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
Co-authored-by: David <dvdplm@gmail.com >
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
2021-01-25 10:10:40 +00:00
Guillaume Thiolliere
cf37f44c38
fix template ( #7905 )
2021-01-15 12:03:08 +01:00
Guillaume Thiolliere
014e6f03c6
bumpd minor version ( #7873 )
2021-01-12 09:25:47 +01:00
Guillaume Thiolliere
66a9093fa3
Improve spans of pallet macro ( #7830 )
...
* fix spans
* convert name to snake case
2021-01-06 09:16:05 +00:00
Guillaume Thiolliere
ccce3405f4
Improve error message on where clause on pallet error ( #7821 )
...
* improve error message on where clause on pallet error
* Revert "improve error message on where clause on pallet error"
This reverts commit 5a3cc38976813fccef3357833553ce30f5b988ea.
* Revert "Revert "improve error message on where clause on pallet error""
This reverts commit e3b3fca6bc4fa89816f80dbcb82dc4536a9b2549.
2021-01-05 09:51:46 +00:00
Guillaume Thiolliere
51028310d2
fix template ( #7823 )
2021-01-04 22:17:59 +01:00
Guillaume Thiolliere
ab4c8e4fe5
remove some unecessary bound ( #7813 )
2021-01-01 17:46:38 +01:00
6dfad0921b
Add pallet attribute macro to declare pallets ( #6877 )
...
* rename system Config to system Trait.
command used:
```
find frame/ bin/ test-utils/ utils/ -name *.rs -exec sed -i 's/system::Trait>::/system::Config>::/g' {} \;
find frame/ bin/ test-utils/ utils/ -name *.rs -exec sed -i 's/impl frame_system::Trait for /impl frame_system::Config for /g' {} \;
find frame/ bin/ test-utils/ utils/ -name *.rs -exec sed -i 's/impl system::Trait for /impl system::Config for /g' {} \;
```
plus some manual ones especially for frame-support tests and frame-system
* make construct_runtime handle Pallet and Module
pallets can now be implemented on struct named Pallet or Module, both
definition are valid.
This is because next macro will generate only Pallet placeholder.
* introduce pallet attribute macro
currently just with tests, frame_system and other example hasn't been
upgraded
* allow to print some upgrade helper from decl_storage
* Improved error msg, typo.
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Improved error msg, typo.
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Improved error message on unexpected attributes + ui test
* add test for transactional
* various typo
* some tips when spans are lost
* allow pallet to depend on other pallet instances
* make event type metadata consistent with call and constant
* error messages
* ignore doc example
* fix pallet upgrade template
* fixup
* fix doc
* fix indentation
* Apply suggestions code formatting
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* some renames + fix compilation
* remove unsupported genesis config type alias
* merge fixup
* fix ui tests
* additional doc
* implement StorageInstance with new syntax
* fix line width
* fix doc: because pallet doc goes below reexport doc
* Update frame/support/procedural/src/pallet/parse/event.rs
Co-authored-by: Andrew Jones <ascjones@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/support/test/tests/pallet_ui.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* improve doc as suggested
* revert construct_runtime Pallet part.
This revert the changes on construct_runtime. Now construct_runtime is
unchanged and instead pallet macro create a type alias
`type Module<..> = Pallet<..>` to be used by construct_runtime
* refactor with less intricated code
* fix ui test with new image
* fix ui tests
* add minor tests
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Andrew Jones <ascjones@gmail.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-12-24 11:33:40 +00:00
Guillaume Thiolliere and Alexander Theißen
8814d793c7
Fix docs ( #7710 )
...
* fix docs
* Update frame/merkle-mountain-range/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2020-12-10 14:38:56 +01:00
Guillaume Thiolliere
f6198b4c1b
implement more convertion on NumberOrHex ( #7682 )
2020-12-08 10:10:46 +01:00
Guillaume Thiolliere and Bastian Köcher
7e83b7a7f2
Refactor StorageInstance trait to be usable more easily ( #7659 )
...
* refactor StorageInstance to be usable without macros
* better description
* update types doc
* Update frame/support/src/traits.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-12-03 10:51:08 +00:00