Heorhii Lutsenko
2fb4258890
Corrected description of clear_attribute extrinsic ( #10729 )
2022-02-07 12:47:56 +00:00
nanocryk
a2251208ef
make inner field of IdentityFields pub ( #10773 )
2022-02-07 12:33:24 +00:00
Gavin Wood
a6891951fb
Referenda and Conviction Voting pallets ( #10195 )
...
* Initial draft of new referendum state machine.
* Docs
* Fixes
* Fixes
* Add conviction-voting pallet
* Basic build
* Building
* Some TODOs
* Tests building
* Add missing file
* Basic lifecycle test
* Add couple of tests
* Another test
* More tests
* Fixes
* Fixes
* Formatting
* Fixes
* Tests
* Fixes
* Fixes
* More tests
* Formatting
* First few benchmarks
* First few benchmarks
* Defered queue servicing
* More testing
* Benchmarks
* Fiddly benchmark
* Final nudge benchmarks
* Formatting
* Formatting
* Finished up benchmarks
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_referenda --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/referenda/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Events finished
* Missing file
* No GenesisConfig for Referenda
* Formatting
* Docs
* Docs
* Docs
* Per-class conviction voting
* New test & mock utils
* More tests
* Tests
* Tests finished 🎉
* Benchmarking stuff
* Fixes
* Test harness
* Test harness
* Benchmarks for Conviction=Voting
* Benchmarking pipeline complete
* Docs
* Formatting
* Remove unneeded warning
* Fix UI tests
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_conviction_voting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/conviction-voting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Docs
* Update frame/conviction-voting/src/vote.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* update sp-runtime version
* MEL Fixes for Referenda and Conviction Voting (#10725 )
* free maxencodedlen
* more maxencodedlen
* more MEL
* more mel
* disable storage info
* More Referenda Patches (#10760 )
* basic fixes
* fix benchmarking
* fix license
* prevent panic in curve math
* fmt
* bump crate versions
* Update mock.rs
Co-authored-by: Parity Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2022-02-06 12:51:12 +01:00
girazoki
074ff19dbc
maybe_total_supply in pallet-assets ( #10799 )
...
* maybe_total_supply in pallet-assets
* Update frame/assets/src/functions.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-02-05 11:06:44 +00:00
Alexander Gryaznov
d5c8593566
contracts: is_contract(address) and caller_is_origin() are added to API ( #10789 )
...
* is_contract() and caller_is_origin() added to Ext API
* is_contract() exposed in wasm runtime.rs
* + test for is_contract()
* + seal_is_contract benchmark
* caller_is_origin() exposed to wasm/runtime.rs and covered by a test
* + seal_caller_is_origin benchmark
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* identation fix for benchmark macroses; test cosmetic improvement
* benchmark fix
* + is_contract() wasm test
* + caller_is_origin() wasm test
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* is_contract() to borrow param instead of taking ownership
* phrasing improved
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* fixed wasm tests according to @athei feedback
* dead code warnings suppressed by unstable-interface attributes
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
Co-authored-by: Parity Bot <admin@parity.io >
2022-02-04 19:13:00 +00:00
Keith Yeung
89fa61125e
Make some UI test expectations crisper ( #10791 )
...
* Make some UI test expectations crisper
* Update frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs
* Update UI test expectations
* Missing newlines
* More whitespace issues
2022-02-04 15:42:13 +00:00
Oliver Tale-Yazdi
24b796bfa4
Make offences benchmark runnable ( #10782 )
...
* Make offences benchmark runnable
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_offences --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/offences/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Revert bench-bot
This reverts commit 73d0cb2e47e93e035af80013991b6a2e5fe2b1ed.
Co-authored-by: Parity Bot <admin@parity.io >
2022-02-04 12:03:28 +00:00
Andrew Jones
07d4a6743e
Bump sp-keyring ( #10790 )
2022-02-03 16:58:16 +00:00
Shawn Tabrizi
21d0cf0eea
Introduce ModuleError struct ( #10776 )
...
* better partial eq impl
* introduce module error
* fmt
* import module error
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* fixes
* fmt
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-02-03 13:02:45 +00:00
Oliver Tale-Yazdi
99fae0cd57
bench-cli: Support JSON output ( #10771 )
...
* Add dependencies
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make benchmark results serializable
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add `--json[-file]` options
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Enable JSON output
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use specific serde version
Polkadot does not compile otherwise.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Review comments
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Review comment: fs::write
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-02-02 14:25:13 +00:00
Alexander Theißen
3938c1cb62
Release pallet-contracts-primitives ( #10772 )
...
* Bump sp-storage
* Bump sp-rpc
* Bump sp-io
* Bump sp-trie
* Bump sp-state-machine
* Bump sp-externalities
* Bump sp-keystore
* Bump sp-application-crypto
* Bump pallet-contracts-primitives
* Bump sp-core
* Bump sp-runtime-interface
* Bump sp-wasm-interface
* Bump sp-runtime
* Bump sp-storage
* Update lock file
* Revert "Bump sp-storage"
This reverts commit f86c6db1ae334e28207b658fd90714ade0332e3b.
* Update lock file
2022-02-01 20:38:02 +01:00
Alexander Theißen
0bfbf5a89f
Bump strum from 0.22 -> 0.23 ( #10758 )
2022-01-31 20:04:12 +00:00
Alexander Theißen
f3168c3fa0
Add production profile to substrate-wasm-builder ( #10747 )
...
* Add production profile to wasm builder
* Fix profile detection
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Replace panic! by println! + exit
* Default to `release` for wasm on debug builds
* Replaced unwrap by expect
* Update all weights
Rerun on the bm2 server.
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_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Parity Bot <admin@parity.io >
2022-01-31 14:16:26 +00:00
Bastian Köcher
21d5573b25
pallet-scheduler: Fix migrations V2 to V3 ( #10757 )
...
* pallet-scheduler: Fix migrations V2 to V3
V2 already supported origins, so we need to move them over instead of setting it to `Root`. Besides
that it also removes the custom `Releases` enum and moves it over to `StorageVersion`.
* Fixes
* Fixes
* 🤦
2022-01-31 11:43:42 +00:00
Alexander Theißen
39704979fe
Bump wasm-instrument 0.1.0 -> 0.1.1 ( #10749 )
...
* Bump wasm-instrument 0.1.0 -> 0.1.1
* Fix benchmark
2022-01-31 10:05:30 +00:00
Piotr Mikołajczyk
ee557b769c
Fix lazy batch contract removal ( #10728 )
...
* Fix lazy batch contract removal
* Apply suggestions
* Qualify ChildInfo
* Negligible change to restart pipeline
* Revert "Negligible change to restart pipeline"
This reverts commit b38abb622a17de9f0d19b3eadcea611ead1a7251.
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Parity Bot <admin@parity.io >
2022-01-28 18:37:54 +00:00
Kian Paimani
498c3a5ecc
better way to resolve Phase::Emergency via governance ( #10663 )
...
* better way to resolve Phase::Emergency via governance
* Update frame/election-provider-multi-phase/src/lib.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com >
* review grumbles
* Update frame/election-provider-support/src/onchain.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* revert usize -> u32
Co-authored-by: Zeke Mostov <z.mostov@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2022-01-27 10:00:48 +00:00
Kian Paimani
38d94d6323
Use proper bounded vector type for nominations ( #10601 )
...
* Use proper bounded vector type for nominations
* add docs and tweak chill_other for cleanup purposes
* Fix the build
* remove TODO
* add a bit more doc
* even more docs
gushc
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com >
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com >
* Fix the nasty bug
* also bound the Snapshot type
* fix doc test
* document bounded_vec
* self-review
* remove unused
* Fix build
* frame-support: repetition overload for bounded_vec
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fix
* remove the need to allocate into unbounded voters etc etc
* Don't expect
* unbreal the build again
* handle macro a bit better
Co-authored-by: Zeke Mostov <z.mostov@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-25 14:44:10 +00:00
Enoch Chejieh
d94b5e32c5
chore: add example for balance AccountStore ( #10361 )
...
* chore: modified example for balance AccountStore
* add example for account store balance
* add example for account store balance
* Update frame/balances/src/lib.rs
* Update frame/balances/src/lib.rs
* balance account store example
* balance account store example
* Update frame/balances/src/lib.rs
* Update frame/balances/src/lib.rs
* balance account store example
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2022-01-25 10:04:07 +01:00
Alexander Theißen
dc45201a64
Pre-Charge max size when contracts access storage ( #10691 )
...
* Fix seal_get_storage
* Fix seal_take_storage
* Add more benchmarks
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Fix seal_set_storage
* Fix seal_contains_storage and seal_clear_storage
* 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_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Get rid of mem::size_of in benchmarks
* Fix up code loading
* Apply suggestions from code review
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Fix test to call same function twice
* Replaced u32::MAX by SENTINEL const
* Fix seal_contains_storage benchmark
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Parity Bot <admin@parity.io >
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2022-01-24 20:14:31 +00:00
Qinxuan Chen
e327b734bc
use clap3 instead of structopt ( #10632 )
...
* use clap3 instead of structopt
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* format
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* update ss58-registry and revert some nits
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* Fix clippy and doc
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* update clap to 3.0.7
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* Apply review suggestions
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* remove useless option long name
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* cargo fmt
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
2022-01-24 16:28:46 +00:00
Kian Paimani
d1ff02d31e
Proposal: Defensive trait for infallible frame operations ( #10626 )
...
* add a blueprint of how defensive traits could look like
* add something for arithmetic as well
* add some use cases in different pallets
* some build fixing
* Some new stuff and examples
* Fix deadly bug
* add more doc.
* undo faulty change to assets pallet
* Update frame/support/src/traits/misc.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* some review comments
* remove draft comment
* Fix ident test
* Fix proxy tests as well
* a few new ideas
* Fix build
* Fix doc
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-24 16:18:13 +00:00
Oliver Tale-Yazdi
9daea28085
Optimized weights ( #10692 )
...
* Add optimization flags to 'release' profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Optimized weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add missing pallets
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add `production` profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-collective: fix tests
the weight of System.remark went to 0, the collective test uses a
remark call to trigger an out-of-gas condition so I replaced it
with a `remark_with_event` call.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-24 12:35:25 +00:00
Bastian Köcher
82c9690c3e
Remove some last AccountId32::default() leftovers ( #10655 )
...
* Remove some last `AccountId32::default()` leftovers
As we removed `Default` of account id, we have overseen some last bits. This pr removes these last
bits.
* Fix
2022-01-21 20:21:36 +01:00
Oliver Tale-Yazdi
4880741eaa
Add MaxEncodeLen to implement_per_thing! ( #10715 )
...
* fix doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add MaxEncodedLen to implement_per_thing!
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test that Percent et.al. can be used in Storage.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add comment
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Test that Percent et.al. can be used in Storage."
This reverts commit 52558afea6f9b53fb07521f1b6393bc320d21dfc.
* Test MaxEncodedLen in implement_per_thing!
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Add comment"
This reverts commit 27a96f6e527f71a57ace289c041de514edbe9104.
2022-01-21 17:08:35 +00:00
Shawn Tabrizi
4d7d1eaaf8
dont increase the allocated size of vec ( #10701 )
2022-01-20 18:17:16 +00:00
Oliver Tale-Yazdi
362a6d9b28
Require MaxEncodedLen per default ( #10662 )
...
* Remove generate_storage_info
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add without_storage_info where needed
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update doc tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add more without_storage_info
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fix TryBuild
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fix TryBuild tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-20 11:16:04 +00:00
Nazar Mokrynskyi
6b60c3dbff
Relax types on DigestItemRef, such that byte slices can be used in addition to vector references ( #10536 )
...
* Relax types on `DigestItemRef`, such that byte slices can be used in addition to vector references
* Apply clippy suggestions
2022-01-20 11:02:22 +01:00
Kian Paimani
1344e43d2d
Remove all stale on_runtime_upgrade hooks in the runtime ( #10650 )
...
* Remove all stale on_runtime_upgrade hooks in the runtime
* add docs
* cleanup
* fix warn
* fix more warnings
* fix offence test
* overwrite the damn UItest
2022-01-19 20:58:47 +01:00
Oliver Tale-Yazdi
c8c46fea96
Improve usability of add+list_benchmark! ( #10592 )
...
* Improve usability of add_benchmark and list_benchmark.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* node-template: use new define_benchmarks syntax
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* make CI happy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* remove old imports
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fix TryBuild tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "fix TryBuild tests"
This reverts commit 82ea52fd25c0ef5efa46669217694835a7404d4e.
* review: remove blank lines
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-19 15:31:14 +00:00
Gavin Wood
f2c8fe35a3
Allow the treasury to have a maximum bound on the bond ( #10689 )
...
* Allow the treasury to have a maximum bound on the bond
* Update frame/treasury/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2022-01-19 14:08:53 +00:00
Zeke Mostov
afdec55069
Migration for over locked accounts in phgragmen elections ( #10649 )
...
* use free balance rather than total balance
* Docs
* Migration for over-locked phrag voters
* New line
* comment
* Update frame/elections-phragmen/src/migrations/v5.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Only set lock, don't remove it
* delete commented out
* docs
* Update migration to just take a set of accounts
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2022-01-18 03:06:25 +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
Alexander Theißen
2a122c44b1
Switch from pwasm-utils to wasm-instrument ( #10680 )
...
* Switch executor to wasm-instrument
* Switch pallet-contracts to wasm-instrument
2022-01-17 15:00:17 +00:00
James Wilson
751c072ca4
Bump sp-keyring to 4.1.0-dev ( #10681 )
2022-01-17 12:52:10 +00:00
Alexander Theißen
89194f0e70
contracts: Get rid of the dreaded Other error ( #10595 )
...
* Print more detailed error when instrumentation fails
* Apply suggestions from code review
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Check contents of debug buffer
* Fix test
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2022-01-17 09:45:28 +00:00
Shawn Tabrizi
d511cc8cfb
Improve BoundedVec API (extracted from #10195 ) ( #10656 )
...
* Gav wrote this code in pull #10195 . Extracting to simplify that PR.
* fix potential panics
* prevent panics in slide
* update doc
* fmt
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Gav Wood <gavin@parity.io >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2022-01-17 10:28:11 +01:00
Zeke Mostov
16212851c6
Move EraIndex to sp-staking ( #10671 )
...
* Move `EraIndex` to sp-staking
* Fix imports in mocks
* Run cargo +nightly-2021-10-29 fmt
2022-01-17 02:15:18 +00:00
Shawn Tabrizi
e9860b9c1e
Use free balance rather than total balance for elections phragmen ( #10646 )
...
* use free balance rather than total balance
* Docs
Co-authored-by: emostov <32168567+emostov@users.noreply.github.com >
2022-01-14 01:43:00 +00:00
Xiliang Chen
d346028a9d
reset events before apply runtime upgrade ( #10620 )
...
* reset events before apply runtime upgrade
* fix tests
* add test
* update comment
* Update frame/system/src/lib.rs
* trigger CI
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-01-12 08:22:29 +00:00
Oliver Tale-Yazdi
1f28f72790
followup #10594 : re-benchmark pallet-lottery ( #10637 )
...
* pallet-preimage: fix crate doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* 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
Co-authored-by: Parity Bot <admin@parity.io >
2022-01-11 18:13:06 +00:00
Oliver Tale-Yazdi
b630f1b0e6
pallet-lottery: add generate_storage_info ( #10594 )
...
* pallet-lottery: add generate_storage_info
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-lottery: test call_to_indices with TooManyCalls
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* review: move try_push above transfer
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-lottery: test stop_repeat
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-lottery: test do_buy_ticket as white-box
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-lottery: use BoundedVec in bechmarks
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* pallet-lottery: fix zero div panic
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* review: extend buy_ticket tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* review: test buy_ticket AlreadyParticipating
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* review: use /// comments on private functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* review: use with_bounded_capacity
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-01-11 14:22:27 +00:00
Alex Pozhylenkov
03a7738ed8
add into function for PrefixIterator ( #10614 )
...
* add into function for PrefixIterator
* update with comments
* update with comments
2022-01-09 20:12:21 +01:00
Kian Paimani
02468b803f
Add Ord implementation for BoundedVec ( #10615 )
...
* Add Ord implementation for BoundedVec
* Update frame/support/src/storage/bounded_vec.rs
* Update frame/support/src/storage/bounded_vec.rs
* Update frame/support/src/storage/bounded_vec.rs
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-01-09 09:03:21 +00:00
Bastian Köcher
e254fd59f2
frame-support: Use logging for printing corrupted state ( #10612 )
...
`runtime_print!` is printed by default using `debug`, aka not being visible. With `log::error!` it
will be printed directly to the user. Production networks like Polkadot disable logging, but for
them we run special nodes that have logging enabled.
2022-01-08 16:13:54 +00:00
Alexander Theißen
46e38e8288
Add additionally functionality to contracts storage interface ( #10497 )
...
* Add new versions for storage access host functions
* Improve docs
2022-01-08 12:19:23 +00:00
Gavin Wood
4b9818a06a
Fix docs ( #10606 )
2022-01-07 19:33:52 +00:00
Alexander Theißen
4ca4df644e
contracts: Improve documentation of lazy deletion config ( #10582 )
...
* Improve documentation of lazy deletion config
* Apply suggestions from code review
Co-authored-by: Sacha Lansky <sacha@parity.io >
* Update frame/contracts/src/lib.rs
Co-authored-by: Andrew Jones <ascjones@gmail.com >
* Improve wording
Co-authored-by: Sacha Lansky <sacha@parity.io >
Co-authored-by: Andrew Jones <ascjones@gmail.com >
2022-01-06 11:03:18 +00:00
Kian Paimani
c3add6ee09
some improvements to bounded vec API ( #10590 )
...
* some improvements to bounded vec
* revert license tweak
* more tests
* fix
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* add the same stuff for btree map and set as well
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2022-01-06 10:55:21 +00:00
Zeke Mostov
0ca23e0a6c
Add benchmark tests for pallet bags list ( #10593 )
...
* Add benchmark tests for pallet bags list
* Make sure to set active balance for new ledgers
* fmt
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Parity Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2022-01-06 09:41:18 +00:00