Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove structs mentioned under TODO(#986) #1342

Merged
merged 3 commits into from
Jun 11, 2024
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
10 changes: 1 addition & 9 deletions zrml/global-disputes/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023 Forecasting Technologies LTD.
// Copyright 2022-2024 Forecasting Technologies LTD.
//
// This file is part of Zeitgeist.
//
Expand Down Expand Up @@ -80,9 +80,6 @@ mod pallet {
pub type LockInfoOf<T> =
BoundedVec<(MarketIdOf<T>, BalanceOf<T>), <T as Config>::MaxGlobalDisputeVotes>;

// TODO(#968): to remove after the storage migration
pub type WinnerInfoOf<T> = OldWinnerInfo<BalanceOf<T>, OwnerInfoOf<T>>;

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
const LOG_TARGET: &str = "runtime::zrml-global-disputes";
Expand Down Expand Up @@ -181,11 +178,6 @@ mod pallet {
pub type GlobalDisputesInfo<T: Config> =
StorageMap<_, Twox64Concat, MarketIdOf<T>, GlobalDisputeInfoOf<T>, OptionQuery>;

// TODO(#986): to remove after the storage migration
#[pallet::storage]
pub type Winners<T: Config> =
StorageMap<_, Twox64Concat, MarketIdOf<T>, WinnerInfoOf<T>, OptionQuery>;

#[pallet::event]
#[pallet::generate_deposit(fn deposit_event)]
pub enum Event<T>
Expand Down
31 changes: 1 addition & 30 deletions zrml/global-disputes/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023 Forecasting Technologies LTD.
// Copyright 2022-2024 Forecasting Technologies LTD.
//
// This file is part of Zeitgeist.
//
Expand Down Expand Up @@ -93,35 +93,6 @@ pub enum GdStatus<BlockNumber> {
Destroyed,
}

// TODO(#986): to remove after the storage migration

/// The information about a voting outcome of a global dispute.
#[derive(Debug, TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)]
pub struct OldOutcomeInfo<Balance, OwnerInfo> {
/// The current sum of all locks on this outcome.
pub outcome_sum: Balance,
/// The vector of owners of the outcome.
pub owners: OwnerInfo,
}

/// The information about the current highest winning outcome.
#[derive(TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)]
pub struct OldWinnerInfo<Balance, OwnerInfo> {
/// The outcome, which is in the lead.
pub outcome: OutcomeReport,
/// The information about the winning outcome.
pub outcome_info: OldOutcomeInfo<Balance, OwnerInfo>,
/// Check, if the global dispute is finished.
pub is_finished: bool,
}

impl<Balance: Saturating, OwnerInfo: Default> OldWinnerInfo<Balance, OwnerInfo> {
pub fn new(outcome: OutcomeReport, vote_sum: Balance) -> Self {
let outcome_info = OldOutcomeInfo { outcome_sum: vote_sum, owners: Default::default() };
OldWinnerInfo { outcome, is_finished: false, outcome_info }
}
}

/// An initial vote outcome item with the outcome owner and the initial vote amount.
pub struct InitialItem<AccountId, Balance> {
/// The outcome which is added as initial global dispute vote possibility.
Expand Down
Loading