mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 17:57:56 +00:00
Split Indices module from Balances (#1404)
* Indices module * Remove indices stuff from balances * Rejob node, move Lookup into system. * Fix up some modules. * Fix democracy tests * Fix staking tests * Fix more tests * Final test fixes * Bump runtime versions * Assets uses compact dispatchers * Contracts module uses indexed addressing * Democracy has more compact encoding * Example now demonstrates compact eencoding * Sudo uses indexed address * Upgrade key also uses indexed lookups * Assets more compact types. * Fix test * Rebuild runtime, whitespace * Remove TOODs * Remove TODOs * Add a couple of tests back to balances. * Update lib.rs * Update lib.rs
This commit is contained in:
@@ -50,6 +50,7 @@ extern crate srml_system as system;
|
||||
// might find it useful).
|
||||
extern crate srml_balances as balances;
|
||||
|
||||
use codec::HasCompact;
|
||||
use support::{StorageValue, dispatch::Result};
|
||||
use system::ensure_signed;
|
||||
|
||||
@@ -177,9 +178,9 @@ decl_module! {
|
||||
// without worrying about gameability or attack scenarios.
|
||||
// If you not specify `Result` explicitly as return value, it will be added automatically
|
||||
// for you and `Ok(())` will be returned.
|
||||
fn set_dummy(new_value: T::Balance) {
|
||||
fn set_dummy(new_value: <T::Balance as HasCompact>::Type) {
|
||||
// Put the new value into storage.
|
||||
<Dummy<T>>::put(new_value);
|
||||
<Dummy<T>>::put(new_value.into());
|
||||
}
|
||||
|
||||
// The signature could also look like: `fn on_finalise()`
|
||||
@@ -269,7 +270,7 @@ mod tests {
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
||||
use sr_primitives::{
|
||||
BuildStorage, traits::{BlakeTwo256, OnFinalise}, testing::{Digest, DigestItem, Header}
|
||||
BuildStorage, traits::{BlakeTwo256, OnFinalise, IdentityLookup}, testing::{Digest, DigestItem, Header}
|
||||
};
|
||||
|
||||
impl_outer_origin! {
|
||||
@@ -289,14 +290,15 @@ mod tests {
|
||||
type Hashing = BlakeTwo256;
|
||||
type Digest = Digest;
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<u64>;
|
||||
type Header = Header;
|
||||
type Event = ();
|
||||
type Log = DigestItem;
|
||||
}
|
||||
impl balances::Trait for Test {
|
||||
type Balance = u64;
|
||||
type AccountIndex = u64;
|
||||
type OnFreeBalanceZero = ();
|
||||
type OnNewAccount = ();
|
||||
type EnsureAccountLiquid = ();
|
||||
type Event = ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user