Commit Graph

813 Commits

Author SHA1 Message Date
Wei Tang 400a22ebe5 Implement codec for U256 (#761)
* Implement codec for U256

* Use little endian and add tests
2018-09-19 10:00:50 +02:00
Guanghua Guo 319549f563 Update lib.rs (#768) 2018-09-19 09:56:40 +02:00
Sergey Pepyakin e7d1933d25 Extract well known keys into a single place (#764)
* Extract well known keys into a single place

* Fixes.
2018-09-18 16:20:36 +02:00
Svyatoslav Nikolsky 7fa337afbc Light friendly storage tracking: changes trie + extending over ranges (#628)
* changes_trie

* changs_trie: continue

* changes_trie: adding tests

* fixed TODO

* removed obsolete ExtrinsicChanges

* encodable ChangesTrieConfiguration

* removed polkadot fle

* fixed grumbles

* ext_storage_changes_root returns u32

* moved changes trie root to digest

* removed commented code

* read storage values from native code

* fixed grumbles

* fixed grumbles

* missing comma
2018-09-18 09:14:41 +02:00
Gav Wood 24479cd7f5 Substrate is the one (#759) 2018-09-18 09:12:49 +02:00
Gav Wood f10d8e177d Generalised Transaction Queue API (#741)
* First effort

* API versioning

* Introduce validate_transaction

* Introduce the API plus fixes.

* Docs

* Typo

* Add longevity parameter to transaction validity info.
2018-09-17 18:43:59 +02:00
Maciej Hirsz 263786df05 Telemetry refactor (#757)
* Telemetry Refactor

* Cleanup

* Sleep after clearing Sender on error
2018-09-17 18:43:47 +02:00
Bastian Köcher 597ea41cd4 Implement construct_runtime! macro (#751)
* Make `system` module renamable in `impl_outer_event!`

* Implement `construct_runtime!` macro

This macro generates code for calling all the common `impl_outer_*` macros.

* Add documentation

* Fixes wrong declaration of `contract`

* Update dependencies to work on `no_std`

* One more `Cargo.lock` update

* Address comments
2018-09-17 17:27:22 +02:00
Sergey Pepyakin ea1b9bf026 SRML: fix OOB in srml_staking new_era. (#755) 2018-09-17 17:26:47 +02:00
Guanghua Guo 11578a8319 Not use extern (#748)
* Not use extern

* Update Cargo.lock
2018-09-17 08:26:33 +02:00
Sergey Pepyakin dcd181f31e Contracts: return arbitrary sized buffers (#711)
* WIP

* Direct return of output data.

* Docs and renamings.

* Add get_storage test.

* Overwrite the scratch buffer.
2018-09-15 12:46:59 +02:00
Sergey Pepyakin 56def2a38b Build project with --locked on CI (#743)
* Add --locked to the cargo build

* Remove trailing spaces

* Update Cargo.lock
2018-09-15 10:06:20 +02:00
Guanqun Lu b76660afd4 Sr treasury fix (#739)
* treasury: use 'mutate' and 'retain' to avoid creating a new vec

* treasury: check the underflow case
2018-09-14 09:50:22 +02:00
Drew Stone de4db765f5 Fixed spelling and grammar for clarity (#730)
* Fixed spelling and grammar for clarity

* Update README.adoc

* Three comma club

* gramma grammma grammar

* Update README.adoc

* Remove commas

Corrected the commas.

Consider the sentences:

- "Energy-saving light bulbs which are cheap make for a sensible investment"
- "Energy-saving light bulbs, which are cheap, make for a sensible investment"

They are different. The first one is intimating that energy-saving light bulbs come in many prices and it's only the cheap ones which are a good investment. The second implies that all energy-saving light bulbs are generally cheap and they, regardless of price, make for a good investment.

The commas added (which I just removed) switched the meaning, incorrectly, from one to the other.
2018-09-14 09:43:26 +02:00
Gav Wood 3f96419665 Remove unneeded code (#737) 2018-09-13 18:08:45 +02:00
Gav bd40f05167 Remove stale file 2018-09-13 15:57:18 +02:00
金XX(Aton) ca8f0d6625 bugfix: balances::transfer for new_account issue#722 (#731)
* bugfix: balances::transfer for new_account

issue:#722
would_create flag should depend on dest, not origin.
change 
```rust
let would_create = from_balance.is_zero();
```
to 
```rust
    let to_balance = Self::free_balance(&dest); 
    let would_create = to_balance.is_zero(); 
```
in the other hand, provide `fn new_test_ext2()` and let `transfer_fee=10`, `creation_fee=50` for test case

* Update lib.rs

* Update tests.rs

* Make `impl_outer_origin!` support generic `Origin`s (#732)

* Make `impl_outer_origin!` support generic `Origin`s

* Support empty outer origin

* Contracts: fix transfer function. (#733)

* Remove dependency on the parity repo (#734)

* Fix test

* Anothe fix
2018-09-13 15:54:56 +02:00
Gav Wood a7f8f0f1bd Remove redundant code and merge rest into rt-std (#735)
* Remove redundant code and merge rest into rt-std

* Update lib.rs
2018-09-13 14:54:24 +02:00
Arkadiy Paronyan 0ed48c89ab Remove dependency on the parity repo (#734) 2018-09-13 14:25:38 +02:00
Sergey Pepyakin 88ef57e4bd Contracts: fix transfer function. (#733) 2018-09-13 14:25:20 +02:00
Bastian Köcher 72fb60cb49 Make impl_outer_origin! support generic Origins (#732)
* Make `impl_outer_origin!` support generic `Origin`s

* Support empty outer origin
2018-09-13 11:19:48 +02:00
Bastian Köcher 5bd0ecddd2 Make impl_outer_event! aware of required generic parameters (#729) 2018-09-12 19:12:28 +02:00
Guanqun Lu a813d54965 add a python script to show the runtime packages' dependencies (#725)
* add a python script to show the dependencies

* add the header line and modify the mod
2018-09-12 16:05:15 +02:00
Bastian Köcher 52c5b90647 Check if cargo already from nighlty in wasm build scripts (#724) 2018-09-12 16:03:48 +02:00
Bastian Köcher c5c5b35da3 Make decl_event! more ergonomic (#723)
* Improve and simplify `decl_event!`

- RawEvent is not required anymore to be written in the defintion
- Events with and without parameters are now supported everywhere

* Make `decl_event!` more flexible with the automatic naming of generic parameters

The macro will now automatically derive the name of a generic parameter
from the trait type name, if no explicit name is given.

`where Balance = <T as Trait>::Balance` can be simplified to
`where <T as Trait>::Balance`.

* Adapts to latest refactoring changes
2018-09-12 16:02:59 +02:00
Guanqun Lu 4685018991 enhance dispatch (#720)
* normalize decl_storage

* dispatch the function call

* add test case

* fix the root case

* add system

* fix the typo in unit test

* fix the doc generation for decl_module

* fix the unit test due to the interface change
2018-09-12 15:56:37 +02:00
Gav Wood 1e01162505 Phase 1 of repo reorg (#719)
* Remove unneeded script

* Rename Substrate Demo -> Substrate

* Rename demo -> node

* Build wasm from last rename.

* Merge ed25519 into substrate-primitives

* Minor tweak

* Rename substrate -> core

* Move substrate-runtime-support to core/runtime/support

* Rename/move substrate-runtime-version

* Move codec up a level

* Rename substrate-codec -> parity-codec

* Move environmental up a level

* Move pwasm-* up to top, ready for removal

* Remove requirement of s-r-support from s-r-primitives

* Move core/runtime/primitives into core/runtime-primitives

* Remove s-r-support dep from s-r-version

* Remove dep of s-r-support from bft

* Remove dep of s-r-support from node/consensus

* Sever all other core deps from s-r-support

* Forgot the no_std directive

* Rename non-SRML modules to sr-* to avoid match clashes

* Move runtime/* to srml/*

* Rename substrate-runtime-* -> srml-*

* Move srml to top-level
2018-09-12 11:13:31 +02:00
Sergey Pepyakin 8fe5aa4c81 Extract SimpleAddressDeterminator (#716) 2018-09-11 18:39:31 +02:00
Sergey Pepyakin 7520d601e3 Contracts: Add contract's GenesisConfig in demo-runtime (#712)
* Add contracts to GenesisConfig in demo-runtime

* Update roots.
2018-09-11 18:10:24 +02:00
Sergey Pepyakin e8f4b85029 Timestamp module docs (#713)
* Timestamp docs

* Add missing /
2018-09-11 17:53:36 +02:00
Gav Wood 40701eaec9 Remove cruft (#714) 2018-09-11 17:27:36 +02:00
Gav Wood 418a9bf243 Remove PoC-1 back-compat hacks (#709)
* Remove PoC-1 back-compat hacks

* Fix lingering Keccak references

* More keccak exorcism

* Fix test

* Final fixes
2018-09-11 15:17:07 +02:00
Bastian Köcher fd2ec13ed8 Improve event json metadata (#710)
* Introduce `impl_event!` for declaring the Event/RawEvent for a module

* Implements a function for generating the event json metadata

* Update runtime `json_metadata` to include the new event json metadata

* Switch to `impl_event!` for new modules

* Remove unused module declaration in `impl_event!`

* Rename `impl_event!` to `decl_event!`

* Fixes some style nits
2018-09-11 14:05:09 +02:00
Chevdor da56ae7e46 Remove polkadot doc from substrate (#700)
* Improve doc

- convert some md to adoc
- include contrib docs to the main readme
- add readme for some packages and include them

* Bring changes from 46c9333fff into the replacing adoc file

* Minor fixes

* Remove files irrelevant for substrate

* Remove old polkadot related doc
2018-09-11 12:57:19 +02:00
Guanqun Lu c3d8c52e17 enhance the environmental macro (#683) 2018-09-11 10:51:53 +02:00
Sergey Pepyakin d7d591cf54 Try to remove the caching from the build (#701) 2018-09-11 10:51:17 +02:00
Gav Wood 91c2b8e462 Fix treasury minting (#707)
* Fix minting to do what it's meant to.

* Fix tests

* Note and fix total issuance.

* Undo last non-fix.

* More doc
2018-09-11 10:50:01 +02:00
Gav Wood 597a7411ae Don't use Ext outside of runtime!!! (#704) 2018-09-10 21:11:54 +02:00
Gav Wood c9845f33d8 Council events (#703)
* Initial bits

* More stuff

* Cleave voting from council

* More events

* Rearrange council a little

* Fix demo

* More info in events
2018-09-10 21:11:47 +02:00
Sergey Pepyakin 6c1b2c27d1 Integrate contracts into substrate-demo runtime (#675)
* Introduce data and salt into ContractAddressFor

* Accept salt arg in ext_create.

* Integrate contracts into the demo runtime

* Make libcontract compile to wasm

* Remove salt parameter.

This now is concern of userspace.

* Rebuild binaries.
2018-09-10 19:45:19 +02:00
Svyatoslav Nikolsky 0e1023ae42 DigestItem trait (v3) (#687)
* DigestItem v4

* tests

* wording
2018-09-10 18:34:51 +02:00
Maciej Hirsz 153439aeea Flag if the node is an Authority for Telemetry (#702) 2018-09-10 18:34:38 +02:00
Bastian Köcher ba23d033a1 Implements json_metadata RPC call (#692)
* Adds `impl_json_metadata!` for generating all metadata of a runtime

* Adds `json_metadata` RPC call

* Adds simple test for the `json_metadata` RPC call

* Implements json metadata in the demo runtime

* Fix indent

* Adds missing copyright headers

* Dispatch json metadata renamings and improvements

* Replaces `format!` & `String` with `Vec<JSONMetadata`

* Implements `Encode` and `Decode` for JSONMetadata

* Make `impl_json_metadata!` compileable on `no_std`

* Adapt the client to decode the correct type for `json_metadata`

* Fixes compile error and warning

* Whitespace
2018-09-10 18:34:17 +02:00
Arkadiy Paronyan fea750511e Bring substrate-demo up to date (#658)
* Updating substrate-demo

* Consenus fixes

* Reverted toolchain change

* Adjusted timeout formula

* Simplfied proposal creation

* Fixed tests

* Fixed a few small issues

* 2017->2018

* Style

* More style

* Renamed demo executable to substrate

* Style

* Fixed compilation after merge

* Style
2018-09-10 17:54:32 +02:00
Gav Wood bcc26dd30a Council motions for approving treasury proposals (#694)
* Treasury in runtime, generic approve/reject

* Add logic for council origin

* Add tests.

* Configurable number of members in EnsureMembers

* Fix grumbles

* Fix spelling

* Comment
2018-09-10 16:02:59 +02:00
Chevdor 7b112dee7c Remove docker from Substrate (#699) 2018-09-10 16:01:58 +02:00
Gav Wood 0aefb50689 Democracy module events (#697)
* Democracy module events

* Fix demo runtime

* Fix

* Extra event in balances

* Missing event

* Fix test

* Fix council

* Fix test
2018-09-10 14:40:35 +02:00
David 393c3b5af7 LocalCallExecutor and RemoteCallRequest generic over Hasher and NodeCodec (#573)
* LocalCallExecutor and RemoteCallRequest generic over Hasher and NodeCodec

* Fix client/db

* Use new triehash

* Use new triehash
Don't use ethereum-types from rlp

* New triehash

* Use new triehash

* fixes and rlp without ethereum-types

* Lockfile

* lockfile

* Rename enumerated_trie_root to keccak_rlp_enumerated_trie_root

* Rename ordered_trie_root -> keccak_rlp_ordered_trie_root
Rename trie_root -> keccak_rlp_trie_root

* Fix panic message

* Kick the ball one step up the ladder

* Normalize function signatures between wasm and native

* Sort out compilation and test errors

* Cleanup

* Constrain the wasm-version using an ExternTrieCrypto trait that is implemented only for KeccakHasher

* hashdb is not optional

* lockfile

* Runtimes

* Missing bounds

* wasm binaries

* lockfiles

* binaries

* LocalCallExecutor uses concrete hasher/codec

* Use binaries from master

* Externalities is concrete
RuntimeInfo is not generic

* whitespace grumble

* lockfile

* lockfile and binaries
2018-09-09 14:56:50 +02:00
Guanqun Lu ea7aeb8409 add mutate api (#695)
* runtime-storage: add 'mutate' api

* support mutate for StorageValue

* try adding 'mutate' for map

* dispatch on Option<> type

* add check for prev_some

* consolidate the wrap type

* unify wrap type handling

* add sample for StorageValue
2018-09-09 13:32:15 +02:00
Arkadiy Paronyan 6fb9b5a0ba Fixed sync stalling when import queue is full (#691) 2018-09-07 21:45:44 +02:00