warfollowsme | ryabina.io
bbabb17426
More app-friendly event description ( #6684 )
...
* More app-friendly event description
* change origin -> owner
* checked all decl_event! and changed decriptions.
* annotated parameter names for remaining events
2020-07-20 13:13:20 +02:00
Gavin Wood
cad18b0fae
identity: Don't let subs be re-registered ( #6667 )
...
* 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 >
2020-07-17 11:11:03 +02:00
Shawn Tabrizi
2302898b8a
Add WeightInfo to all pallets with benchmarks. ( #6575 )
...
* Start adding weight info
* More weightinfo
* finish weight info
* more fixes
* inital update of node runtime
* fix the rest of the compilation
* update balances
* add docs
* fix balances tests
* Fix more tests
* Fix compile
* Fix pallet-evm tests
2020-07-08 18:22:01 +02:00
David
d73de3bed7
Fix mocking multiple http calls in the same function call ( #6510 )
...
* Fix mocking multiple http calls in the same function call
Fixes an issue where a function call would perform more than one http request and wait for each to complete before proceeding. The `RequestId` comes from the length of the `requests` collection in the `OffchainState` and if a request is completed before the next one starts it will be removed and the "next expected" will be off by one. This PR tries to fix that by using a request counter that tracks how many requests have been performed so that we can `remove()` items from the `expected_requests` at the right index.
I suspect that this is a sub-optimal soluton and perhaps requests and their mocks should live side by side in the same collection, e.g. in a tuple of `(PendingRequest, Option<ExpectedRequest>)`.
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io >
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io >
* Panic on overflow
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Use a Deque and push/pop expected requests
* fix test
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-07-01 10:22:47 +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
Tomasz Drwięga
f74a7171be
Maximum extrinsic weight limit ( #6067 )
...
* 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
2020-05-20 15:05:16 +02:00
Benjamin Kampmann
be8c96adec
Relax substrate licensing scheme ( #5947 )
2020-05-15 13:21:56 +02:00
Jimmy Chu
97259789dd
Minor update on example-offchain-worker code and comment ( #5970 )
...
* Minor update on example-offchain-worker code and comment
Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com >
* Update frame/system/src/offchain.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-05-11 17:44:20 +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
Rakan Alhneiti
25751c0562
Offchain signing ( #5182 )
...
* New approach to offchain signing.
* Use in im-online
* Rewrite to use Account<T>
* DRY signing.
* Implement send_raw_unsigned_transaction
* WiP
* Expunge LocalCall
* Expunge LocalCall
* Fix compilation.
* Solve call.
* Make it compile again.
* Finalize implementation.
* Change CreateTransaction
* Clear CreateTransaction.
* Add price payload
* Send raw transaction
* Submit signed payload / unsigned transaction (WIP)
* Supertrait requirements on T::Signature
* Validate signature of payload on an unsigned transaction
* Fix encoding - part 1
* Make it compile.
* Fix compilation of unsigned validator.
* Pass price payload to the transaction
* Make block number part of the signed payload
* Send signed transaction
* Implement all_accounts, any_account
* Fix formatting
* Implement submit_transaction
* Submit signed transaction (ForAll, ForAny)
* Fix formatting
* Implement CreateSignedTransaction
* Move sign and verify to AppCrypto
* Sign transaction
* Call `use_encoded`
* Remove SubmitAndSignTransaction
* Implement runtime using new SigningTypes
* Adapt offchain example to changes
* Fix im-online pallet
* Quick fix: rename AuthorityId2
* Fix offchain example tests
* Add a comment on why keystore is required in unsigned transaction test
* Use UintAuthorityId instead of u64
* WIP
* Remove IdentifyAccount from UintAuthorityId
* Implement PublicWrapper type
* Fix im-online tests
* Fix runtime test
* Bump spec version
* Fix executor tests
* Rename ImOnlineAuthId -> ImOnlineAuthorityId and formatting
* Fix merge
* Documentation
* Revert u64 -> UintAuthorityId conversion
* Fix string errors
* Document public members in offchain module
* Introduce SubmitTransaction
* Update pallets to use SubmitTransaction
* WIP
* Use SubmitTransaction in offchain
* Use `submit_unsigned_transaction`
* Fix tests
* Update docs
* Remove SigningTypes requirement from `SendTransactionTypes`
* Fix tests
* Update frame/system/src/offchain.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/system/src/offchain.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/example-offchain-worker/src/tests.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/system/src/offchain.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/system/src/offchain.rs
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Remove leftover from previous iterations
* Change enum to struct
* Remove public
* Move mock to node/executor/tests
* Cleanup test-helpers
* Make `application-crypto` `std` feature internal
The macros should not generate code that requires that the calling crate
has a feature with the name `std` defined.
* Revert cargo lock update
* Use TestAuthorityId from common
* Restore members of account to public
* Tidy up imports
* Fix benchmarking pallet
* Add tests demonstrating ForAll, ForAny on signer
* Move definition of AppCrypto
in example-offchain-worker
from tests to mod::crypto
* Cleanup stray comment
* Fix ValidTransaction
* Re-fix CreateSignedTransaction
* Address PR feedback
* Add can_sign method to signer
* Propagate error
* Improve documentation
* Fix vec! macro not available
* Document SendTransactiontypes
* Add some docs.
* Split signing examples
* Add tests for signing examples
* WIP can_sign - PR feedback
* WIP
* Split for_any / for_all into different calls
* Verify payload and signature in test
* Fix can_sign implementation
* Fix impl_version
* Import Box from sp_std
* Create issues for TODOs
* Ignore doctest.
* Add test directly to system. Adjust UintTypes.
* Add some tests to account filtering.
* Remove code samples and point to example offchain worker
* Fix doc links
* Fix im-online tests using signatures.
Co-authored-by: Tomasz Drwięga <tomasz@parity.io >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
2020-04-21 14:55:05 +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
Tomasz Drwięga
762bcbab03
Unsigned Validation best practices ( #5563 )
...
* Configurable Unsigned Priority.
* Use the new builder.
* Fix tests.
* Fix benches.
* Remove unused import.
* Rename for_pallet
2020-04-08 11:17:21 +02:00
Tomasz Drwięga
04ccb179e9
Pass transaction source to validate_transaction ( #5366 )
...
* WiP
* Support source in the runtime API.
* Finish implementation in txpool.
* Fix warning.
* Fix tests.
* Apply suggestions from code review
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com >
* Extra changes.
* Fix test and benches.
* fix test
* Fix test & benches again.
* Fix tests.
* Update bumpalo
* Fix doc test.
* Fix doctest.
* Fix doctest.
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Nikolay Volf <nikvolf@gmail.com >
2020-03-25 14:09:23 +01:00
Bastian Köcher
46458f4082
Make sure frame examples compile for wasm ( #5332 )
...
* Make sure frame examples compile for wasm
This makes sure that `frame-example` and `frame-example-offchain-worker`
compile for wasm.
This also fixes compilation for these crates. The offchain worker
example doesn't use serde-json anymore as that is too heavy and breaks
`no_std` compilation.
* Apply suggestions from code review
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com >
Co-authored-by: Nikolay Volf <nikvolf@gmail.com >
2020-03-20 16:57:39 +01:00
Gavin Wood
7947cbf915
Remove migration code. ( #5291 )
...
* Remove migration code.
* Fix cargo
* Bump spec version
2020-03-19 23:01:13 +01:00
nahuseyoum
961082606e
bug fix - if statement logic ( #5283 )
...
if statement logic for recently sent block was inverted.
2020-03-17 18:52:00 +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
74f8db5def
Assign unique storage names to pallets. ( #5010 )
...
* Assign unique storage names to pallets.
* Bump spec
* Upgrade logic for finality tracker (untested)
* Logic for migrating Identity (untested)
* Logic for migrating transaction-payment
* Fix tests
* Fix `decl_storage` build
* Contract -> Contracts
* Update Cargo.lock
* bump spec
* update migration
* Fix merge error
* Migration for contracts
* Remove serde
* Remove some illegal spaces and Options
* Fix types in identity.
* Minor variable rename
Co-authored-by: Gavin Wood <gavin@parity.io >
2020-03-14 12:44:48 +01:00
Gavin Wood
afa5861f3b
Lazy reaping ( #4895 )
...
* Squash and rebase from gav-lazy-reaping
* Bump version
* Bump runtime again
* Docs.
* Remove old functions
* Update frame/balances/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/contracts/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Warnings
* Bump runtime version
* Update frame/democracy/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/system/src/lib.rs
* Clean up OnReapAccount
* Use frame_support debug
* Bump spec
* Renames and fix
* Fix
* Fix rename
* Fix
* Increase time for test
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com >
2020-02-24 18:04:42 +01:00
Tomasz Drwięga
9a0b8b5be5
Offchain Workers: Example Pallet ( #4989 )
...
* Example of offchain worker pallet.
* Fix compilation issues.
* Use serde_json to parse JSON.
* Add some basic tests.
* Working on docs.
* Fix compilation
* Finish docs for signed.
* Work on unsigned send.
* Add some tests and missing docs.
* Add example of StorageValueRef
* Add weight.
* Extra \n
* Fix im-online test.
* Bump runtime.
* Fix tests.
* Apply suggestions from code review
Co-Authored-By: Joshy Orndorff <JoshOrndorff@users.noreply.github.com >
Co-Authored-By: Gavin Wood <gavin@parity.io >
* Address review comments.
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com >
Co-authored-by: Gavin Wood <github@gavwood.com >
2020-02-20 15:21:34 +01:00