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

ZIP-0 Part II #938

Merged
merged 69 commits into from
May 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8c0f2ed
move disputes to simple-disputes
Chralt98 Jan 9, 2023
bddaa72
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 11, 2023
1977d2a
move more to simple-disputes
Chralt98 Jan 11, 2023
c8699d4
wip
Chralt98 Jan 11, 2023
ae91749
wip
Chralt98 Jan 12, 2023
cd85642
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 13, 2023
228d333
some mock preparation
Chralt98 Jan 13, 2023
1f05799
wip
Chralt98 Jan 13, 2023
0b80b7d
fix tests
Chralt98 Jan 13, 2023
6236d51
taplo fmt
Chralt98 Jan 16, 2023
e4a09a9
update court authorized mdms
Chralt98 Jan 16, 2023
a67c50d
add dispute bond to market storage
Chralt98 Jan 16, 2023
9448ab9
mdm funds flow
Chralt98 Jan 16, 2023
c46621e
fix clippy
Chralt98 Jan 17, 2023
2f12959
fix pm benchmarks
Chralt98 Jan 17, 2023
7430066
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 17, 2023
6f10d96
add migration
Chralt98 Jan 17, 2023
9f002a4
simplify migration
Chralt98 Jan 17, 2023
09730a0
correct migration
Chralt98 Jan 18, 2023
f1347c3
migration fixes and call filter
Chralt98 Jan 18, 2023
b42002c
correct admin_destroy_market benchmark
Chralt98 Jan 18, 2023
80b3fa6
improve simple-disputes mock
Chralt98 Jan 18, 2023
bd7c97d
benchmark reserve_outcome
Chralt98 Jan 19, 2023
61e2e1e
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 19, 2023
355dad6
benchmark reserve_outcome
Chralt98 Jan 19, 2023
4aaea4e
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 20, 2023
af3da23
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 23, 2023
ee2681a
fix weights file
Chralt98 Jan 24, 2023
0ff08c0
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Jan 31, 2023
06314bb
fix after merge
Chralt98 Jan 31, 2023
78f0b03
add migration tests
Chralt98 Jan 31, 2023
84bb021
add migration reserve id test
Chralt98 Jan 31, 2023
e5302da
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Feb 1, 2023
c3c5ca6
apply review suggestions
Chralt98 Mar 2, 2023
5d873d2
rename reserve_outcome to suggest_outcome
Chralt98 Mar 2, 2023
88a43dd
separate resolve_disputed_market into parts
Chralt98 Mar 2, 2023
b8cd91a
edit exchange API documentation
Chralt98 Mar 27, 2023
5d6df79
slash dispute bond
Chralt98 Mar 27, 2023
1fc9b39
Merge branch 'release-dispute-system' into chralt98-dispute-restructu…
Chralt98 Mar 28, 2023
ce13fd2
add empty commit
Chralt98 Mar 28, 2023
7b3ff21
correct admin_destroy_market test
Chralt98 Mar 28, 2023
a052320
remove gd dependency from simple disputes
Chralt98 Mar 28, 2023
c3b61cb
Update zrml/simple-disputes/src/mock.rs
Chralt98 Apr 12, 2023
11960de
Update zrml/simple-disputes/src/mock.rs
Chralt98 Apr 12, 2023
6fc9197
Update zrml/prediction-markets/src/lib.rs
Chralt98 Apr 12, 2023
c638679
add doc string
Chralt98 Apr 12, 2023
553e082
add doc strings
Chralt98 Apr 12, 2023
55fdee0
Reduce settle_bonds LOC
sea212 Apr 3, 2023
0efc405
cargo fmt
Chralt98 Apr 12, 2023
aa09b01
Update zrml/prediction-markets/src/migrations.rs
Chralt98 Apr 12, 2023
2c15b96
Update zrml/prediction-markets/src/migrations.rs
Chralt98 Apr 12, 2023
a71bb5c
apply review suggestion
Chralt98 Apr 12, 2023
afd9d61
add correct mdm benchmarking on_dispute
Chralt98 Apr 17, 2023
af0a25a
use on_dispute_weight inside api
Chralt98 Apr 17, 2023
b88aca4
improve mdm weight technique
Chralt98 Apr 17, 2023
f48a0a3
add mdm weights to on_resolution
Chralt98 Apr 18, 2023
cbe528a
add tests for pm
Chralt98 Apr 18, 2023
3c6c9fe
Merge branch 'main' into chralt98-dispute-restructuring
Chralt98 Apr 18, 2023
7ab62c4
modify migration logs, fix try-runtime
Chralt98 Apr 18, 2023
86bd97e
little benchmark fix
Chralt98 Apr 20, 2023
af60129
Update zrml/authorized/src/benchmarks.rs
Chralt98 Apr 20, 2023
ddf14ff
Update zrml/authorized/src/benchmarks.rs
Chralt98 Apr 20, 2023
8513191
use result with weight struct
Chralt98 Apr 20, 2023
1e0fcbc
improve dispute api weight system
Chralt98 Apr 21, 2023
ae99d7f
Use accurate dispute weight instead of max
sea212 May 3, 2023
1f7f337
Merge branch 'release-dispute-system' into chralt98-dispute-restructu…
Chralt98 May 9, 2023
6025960
fix clippy
Chralt98 May 9, 2023
99836e5
Update zrml/prediction-markets/src/migrations.rs
Chralt98 May 15, 2023
7aae6f1
add copyrights
Chralt98 May 15, 2023
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
14 changes: 5 additions & 9 deletions zrml/prediction-markets/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ impl<T: Config + zrml_market_commons::Config> OnRuntimeUpgrade for AddOutsiderAn
if let Some(first_dispute) = old_disputes.first() {
let OldMarketDispute { at: _, by, outcome: _ } = first_dispute;
dispute_bond = Some(Bond::new(by.clone(), T::DisputeBond::get()));
} else {
log::warn!(
"MoveDataToSimpleDisputes: Could not find first dispute for market id \
{:?}",
market_id
);
}
}

Expand Down Expand Up @@ -417,8 +411,8 @@ use frame_support::dispatch::EncodeLike;
use sp_runtime::SaturatedConversion;
use zeitgeist_primitives::types::{MarketDispute, OldMarketDispute};

const PREDICTION_MARKETS_REQUIRED_STORAGE_VERSION: u16 = 7;
const PREDICTION_MARKETS_NEXT_STORAGE_VERSION: u16 = 8;
const PREDICTION_MARKETS_REQUIRED_STORAGE_VERSION: u16 = 6;
const PREDICTION_MARKETS_NEXT_STORAGE_VERSION: u16 = 7;
sea212 marked this conversation as resolved.
Show resolved Hide resolved

#[cfg(feature = "try-runtime")]
type OldDisputesOf<T> = frame_support::BoundedVec<
Expand Down Expand Up @@ -503,7 +497,9 @@ where
&old_dispute.by,
);
if reserved_balance < bond.saturated_into::<u128>().saturated_into() {
log::error!(
// warns for battery station market id 386
// https://discord.com/channels/737780518313000960/817041223201587230/958682619413934151
log::warn!(
"MoveDataToSimpleDisputes: Could not unreserve {:?} for {:?} because \
reserved balance is only {:?}. Market id: {:?}",
bond,
Expand Down