Node template love (#6560)

* Node template love

Better description in node/Cargo.toml
Example dispatchables should have non-zero weights
Changes to README to bring in line with current DevHub Node Template

* Update README.md

cleaned up, reworked text, ready for round 2

* Add DbWeight

* Update README.md

* Consistent Playground buttons

* "setup" -> "set up"

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Import `Get` trait to fix build

Co-authored-by: Addie Wagenknecht <addie@nortd.com>
Co-authored-by: Ricardo Rius <ricardo@parity.io>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
Dan Forbes
2020-07-10 00:29:39 -07:00
committed by GitHub
parent bf4e5d4d2c
commit f39f404c22
3 changed files with 72 additions and 25 deletions
@@ -9,7 +9,7 @@
/// For more guidance on Substrate FRAME, see the example pallet
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch};
use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch, traits::Get};
use frame_system::ensure_signed;
#[cfg(test)]
@@ -75,7 +75,7 @@ decl_module! {
/// Just a dummy entry point.
/// function that can be called by the external world as an extrinsics call
/// takes a parameter of the type `AccountId`, stores it, and emits an event
#[weight = 0]
#[weight = 10_000 + T::DbWeight::get().writes(1)]
pub fn do_something(origin, something: u32) -> dispatch::DispatchResult {
// Check it was signed and get the signer. See also: ensure_root and ensure_none
let who = ensure_signed(origin)?;
@@ -91,7 +91,7 @@ decl_module! {
/// Another dummy entry point.
/// takes no parameters, attempts to increment storage value, and possibly throws an error
#[weight = 0]
#[weight = 10_000 + T::DbWeight::get().reads_writes(1,1)]
pub fn cause_error(origin) -> dispatch::DispatchResult {
// Check it was signed and get the signer. See also: ensure_root and ensure_none
let _who = ensure_signed(origin)?;