diff --git a/Cargo.toml b/Cargo.toml index 1f04bf5..bd69044 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,18 +10,18 @@ serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "2.1", default-features = false } parity-codec-derive = { version = "2.1", default-features = false } -substrate-keyring = { git = "https://github.com/paritytech/substrate/", optional = true } -substrate-primitives = { git = "https://github.com/paritytech/substrate/", default-features = false } -sr-std = { git = "https://github.com/paritytech/substrate/", default-features = false } -sr-io = { git = "https://github.com/paritytech/substrate/", default-features = false } -sr-primitives = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-support = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-system = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-balances = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-consensus = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-session = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-timestamp = { git = "https://github.com/paritytech/substrate/", default-features = false } -srml-democracy = { git = "https://github.com/paritytech/substrate/", default-features = false } +substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "v0.9", optional = true } +substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +sr-std = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +sr-io = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-support = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-system = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-balances = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-consensus = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-session = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-timestamp = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } +srml-democracy = { git = "https://github.com/paritytech/substrate", branch = "v0.9", default-features = false } [features] default = ["std"] diff --git a/src/bridge.rs b/src/bridge.rs index df88f6c..818c214 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -118,7 +118,7 @@ decl_module! { // Check if we approve the proposal, if so, mark approved let total_issuance = >::total_issuance(); - if VoteThreshold::SuperMajorityApprove.approved(stake_sum, total_issuance - stake_sum, total_issuance) { + if VoteThreshold::SuperMajorityApprove.approved(stake_sum, total_issuance - stake_sum, total_issuance, total_issuance) { >::increase_free_balance_creating(&tgt, qty); >::insert(transaction_hash, (inx, tgt.clone(), qty, new_signers.clone(), true)); // TODO: fire event @@ -200,7 +200,7 @@ decl_module! { // Check if we approve the proposal let total_issuance = >::total_issuance(); - if VoteThreshold::SuperMajorityApprove.approved(stake_sum, total_issuance - stake_sum, total_issuance) { + if VoteThreshold::SuperMajorityApprove.approved(stake_sum, total_issuance - stake_sum, total_issuance, total_issuance) { match >::decrease_free_balance(&tgt, qty) { Ok(_) => { // TODO: do we still mark completed on error? or store a "failed" tx? diff --git a/src/lib.rs b/src/lib.rs index 214a0c8..6e7cd47 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,11 +113,12 @@ mod tests { const NOTE_OFFLINE_POSITION: u32 = 1; type Log = DigestItem; type SessionKey = u64; - type OnOfflineValidator = (); + type InherentOfflineReport = (); } impl timestamp::Trait for Test { const TIMESTAMP_SET_POSITION: u32 = 0; type Moment = u64; + type OnTimestampSet = (); } impl session::Trait for Test { type ConvertAccountIdToSessionKey = Identity; @@ -146,11 +147,9 @@ mod tests { transfer_fee: 0, creation_fee: 0, reclaim_rebate: 0, - _genesis_phantom_data: Default::default(), }.build_storage().unwrap().0); t.extend(bridge::GenesisConfig::{ authorities: vec![1, 2, 3], - _genesis_phantom_data: Default::default(), }.build_storage().unwrap().0); t.into() }