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

project configs #233

Merged
merged 211 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
802926e
add back sudo to rococo
samelamin Aug 25, 2023
f8b03b8
runtime api
f-gate Sep 12, 2023
b578bc3
runtime-api-wiring
f-gate Sep 14, 2023
da988ce
Merge branch 'main' into rococo_admin
samelamin Sep 17, 2023
0a4c8f3
some dummy log statements
samelamin Sep 18, 2023
f93d211
attempt 1 to add try-runtime
samelamin Sep 19, 2023
897729f
second attempt
samelamin Sep 19, 2023
33353bb
add to the cli
samelamin Sep 19, 2023
fe1cb42
fix warn issue
samelamin Sep 19, 2023
e3a5dd9
on initialise, remove on runtime upgrade proposasl
f-gate Sep 19, 2023
eb01227
Merge branch 'rococo_admin' of github.com:ImbueNetwork/imbue into roc…
f-gate Sep 19, 2023
c8d46b0
add the new storage version migration
f-gate Sep 20, 2023
661c2a8
pick runtime
f-gate Sep 20, 2023
34b5004
new migration for proposals
f-gate Sep 20, 2023
163b02d
fmt
f-gate Sep 20, 2023
c9cdf6e
fix v3-v4 migration test
f-gate Sep 20, 2023
4b15042
fix 2
f-gate Sep 20, 2023
cfee84e
fix brief migration test
f-gate Sep 20, 2023
a078c2a
clippy
f-gate Sep 20, 2023
e01a72f
fmt
f-gate Sep 20, 2023
1d5122c
Merge branch 'rococo_admin' of github.com:ImbueNetwork/imbue into pro…
f-gate Sep 21, 2023
2b4ce51
new MilestoneVote implementation
f-gate Sep 21, 2023
a44b15a
fix implementation
f-gate Sep 21, 2023
6548e99
get project individual votes
f-gate Sep 21, 2023
8b17b33
remove total votes api
f-gate Sep 21, 2023
6431cbb
fmt
f-gate Sep 21, 2023
9719202
ummm
f-gate Sep 21, 2023
a9cee1c
new format for Individual votes
f-gate Sep 21, 2023
b58ab9d
boom baby, and a fmt
f-gate Sep 22, 2023
8c89cd3
clippy
f-gate Sep 22, 2023
560071b
Merge branch 'main' of github.com:ImbueNetwork/imbue into project-vot…
f-gate Sep 22, 2023
92efaf5
fix build
f-gate Sep 22, 2023
0fc2387
fmt
f-gate Sep 22, 2023
55c5782
bump spec version
f-gate Sep 22, 2023
50bf456
1
f-gate Sep 24, 2023
8ff910d
Merge branch 'main' of github.com:ImbueNetwork/imbue into project-vot…
f-gate Sep 25, 2023
9683bfa
individual votes impl with storage
f-gate Sep 25, 2023
c043e3e
fix buggy impl
f-gate Sep 25, 2023
c666930
define immutability, update on vote
f-gate Sep 25, 2023
dbbef52
use individual votes for oninit and submit and close voting + update …
f-gate Sep 26, 2023
7767b82
fixing build
f-gate Sep 26, 2023
0a570fc
seperated test files, tested ImmutableVotes
f-gate Sep 27, 2023
6f66e35
fix runtime api, reorg proposals
f-gate Sep 27, 2023
15c5f1d
fmt
f-gate Sep 27, 2023
e0989aa
fmt
f-gate Sep 27, 2023
31c9ff4
clippy
f-gate Sep 27, 2023
8d32458
migration, err handling
f-gate Sep 27, 2023
af03d54
fix migration
f-gate Sep 27, 2023
57f379a
fmt
f-gate Sep 27, 2023
ca92226
fix
f-gate Sep 27, 2023
c8000da
clippy
f-gate Sep 27, 2023
ceb62b7
update executive and spec version
f-gate Sep 27, 2023
5d1f8a2
Merge branch 'main' of github.com:ImbueNetwork/imbue into project-vot…
f-gate Sep 27, 2023
d295308
fmt
f-gate Sep 27, 2023
79f6966
remove todos
f-gate Sep 27, 2023
0470140
remove wrong comment
f-gate Sep 27, 2023
15a044c
fix failing test
f-gate Sep 28, 2023
5e6f797
fmt
f-gate Sep 28, 2023
283a617
rip the proposals changes
f-gate Sep 28, 2023
b22af4f
Merge branch 'project-voting-data-api' into only-project-config
f-gate Sep 28, 2023
a26c0f6
merge and fix tests
f-gate Sep 28, 2023
2f04699
remove unused config items, reorg them, add test cases
f-gate Sep 28, 2023
08041f3
actually add decent documentation in pallet-proposals
f-gate Sep 28, 2023
7ba1ec5
run on gcp
samelamin Oct 3, 2023
e39b7c8
bump to rebuild
samelamin Oct 3, 2023
2d4025b
use self hosted runner
samelamin Oct 3, 2023
de09ee1
already installed on runner
samelamin Oct 3, 2023
774d8fa
attempt auto scaling runner
samelamin Oct 4, 2023
9821458
increase disk size
samelamin Oct 4, 2023
2395d74
bump to build again
samelamin Oct 4, 2023
8387d02
dont delete at the end of the job
samelamin Oct 4, 2023
21576f0
remove unused directories
samelamin Oct 4, 2023
8b7a43b
bump
samelamin Oct 4, 2023
3c080e9
change region
samelamin Oct 4, 2023
d90513b
split the jobs
samelamin Oct 5, 2023
c4096ad
add -y flag
f-gate Oct 5, 2023
cf7e201
test menually installing rust
f-gate Oct 5, 2023
6063cd8
-y flag
f-gate Oct 5, 2023
1727932
more -y
f-gate Oct 5, 2023
b0724b3
remove double install of protobugf
f-gate Oct 5, 2023
b0b30d7
-y
f-gate Oct 5, 2023
286a0d7
trial 1
f-gate Oct 5, 2023
db2fcd5
fix
f-gate Oct 5, 2023
055f82f
fix2
f-gate Oct 5, 2023
44377e6
fix3
f-gate Oct 5, 2023
87a6403
bump up
samelamin Oct 5, 2023
7051bb0
bump
samelamin Oct 5, 2023
5745c24
change zone
samelamin Oct 5, 2023
195c77d
bump
samelamin Oct 5, 2023
e1f7670
lol -y
samelamin Oct 5, 2023
3c2d57e
bump
samelamin Oct 5, 2023
9768092
bump 2
samelamin Oct 5, 2023
3094af1
set home directory
samelamin Oct 5, 2023
55d8ee7
try to run as user
samelamin Oct 5, 2023
090cd0f
init commit
samelamin Oct 5, 2023
52749f4
commit 2
samelamin Oct 5, 2023
82a14cd
test
samelamin Oct 5, 2023
f4f9e86
test 3
samelamin Oct 5, 2023
92b1542
attempt 4
samelamin Oct 5, 2023
68b2d09
bump
samelamin Oct 5, 2023
890fd28
bump
samelamin Oct 5, 2023
65881c3
bump
samelamin Oct 5, 2023
f89193d
bump
samelamin Oct 5, 2023
fb9f295
bump
samelamin Oct 5, 2023
fc62ee1
reduce image size
samelamin Oct 5, 2023
8bfe500
bump
samelamin Oct 5, 2023
61b642c
bump
samelamin Oct 5, 2023
2e32bb5
bump again
samelamin Oct 5, 2023
1007bf0
add clippy
samelamin Oct 5, 2023
72982ef
build essentials
samelamin Oct 5, 2023
7e978a8
lock
f-gate Oct 5, 2023
1987541
clang
samelamin Oct 5, 2023
ded4454
refactor
samelamin Oct 5, 2023
fb2c338
typo
samelamin Oct 5, 2023
03bee25
typo 2
samelamin Oct 5, 2023
13fecb1
make zone configurable
samelamin Oct 5, 2023
4890b04
Merge branch 'gcp_runner' of github.com:ImbueNetwork/imbue into palle…
f-gate Oct 5, 2023
84dd997
project voting data api (#224)
f-gate Oct 7, 2023
77c9fbc
fixed the conflicts for merging
mshankarrao Oct 11, 2023
75b2d51
Merge pull request #194 from ImbueNetwork/pallet-dispute
mshankarrao Oct 11, 2023
6a71801
Merge remote-tracking branch 'origin' into only-project-config
f-gate Oct 12, 2023
ed77239
refactoring
f-gate Oct 12, 2023
1c0ed6d
mark the no_confidence as deprecated with the introduction of pallet-…
mshankarrao Oct 14, 2023
e3711bb
fix build after painful merge
f-gate Oct 16, 2023
46270b1
migration for new fields
f-gate Oct 16, 2023
91482a6
add to runtime with dummy weights
f-gate Oct 16, 2023
e1e8124
add genesis config
f-gate Oct 16, 2023
ea33b7b
removed everything about no-confidence logic
mshankarrao Oct 16, 2023
d0be81f
fixed the format check as it was failing in the build
mshankarrao Oct 16, 2023
d512608
add fellowship migration, add migration to runtime
f-gate Oct 20, 2023
3eef97b
move migration to v7 after rococo upgrade
f-gate Oct 20, 2023
0cc9b19
fix migration
f-gate Oct 20, 2023
3be3c6a
fix accountid trait bounds
f-gate Oct 22, 2023
8a1b81c
fix dependancy issue: https://github.com/ImbueNetwork/imbue/issues/252
f-gate Oct 23, 2023
23398a1
add fellowship to runtime benchmarks
f-gate Oct 23, 2023
1a3b6f3
generate fellowship weights
f-gate Oct 23, 2023
cc2afd3
Merge branch 'main' of github.com:ImbueNetwork/imbue into add-fellows…
f-gate Oct 23, 2023
079affe
remove test test
f-gate Oct 23, 2023
54df1f5
fmt
f-gate Oct 23, 2023
c058d6a
Merge branch 'main' of github.com:ImbueNetwork/imbue into only-projec…
f-gate Oct 23, 2023
c9c81aa
Merge branch 'add-fellowship-pallet' of github.com:ImbueNetwork/imbue…
f-gate Oct 23, 2023
fcabf77
add jury selector trait
f-gate Oct 23, 2023
583f9b7
run gcp on all pushes
f-gate Oct 23, 2023
4fe6861
restore
f-gate Oct 23, 2023
c5d7e52
Merge branch 'add-fellowship-pallet' of github.com:ImbueNetwork/imbue…
f-gate Oct 23, 2023
6c9511b
select a random jury given a jury length
f-gate Oct 23, 2023
dabc566
fix randomer
f-gate Oct 24, 2023
d3bfdf8
select jury tests
f-gate Oct 24, 2023
90bae34
refactor minor
f-gate Oct 24, 2023
cc5de8b
remove genesis, add permissions, FellowshipPermissions trait
f-gate Oct 24, 2023
24415bb
permissions impl, mock impl
f-gate Oct 24, 2023
d9ff646
fix tests
f-gate Oct 24, 2023
f89d954
organise tests, add permissions tests
f-gate Oct 26, 2023
d16f666
add new config to runtime
f-gate Oct 26, 2023
322fe61
fmt
f-gate Oct 26, 2023
abeea12
Merge branch 'add-fellowship-pallet' of github.com:ImbueNetwork/imbue…
f-gate Oct 26, 2023
f56025a
add jury selector into migration
f-gate Oct 26, 2023
b998a5d
dispute hooks draft, pallet-dispute in runtime
f-gate Oct 27, 2023
9dbfc9c
raise disputes and hooks skeleton
f-gate Oct 30, 2023
af54044
forgot
f-gate Oct 31, 2023
ce63bea
trait bounds impl, todos
f-gate Nov 1, 2023
4cc859a
bugs
f-gate Nov 2, 2023
dc40f0f
Merge branch 'deprecating-no-confidence' of github.com:ImbueNetwork/i…
f-gate Nov 2, 2023
7250e64
fix
f-gate Nov 2, 2023
dc23a9d
tests
f-gate Nov 3, 2023
c99e766
track dispute per milestone instead of per project
f-gate Nov 3, 2023
7394997
minor fixes
f-gate Nov 4, 2023
0fd2db3
update withdrawn to use is_withdrawn
f-gate Nov 4, 2023
af30ff6
fix
f-gate Nov 4, 2023
87b7d91
fix
f-gate Nov 4, 2023
0609bfc
more todos! Jury selector fix
f-gate Nov 4, 2023
bf8ff36
tests, refund extrinsic
f-gate Nov 6, 2023
6aead07
mindbending fix
f-gate Nov 6, 2023
b3c8996
try_mutate_exists instead
f-gate Nov 6, 2023
c964241
fixing just keep fixing
f-gate Nov 6, 2023
4f7ff14
another one
f-gate Nov 6, 2023
2f83a5c
marching
f-gate Nov 6, 2023
f17b8f3
my fingers hurt
f-gate Nov 6, 2023
14034b1
green stuff has appeared!
f-gate Nov 6, 2023
49f2029
grants fixes
f-gate Nov 6, 2023
432ab4c
fixrs
f-gate Nov 7, 2023
912926b
fix
f-gate Nov 7, 2023
8f4cd17
optimise refund extrinsics
f-gate Nov 8, 2023
b60cd35
add non zero arith check, deposit event, refund benchmark
f-gate Nov 8, 2023
0ff2be7
fix
f-gate Nov 8, 2023
bbf3d30
raise dispute benchmark
f-gate Nov 8, 2023
53e398e
migration madness
f-gate Nov 9, 2023
70c8e70
fix migration and tests
f-gate Nov 12, 2023
c25916b
jury selector move around
f-gate Nov 20, 2023
d03c0c9
fix bloomin proposals
f-gate Nov 20, 2023
41b6415
fix briefs
f-gate Nov 20, 2023
dc32bd3
fix grants
f-gate Nov 20, 2023
03361b3
fiix runtime
f-gate Nov 20, 2023
790a7fd
fix integration test, rewrite get jury
f-gate Nov 21, 2023
bf3be27
generate dispute weights
f-gate Nov 23, 2023
da5a21b
Merge branch 'main' of github.com:ImbueNetwork/imbue into only-projec…
f-gate Nov 24, 2023
5343cb9
fix all but deposits
f-gate Nov 24, 2023
998123f
fix xcm tranfers
f-gate Nov 24, 2023
71b03fd
trying
f-gate Nov 24, 2023
2b5d1ab
fix grants benchmark tests
samelamin Nov 24, 2023
133a467
fix for proposal benchmark tests
samelamin Nov 24, 2023
8b49a87
cargo fmt
samelamin Nov 24, 2023
7e594c4
fix for failing benchmark tests
samelamin Nov 24, 2023
10c1ba0
audit warnings
f-gate Nov 24, 2023
1f55e98
minor fix
f-gate Nov 24, 2023
41006eb
remove generic param for run to block felloship
f-gate Nov 24, 2023
8ae4b89
clippy
f-gate Nov 24, 2023
fd91fe5
weights
f-gate Nov 24, 2023
28d617c
proposal benchmark fixes + weights
f-gate Nov 24, 2023
8bf222a
change balance type proposals mock to u128 to prevent overflow
f-gate Nov 24, 2023
97daea9
fmt
f-gate Nov 24, 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
11 changes: 7 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 7 additions & 21 deletions libs/common-types/src/milestone_origin.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{sp_runtime::traits::AccountIdConversion, PalletId};
use scale_info::TypeInfo;
use xcm::latest::{Junction, Junctions::*, MultiLocation};

/// A wrapper around
pub trait TreasuryOriginConverter<AccountId: Into<[u8; 32]>> {
fn get_multi_location(
&self,
recipiant: AccountId,
) -> Result<MultiLocation, TreasuryOriginError>;
pub trait TreasuryOriginConverter {
fn get_multi_location(&self) -> Result<MultiLocation, TreasuryOriginError>;
}

impl<AccountId: Into<[u8; 32]>> TreasuryOriginConverter<AccountId> for TreasuryOrigin {
fn get_multi_location(
&self,
recipiant: AccountId,
) -> Result<MultiLocation, TreasuryOriginError> {
impl TreasuryOriginConverter for TreasuryOrigin {
fn get_multi_location(&self) -> Result<MultiLocation, TreasuryOriginError> {
match &self {
TreasuryOrigin::Kusama => Ok(MultiLocation::new(
1,
X1(Junction::AccountId32 {
id: recipiant.into(),
id: PalletId(*b"py/trsry").into_account_truncating(),
network: None,
}),
)),
TreasuryOrigin::Imbue => Ok(MultiLocation::new(
0,
X1(Junction::AccountId32 {
id: recipiant.into(),
id: PalletId(*b"py/trsry").into_account_truncating(),
network: None,
}),
)),
Expand All @@ -43,15 +38,6 @@ pub enum TreasuryOriginError {
NetworkUnsupported,
}

#[derive(
Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen,
)]
pub enum FundingType {
Proposal,
Brief,
Grant(TreasuryOrigin),
}

#[derive(
Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen,
)]
Expand Down
6 changes: 4 additions & 2 deletions pallets/briefs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li
common-traits = { path = "../../libs/common-traits", default-features = false }
common-types = { path = "../../libs/common-types", default-features = false }
pallet-deposits = {path= "../deposits", default-features = false }
pallet-fellowship = { path = "../fellowship", default-features = false }
pallet-proposals = {path= "../proposals", default-features = false }

[dev-dependencies]
Expand All @@ -54,7 +55,7 @@ common-types = { path = "../../libs/common-types" }
common-runtime = { path = "../../runtime/common"}
pallet-proposals = {path= "../proposals"}
pallet-deposits = {path= "../deposits"}

pallet-disputes = {path= "../disputes"}

[features]
default = [ 'std' ]
Expand All @@ -70,7 +71,7 @@ std = [
"pallet-balances/std",
"pallet-deposits/std",
"pallet-proposals/std",
"pallet-timestamp/std",
"pallet-fellowship/std",
"scale-info/std",
"serde/std",
"sp-api/std",
Expand Down Expand Up @@ -102,6 +103,7 @@ try-runtime = [
"pallet-proposals/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-fellowship/try-runtime",
"pallet-xcm/try-runtime",
"sp-runtime/try-runtime",
]
43 changes: 35 additions & 8 deletions pallets/briefs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ mod benchmarking;
#[cfg(any(feature = "runtime-benchmarks", test))]
mod test_utils;

pub mod migrations;
//pub mod migrations;

#[frame_support::pallet]
pub mod pallet {
use common_types::{milestone_origin::FundingType, CurrencyId};
use common_types::CurrencyId;
use frame_support::{
pallet_prelude::*, sp_runtime::Saturating, traits::Get, weights::Weight, BoundedBTreeMap,
};
use frame_system::pallet_prelude::*;
use orml_traits::{MultiCurrency, MultiReservableCurrency};
use pallet_deposits::traits::DepositHandler;
use pallet_fellowship::traits::SelectJury;
use pallet_proposals::traits::IntoProposal;
use pallet_proposals::{Contribution, ProposedMilestone};
use pallet_proposals::{Contribution, FundingPath, ProposedMilestone};
use sp_arithmetic::per_things::Percent;
use sp_core::H256;
use sp_runtime::traits::Zero;
Expand Down Expand Up @@ -70,8 +71,8 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The currency type.
type RMultiCurrency: MultiReservableCurrency<AccountIdOf<Self>, CurrencyId = CurrencyId>;
type AuthorityOrigin: EnsureOrigin<Self::RuntimeOrigin>;
/// The type that allows for evolution from brief to proposal.
type IntoProposal: IntoProposal<AccountIdOf<Self>, BalanceOf<Self>, BlockNumberFor<Self>>;
/// The maximum amount of owners to a brief.
Expand All @@ -82,7 +83,9 @@ pub mod pallet {
/// Storage deposits.
type BriefStorageItem: Get<StorageItemOf<Self>>;
type DepositHandler: DepositHandler<BalanceOf<Self>, AccountIdOf<Self>>;

/// The type that selects a list of jury members.
type JurySelector: SelectJury<AccountIdOf<Self>>;
/// The weight info for the extrinsics.
type WeightInfo: WeightInfoT;
}

Expand Down Expand Up @@ -147,6 +150,8 @@ pub mod pallet {
FreelancerApprovalRequired,
/// Milestones total do not add up to 100%.
MilestonesTotalPercentageMustEqual100,
/// too many milestones here mate fixed with https://github.com/ImbueNetwork/imbue/issues/267
TooManyMilestones,
}

#[pallet::call]
Expand Down Expand Up @@ -291,13 +296,35 @@ pub mod pallet {
let contributions = BriefContributions::<T>::get(brief_id);

<T as Config>::DepositHandler::return_deposit(brief.deposit_id)?;

let refund_locations =
<T as Config>::IntoProposal::convert_contributions_to_refund_locations(
&contributions
.clone()
.into_inner()
.try_into()
.map_err(|_| Error::<T>::TooManyBriefOwners)?,
);

<T as Config>::IntoProposal::convert_to_proposal(
brief.currency_id,
contributions.into_inner(),
contributions
.into_inner()
.try_into()
.map_err(|_| Error::<T>::TooManyBriefOwners)?,
brief_id,
brief.applicant,
brief.milestones.into(),
FundingType::Brief,
brief
.milestones
.to_vec()
.try_into()
.map_err(|_| Error::<T>::TooManyMilestones)?,
refund_locations,
<T::JurySelector as SelectJury<AccountIdOf<T>>>::select_jury()
.to_vec()
.try_into()
.map_err(|_| Error::<T>::TooManyMilestones)?,
FundingPath::TakeFromReserved,
)?;

BriefContributions::<T>::remove(brief_id);
Expand Down
46 changes: 35 additions & 11 deletions pallets/briefs/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,17 @@ parameter_types! {
impl pallet_briefs::Config for Test {
type RuntimeEvent = RuntimeEvent;
type RMultiCurrency = Tokens;
type AuthorityOrigin = EnsureRoot<AccountId>;
type IntoProposal = pallet_proposals::Pallet<Test>;
type MaxBriefOwners = MaxBriefOwners;
type MaxMilestonesPerBrief = MaxMilestonesPerProject;
type BriefStorageItem = BriefStorageItem;
type DepositHandler = MockDepositHandler;
type WeightInfo = pallet_briefs::WeightInfo<Self>;
type JurySelector = MockJurySelector;
}

parameter_types! {
pub const TwoWeekBlockUnit: u32 = 100800u32;
pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant");
pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into();
pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8);
pub MaximumContributorsPerProject: u32 = 50;
pub RefundsPerBlock: u8 = 2;
Expand All @@ -226,30 +224,31 @@ parameter_types! {
pub ExpiringProjectRoundsPerBlock: u32 = 10;
pub ProjectStorageItem: StorageItem = StorageItem::Project;
pub MaxProjectsPerAccount: u16 = 100;
pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8);
pub ImbueFeeAccount: AccountId = TREASURY;
pub MaxJuryMembers: u32 = 100;
}

impl pallet_proposals::Config for Test {
type RuntimeEvent = RuntimeEvent;
type PalletId = ProposalsPalletId;
type AuthorityOrigin = EnsureRoot<AccountId>;
type MultiCurrency = Tokens;
type WeightInfo = pallet_proposals::WeightInfo<Self>;
// Adding 2 weeks as th expiration time
type MaxWithdrawalExpiration = TwoWeekBlockUnit;
type NoConfidenceTimeLimit = NoConfidenceTimeLimit;
type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass;
type MaximumContributorsPerProject = MaximumContributorsPerProject;
type MilestoneVotingWindow = MilestoneVotingWindow;
type RefundHandler = pallet_proposals::traits::MockRefundHandler<Test>;
type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler<Test>;
type MaxMilestonesPerProject = MaxMilestonesPerProject;
type ImbueFee = ImbueFee;
type ImbueFeeAccount = ImbueFeeAccount;
type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock;
type ProjectStorageItem = ProjectStorageItem;
type DepositHandler = MockDepositHandler;
type ProjectStorageItem = ProjectStorageItem;
type MaxProjectsPerAccount = MaxProjectsPerAccount;
type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass;
type DisputeRaiser = MockDisputeRaiser;
type JurySelector = MockJurySelector;
type AssetSignerOrigin = EnsureRoot<AccountId>;
}

parameter_types! {
pub const BasicDeposit: u64 = 10;
pub const FieldDeposit: u64 = 10;
Expand Down Expand Up @@ -281,6 +280,7 @@ parameter_types! {
pub static ALICE: AccountId = 125;
pub static BOB: AccountId = 126;
pub static CHARLIE: AccountId = 127;
pub static TREASURY: AccountId = 200;

pub(crate) fn build_test_externality() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<Test>::default()
Expand All @@ -307,3 +307,27 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities {
});
ext
}

pub struct MockJurySelector;
impl pallet_fellowship::traits::SelectJury<AccountId> for MockJurySelector {
type JurySize = MaxJuryMembers;
fn select_jury() -> BoundedVec<AccountId, Self::JurySize> {
BoundedVec::new()
}
}

pub struct MockDisputeRaiser;
impl pallet_disputes::traits::DisputeRaiser<AccountId> for MockDisputeRaiser {
type DisputeKey = u32;
type SpecificId = u32;
type MaxJurySize = MaxJuryMembers;
type MaxSpecifics = MaxMilestonesPerProject;
fn raise_dispute(
_dispute_key: Self::DisputeKey,
_raised_by: AccountId,
_jury: BoundedVec<AccountId, Self::MaxJurySize>,
_specific_ids: BoundedVec<Self::SpecificId, Self::MaxSpecifics>,
) -> Result<(), DispatchError> {
Ok(())
}
}
Loading
Loading