Skip to content

Commit

Permalink
Merge pull request #1 from mnaamani/update-substrate
Browse files Browse the repository at this point in the history
update dependencies substrate and staking module
  • Loading branch information
bedeho authored Nov 1, 2019
2 parents c030ae8 + c0a8729 commit 21efbf1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 33 deletions.
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ edition = '2018'
hex-literal = '0.1.0'
serde = { version = '1.0', optional = true }
serde_derive = { version = '1.0', optional = true }
rstd = { package = 'sr-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
runtime-primitives = { package = 'sr-primitives', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
srml-support = { package = 'srml-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
srml-support-procedural = { package = 'srml-support-procedural', git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
system = { package = 'srml-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
balances = { package = 'srml-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
rstd = { package = 'sr-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
runtime-primitives = { package = 'sr-primitives', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
srml-support = { package = 'srml-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
srml-support-procedural = { package = 'srml-support-procedural', git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
system = { package = 'srml-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
balances = { package = 'srml-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
codec = { package = 'parity-scale-codec', version = '1.0.0', default-features = false, features = ['derive'] }

[dependencies.stake]
default_features = false
git = 'https://github.com/mnaamani/substrate-stake'
package = 'substrate-stake-module'
rev = 'eb4ef9711f1c375cc59f55b74b8a4e725335f4f0' # branch = 'staking'
rev = '28f4815a7d020fdcd450095cc8a8d7076f8899a6' # branch = 'staking'

[dependencies.timestamp]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-timestamp'
rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'
rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'

[dependencies.runtime-io]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-io'
rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'
rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'

[dev-dependencies]
runtime-io = { package = 'sr-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
primitives = { package = 'substrate-primitives', git = 'https://github.com/paritytech/substrate.git', rev = 'a2a0eb5398d6223e531455b4c155ef053a4a3a2b'}
runtime-io = { package = 'sr-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}
primitives = { package = 'substrate-primitives', git = 'https://github.com/paritytech/substrate.git', rev = '0e3001a1ad6fa3d1ba7da7342a8d0d3b3facb2f3'}

[features]
default = ['std']
Expand Down
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
use rstd::prelude::*;

use codec::{Codec, Decode, Encode};
use runtime_primitives::traits::{MaybeSerializeDebug, Member, One, SimpleArithmetic};
use runtime_primitives::traits::{MaybeSerialize, Member, One, SimpleArithmetic};
use srml_support::traits::Currency;
use srml_support::{
decl_module, decl_storage, ensure, EnumerableStorageMap, Parameter, StorageMap, StorageValue,
};
use srml_support::{decl_module, decl_storage, ensure, Parameter};

use rstd::iter::Iterator;

Expand Down Expand Up @@ -43,7 +41,7 @@ pub trait Trait: system::Trait + stake::Trait + Sized {
+ Codec
+ Default
+ Copy
+ MaybeSerializeDebug
+ MaybeSerialize
+ PartialEq;

type ApplicationId: Parameter
Expand All @@ -52,7 +50,7 @@ pub trait Trait: system::Trait + stake::Trait + Sized {
+ Codec
+ Default
+ Copy
+ MaybeSerializeDebug
+ MaybeSerialize
+ PartialEq;

/// Type that will handle various staking events
Expand Down
9 changes: 2 additions & 7 deletions src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::*;

use primitives::{Blake2Hasher, H256};
use primitives::H256;

use crate::{Module, Trait};
use balances;
Expand Down Expand Up @@ -40,7 +40,6 @@ impl system::Trait for Test {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type WeightMultiplierUpdate = ();
type Event = ();
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
Expand Down Expand Up @@ -69,15 +68,11 @@ impl balances::Trait for Test {
/// The ubiquitous event type.
type Event = ();

type TransactionPayment = ();
type DustRemoval = ();
type TransferPayment = ();
type ExistentialDeposit = ExistentialDeposit;
type TransferFee = TransferFee;
type CreationFee = CreationFee;
type TransactionBaseFee = TransactionBaseFee;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = ();
}

impl Trait for Test {
Expand All @@ -100,7 +95,7 @@ impl stake::Trait for Test {
type SlashId = u64;
}

pub fn build_test_externalities() -> runtime_io::TestExternalities<Blake2Hasher> {
pub fn build_test_externalities() -> runtime_io::TestExternalities {
let t = system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap();
Expand Down
16 changes: 7 additions & 9 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
use super::*;
use crate::mock::*;

use runtime_io::with_externalities;

static FIRST_BLOCK_HEIGHT: <Test as system::Trait>::BlockNumber = 1;

use rstd::collections::btree_set::BTreeSet;
Expand All @@ -13,7 +11,7 @@ use rstd::collections::btree_set::BTreeSet;
#[test]
fn add_opening_success_waiting_to_begin() {
with_externalities(&mut build_test_externalities(), || {
build_test_externalities().execute_with(|| {
// FIXTURES

let expected_opening_id = 0;
Expand Down Expand Up @@ -71,7 +69,7 @@ fn add_opening_success_waiting_to_begin() {

#[test]
fn add_opening_fails_due_to_activation_in_the_past() {
with_externalities(&mut build_test_externalities(), || {
build_test_externalities().execute_with(|| {
// FIXTURES

let expected_opening_id = 0;
Expand Down Expand Up @@ -108,22 +106,22 @@ fn add_opening_fails_due_to_activation_in_the_past() {
#[test]
fn cancel_opening_success() {
with_externalities(&mut build_test_externalities(), || {});
build_test_externalities().execute_with(|| {});
}

#[test]
fn cancel_opening_fails_due_to_too_short_application_unstaking_period() {
with_externalities(&mut build_test_externalities(), || {});
build_test_externalities().execute_with(|| {});
}

#[test]
fn cancel_opening_fails_due_to_too_short_role_unstaking_period() {
with_externalities(&mut build_test_externalities(), || {});
build_test_externalities().execute_with(|| {});
}

#[test]
fn cancel_opening_fails_due_to_opening_not_existing() {
with_externalities(&mut build_test_externalities(), || {});
build_test_externalities().execute_with(|| {});
}

//
Expand Down Expand Up @@ -180,5 +178,5 @@ fn cancel_opening_fails_due_to_opening_not_existing() {

#[test]
fn foo() {
with_externalities(&mut build_test_externalities(), || {});
build_test_externalities().execute_with(|| {});
}

0 comments on commit 21efbf1

Please sign in to comment.