Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Updating for substrate 1.0 beta. #5

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ decl_module! {

// Check if we approve the proposal, if so, mark approved
let total_issuance = <balances::Module<T>>::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) {
<balances::Module<T>>::increase_free_balance_creating(&tgt, qty);
<DepositOf<T>>::insert(transaction_hash, (inx, tgt.clone(), qty, new_signers.clone(), true));
// TODO: fire event
Expand Down Expand Up @@ -200,7 +200,7 @@ decl_module! {

// Check if we approve the proposal
let total_issuance = <balances::Module<T>>::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 <balances::Module<T>>::decrease_free_balance(&tgt, qty) {
Ok(_) => {
// TODO: do we still mark completed on error? or store a "failed" tx?
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<Test>{
authorities: vec![1, 2, 3],
_genesis_phantom_data: Default::default(),
}.build_storage().unwrap().0);
t.into()
}
Expand Down