Shawn Tabrizi
50568fcc19
Disambiguate BlockNumber type in decl_module ( #7061 )
...
* Disambiguate `BlockNumber` type in `decl_module`
* fix `frame-support-tests`
* fix ui tests
* fix trait order
2020-09-10 01:47:24 +02:00
Guillaume Thiolliere
8a37f60844
Remove generation of instance trait by decl_storage. ( #6812 )
...
* remove generation of instance trait, no breaking change
* doc
* doc
* Update frame/support/src/traits.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/support/procedural/src/storage/instance_trait.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-08-05 11:37:01 +00:00
Shaopeng Wang
a6702b7121
decl_module! macro: use 'frame_system' instead of system as default ident ( #6500 )
...
* Use frame_system as default ident.
* Remove unused 'frame_system' to 'system' renaming.
* Fix construct_runtime_ui tests.
* Rename system to frame_system in sudo/utility pallet test.
* Bump runtime impl_version.
* Update formatting.
2020-07-07 23:06:21 +00:00
Xiliang Chen
e1d0f84c67
Allow specify schedule dispatch origin ( #6387 )
...
* allow specify schedule dispatch origin
* fix tests
* use caller origin for scheduled
* fix tests
* line width
* check origin for cancel
* line width
* fix some issues for benchmarking
* fix doc test
* another way to constraint origin
* fix build issues
* fix cancel
* line width
* fix benchmarks
* bump version
* enable runtime upgrade
* add migration code and test
* Update frame/scheduler/src/lib.rs
Co-authored-by: Gavin Wood <github@gavwood.com >
* expose migration method
* add notes
* bump version
* remove on_runtime_upgrade
* fix test
Co-authored-by: Gavin Wood <github@gavwood.com >
2020-07-02 15:05:15 +02:00
Guillaume Thiolliere
c2ad27271b
Introduce in-origin filtering ( #6318 )
...
* impl filter in origin
* remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter
* rename BasicCallFilter -> BaseCallFilter
* refactor code
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* remove forgotten temporar comment
* better add suggestion in another PR
* refactor: use Clone instead of mem::replace
* fix tests
* fix tests
* fix tests
* fix benchmarks
* Make root bypass filter in utility::batch
* fix unused imports
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-06-15 17:05:41 +02:00
Benjamin Kampmann
be8c96adec
Relax substrate licensing scheme ( #5947 )
2020-05-15 13:21:56 +02:00
Shawn Tabrizi
8a33c297b4
Introduce BlockExecutionWeight and ExtrinsicBaseWeight ( #5722 )
...
* 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 >
2020-04-25 05:59:54 +00:00
Kian Paimani
50a7e12b3f
Migrate away from SimpleDispatchInfo ( #5686 )
...
* Migrate away from SimpleDispatchInfo
* Fix imports
* Better doc
* Update lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2020-04-22 09:20:28 +02:00
cheme
4ffcf98d8d
Child trie api changes BREAKING ( #4857 )
...
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
2020-04-20 15:21:22 +02:00
Shawn Tabrizi
980b635c8d
Weights to u64 + Balances Weights ( #5446 )
...
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-04-16 10:43:18 +02:00
Kian Paimani
a0772117ac
Mandate weight annotation ( #5357 )
...
* Disallow default weight
* Fix build and test
* Fix tests
* Fix another beloved ui test.
* fix beloved trybuild tests
* fix treasury?
* Final test fix
* Fix build
* Fix another one
* Fix
* More doctest fix
2020-03-26 11:17:05 +01:00
Gavin Wood
af9083f53b
Refactor away from opaque hashes ( #5226 )
...
* System.BlockHash
* Fix hash
* Introduce K/V iteration in all _concat maps
Also move across:
- System.Account (blake2_128_concat)
- Balances.Locks (twox_64_concat)
- ElectionsPhragmen.VotesOf (twox_64_concat)
- ElectionsPhragmen.StakeOf (twox_64_concat)
- Identity.IdentityOf (twox_64_concat)
- Identity.SubsOf (twox_64_concat)
- Society.Payouts (twox_64_concat)
- Session.NextKeys (twox_64_concat)
- Identity.SuperOf (blake2_128_concat)
- Session.KeyOwner (blake2_128_concat)
- Society.SuspendedCandidates (twox_64_concat)
- Society.SuspendedMembers (twox_64_concat)
- Society.Vouching (twox_64_concat)
- Society.Strikes (twox_64_concat)
- System.EventTopics
- Balances.Account
* Build fixes
* Ensure migration happens in correct order
* Staking.*
* Vesting.* Offences.*
* Democracy.*
* Babe.* Collective.*
* Grandpa.*
* Assets.* Benchmark.* Contracts.* Elections.* Asset.* Nicks.*
Also introduce real account list
* ImOnline.*
* Treasury.*
* Recovery.*
* Final bits.
* Docs
* Fix one test
* Fix test
* All passing except the UI tests
* Remove linked_map part 1
* Remove linked_map
* Some iterator utils for double maps.
* Remove old migrations
* Introduce tombstone for LinkedMap type
* Migration for genesis hash
* Fix build
* Fix hash
* Rename Map is_linked -> unused, keeping backwards compat (#5256 )
* Update frame/balances/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/elections/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Remove old migration code.
* Update frame/system/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update bin/node/runtime/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Fix hash
* fix session migration
* Fix watning
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Robert Habermeier <rphmeier@gmail.com >
2020-03-16 23:19:53 +01:00
Shawn Tabrizi
c7a14db792
Fix various spelling errors ( #4940 )
...
* meaningfull -> meaningful
* initialise -> initialize
* tokans -> tokens
* incentivise -> incentivize
* lenght -> length
* incentivisation -> incentivization
* doesnt't -> doesn't
* overwriten -> overwritten
* lifecycle -> life cycle
* lifecycle -> life cycle
* usefull -> useful
* noone -> no one
* spaming -> spamming
* defered -> deferred
* hieght -> height
* sumation -> summation
* ingore -> ignore
* registed -> registered
* Auxialary -> Auxiliary
* loggin -> logging
* independance -> independence
* trailling -> trailing
* responsability -> responsibility
* trunkated -> truncated
* Weither -> Whether
* informations -> information
* Runtume -> Runtime
* choosen -> chosen
* delcataion -> declaration
* Unchekced -> Unchecked
* defintion -> definition
* scrach -> scratch
* imput -> input
* transfered -> transferred
* endownment -> endowment
* Determinator -> Determiner
* relevent -> relevant
* emited -> emitted
* acocunt -> account
* proprotional -> proportional
* instantiaion -> instantiation
* commited -> committed
* tombstonedead -> tombstone
* uwnrap -> unwrap
* acount -> account
* specialised -> specialized
* existant -> existent
* requried -> required
* Anull -> Annul
* AUTHORITES -> AUTHORITIES
* underyling -> underlying
* recognisable -> recognizable
* Capitalise -> Capitalize
* reportfor -> report for
* hearbeat -> heartbeat
* onlineness -> being online
* creater -> creator
* Bytearray -> Byte array
* Despoit -> Deposit
* substratced -> subtracted
* Curent -> Current
* imbalanes -> imbalances
* countfown -> countdown
* inexisting -> inexistent
* additionaly -> additionally
* substracted -> subtracted
* auxilary -> auxiliary
* parital -> partial
* in't -> isn't
* compatability -> compatibility
* infomation -> information
* etected -> detected
* extrinsiscs -> extrinsics
* reprensentation -> representation
* coonfiguration -> configuration
* primtives -> primitives
* miscelanious -> miscellaneous
* VERISON -> VERSION
* endcoded -> encoded
* Genrates -> Generates
* miliseconds -> milliseconds
* occured -> occurred
* trully -> truely
* truely -> truly
* conjuction -> conjunction
* encouters -> encounters
* customised -> customized
* deterministicly -> deterministically
* finalisation -> finalization
* pluggable -> plugable
* wakeup -> wake-up
* interemdiate -> intermediate
* intepreting -> interpreting
* finalzied -> finalized
* throgh -> through
* extinsic -> extrinsic
* convient -> convenient
* allocater -> allocator
* propagateable -> propagatable
* succesfuly -> successfully
* finalising -> finalizing
* publically -> publicly
* phrasee -> phrase
* substration -> substractions
* substractions -> subtractions
* neccessarily -> necessarily
* Inlucde -> Include
* unefficient -> inefficient
* thay -> they
* funtion -> function
* datastructures -> data structures
* infromation -> information
* propagatable -> propagable
* ecountered -> encountered
* recognise -> recognize
* intergration -> integration
* lastet -> latest
* datatypes -> data types
* datatype -> data type
* Strongarming -> Strong Arming
* avaible -> available
* Commiting -> Committing
* Retreiving -> Retrieving
* shoud -> should
* canonicaliziation -> canonicalization
* comitted -> committed
* clonable -> cloneable
* Uknown -> Unknown
* reponse -> response
* arbitary -> arbitrary
* Capapbilities -> Capabilities
* responsbile -> responsible
* initialisation -> initialization
* cames -> came
* intemediate -> intermediate
* reqeust -> request
* intance -> instance
* explcitly -> explicitly
* neighor -> neighbor
* reolving -> resolving
* untill -> until
* Validte -> Validate
* deserailize -> deserialize
* literaly -> literally
* preceeding -> preceding
* abpve -> above
* chcecked -> checked
* numbet -> number
* Unknow -> Unknown
* halfs -> halves
* gossup -> gossip
* givent -> given
* immediatelly -> immediately
* slicable -> sliceable
* conensus -> consensus
* Mimicks -> Mimics
* acccept -> accept
* serialise -> serialize
* exstrinsics -> extrinsics
* panicks -> panics
* maintaince -> maintenance
* repeatidely -> repeatedly
* anecstor -> ancestor
* becasue -> because
* processer -> processor
* Prunning -> Pruning
* insterested -> interested
* unuseful -> not useful
* yeided -> yielded
* descendfing -> descending
* corresponts -> corresponds
* survivew -> survive
* keps -> keeps
* ligh -> light
* prerequisities -> prerequisites
* positiion -> position
* depedency -> dependency
* extrinisic -> extrinsic
* atomicaly -> atomically
* staticly -> statically
* resul -> result
* timestamb -> timestamp
* Utilites -> Utilities
* ammount -> amount
* pocess -> process
* exteral -> external
* Update client/finality-grandpa/src/tests.rs
* Update primitives/io/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update primitives/blockchain/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update frame/support/src/weights.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update bin/node/cli/tests/common.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/cli/src/params.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/executor/common/src/sandbox.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/finality-grandpa/src/communication/mod.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/state-db/src/pruning.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update frame/contracts/src/tests.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
* bump impl
* timestamb -> timestamp
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
2020-02-17 15:07:24 +01:00
Gavin Wood
5b7512e2e4
Composite accounts ( #4820 )
...
* Basic account composition.
* Add try_mutate_exists
* De-duplicate
* Refactor away the UpdateBalanceOutcome
* Expunge final UpdateBalanceOutcome refs
* Refactor transfer
* Refactor reservable currency stuff.
* Test with the alternative setup.
* Fixes
* Test with both setups.
* Fixes
* Fix
* Fix macros
* Make indices opt-in
* Remove CreationFee, and make indices opt-in.
* Fix construct_runtime
* Fix last few bits
* Fix tests
* Update trait impls
* Don't hardcode the system event
* Make tests build and fix some stuff.
* Pointlessly bump runtime version
* Fix benchmark
* Another fix
* Whitespace
* Make indices module economically safe
* Migrations for indices.
* Fix
* Whilespace
* Trim defunct migrations
* Remove unused storage item
* More contains_key fixes
* Docs.
* Bump runtime
* Remove unneeded code
* Fix test
* Fix test
* Update frame/balances/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Fix ED logic
* Repatriate reserved logic
* Typo
* Fix typo
* Update frame/system/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/system/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Last few fixes
* Another fix
* Build fix
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2020-02-14 00:47:51 +00:00
Alexander Popiak
cb567d6b8b
Rename StorageMap::exists to ::contains_key ( Resolves #4839 ) ( #4847 )
...
* rename StorageMap::exists(key) to ::contains_key(key)
* bump impl_version
2020-02-08 20:31:35 +01:00
thiolliere
76acc96f3a
Remove default hasher ( #4739 )
...
* remove default hasher from decl_storage!
* fix decl_storage declarations
2020-01-27 18:23:10 +01:00
thiolliere
b74c88b3cc
Modify doublemap syntax ( #4576 )
...
* modify doublemap syntax
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-01-10 11:52:56 +01:00
Shawn Tabrizi
7efa62725e
Update copyright year ( #4532 )
2020-01-05 14:05:44 +01:00
Bastian Köcher
8e393aa5a8
Make decl_error! errors usable ( #4449 )
...
* 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
2019-12-19 14:01:52 +01:00
Tomasz Drwięga
8778ca7dc8
[big refactor] Remove crate aliasing. ( #4395 )
...
* Rename: Phase 1.
* Unify codec.
* Fixing: Phase 2
* Fixing: Phase 3.
* Fixing: Phase 4.
* Fixing: Phase 5.
* Fixing: Phase 6.
* Fixing: Phase 7.
* Fixing: Phase 8. Tests
* Fixing: Phase 9. Tests!!!
* Fixing: Phase 10. Moar tests!
* Finally done!
* More fixes.
* Rename primitives:: to sp_core::
* Apply renames in finality-grandpa.
* Fix benches.
* Fix benches 2.
* Revert node-template.
* Fix frame-system in our modules.
2019-12-16 20:36:49 +08:00
cheme
0ece5d9e17
Fix key collision for child trie ( #4162 )
...
* In progress, runtime io must switch to future proof root +
child_specific (unique id) + u32 type.
* Switch interface, sr-io seems ok, rpc could use similar interface to
sr-io, genesis json broken if there is child trie in existing encoding
genesis.
* test from previous implementation.
* fix proving test.
* Restore Keyspacedb from other branch, only apply to child trie.
* Removing unneeded child_info from child root (child info are stored
if things changed, otherwhise the root does not change).
* Switch rpc to use same format as ext: more future proof.
* use root from child info for trie backend essence.
* Breaking long lines.
* Update doc and clean pr a bit.
* fix error type
* Restore removed doc on merge and update sr-io doc.
* Switch child storage api to use directly unique id, if managed id
where to be put in place, the api will change at this time.
* Clean deprecated host interface from child.
* Removing assertion on child info (can fail depending on root
memoization).
* merging child info in the overlay when possible.
* child iteration by prefix using child_info.
* Using ChainInfo in frame support. ChainInfo gets redesign to avoid
buffers allocation on every calls.
* Add length of root to the data of child info.
* comments
* Encode compact.
* Remove child info with root.
* Fix try_update condition.
* Comment Ext child root caching.
* Replace tuples by struct with field
* remove StorageTuple alias.
* Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
aliases.
2019-12-14 11:11:19 +09:00
Weiliang Li
4f2cdb20c1
Rename: primitives/sr-io -> primitives/sp-io ( #4328 )
...
* primitives/sr-io -> primitives/io
* fix
* rename
* runtime-io -> sp-io
* git mv
* fix ci
* remove package name
* fix
* fix
* try minimizing diff
* try minimizing diff again
* try minimizing diff again
2019-12-10 16:08:35 +01:00
thiolliere
e5b6935c2a
Introduce prefixed storage with enumeration ( #4185 )
...
* Introduce storage_next allowing iteration. (without childtries)
* Implement prefixed storage
* impl cache in client_storage_cache (needs test)
* switch overlay change to btreemap
* Revert "impl cache in client_storage_cache"
This reverts commit c91a4848916eba87184b3dc4722cea81aec9339d.
the storage cache cannot be used this way
* Revert "Implement prefixed storage"
This reverts commit 4931088126a427082d7310ed7e83b8eea966bc20.
* Impl StoragePrefixedMap for all map storages
* remove comment
* Move all overlays to BTreeMap
* btreemap iteration improvment
* impl for child tries
* impl tests for childs
* fix
* remove cache comment
* Fix grumble
2019-12-09 20:55:11 +01:00
Benjamin Kampmann
927e13c13a
The crate rename ( #4223 )
...
* 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
2019-12-02 11:23:53 +01:00
thiolliere
f4035cd5ac
Implement all storage after prefix ( #4227 )
...
* Implement all storage after prefix
* fix test, bump version and fix doc
* bump metadata version
* Update frame/support/procedural/src/storage/storage_struct.rs
2019-11-27 18:23:20 +00:00
Shawn Tabrizi
c9175b59ff
Rename Palette to FRAME ( #4182 )
...
* palette -> frame
* PALETTE, Palette -> FRAME
* Move folder pallete -> frame
* Update docs/Structure.adoc
Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com >
* Update docs/README.adoc
Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com >
* Update README.adoc
2019-11-22 19:21:25 +01:00