@@ -19,6 +19,7 @@ pub fn wasm_binary_unwrap() -> &'static [u8] {
1919use codec:: { Decode , Encode } ;
2020use fp_rpc:: TransactionStatus ;
2121use frame_system:: { EnsureOneOf , EnsureRoot } ;
22+ use pallet_daoportal:: datastructures:: { DAOProposal , Project , ProjectId , ProposalId } ;
2223use pallet_grandpa:: fg_primitives;
2324use pallet_grandpa:: { AuthorityId as GrandpaId , AuthorityList as GrandpaAuthorityList } ;
2425use pallet_im_online:: sr25519:: AuthorityId as ImOnlinedId ;
@@ -125,7 +126,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
125126 // `spec_version`, and `authoring_version` are the same between Wasm and native.
126127 // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
127128 // the compatible custom types.
128- spec_version : 1004 ,
129+ spec_version : 1005 ,
129130 impl_version : 1 ,
130131 apis : RUNTIME_API_VERSIONS ,
131132 transaction_version : 1 ,
@@ -180,6 +181,7 @@ impl Contains<Call> for CallFilter {
180181 | Call :: BridgeTransfer ( _)
181182 | Call :: ChainBridge ( _)
182183 | Call :: ElectionProviderMultiPhase ( _)
184+ | Call :: DAOPortal ( _)
183185 | Call :: Democracy ( _)
184186 | Call :: Council ( _)
185187 | Call :: TechnicalCommittee ( _)
@@ -555,6 +557,26 @@ impl pallet_game::Config for Runtime {
555557 type WeightInfo = pallet_game:: weights:: SubstrateWeight < Runtime > ;
556558}
557559
560+ parameter_types ! {
561+ pub const MinDuration : u64 = 3600000 ;
562+ pub const MaxDuration : u64 = 2592000000 ;
563+ pub const MaxOptionCount : u8 = 10 ;
564+ pub const MaxWorkspace : u32 = 10 ;
565+ pub const MaxStrategy : u32 = 10 ;
566+ }
567+
568+ impl pallet_daoportal:: Config for Runtime {
569+ type Event = Event ;
570+ type Currency = Balances ;
571+ type MinDuration = MinDuration ;
572+ type MaxDuration = MaxDuration ;
573+ type MaxOptionCount = MaxOptionCount ;
574+ type MaxWorkspace = MaxWorkspace ;
575+ type MaxStrategy = MaxStrategy ;
576+ type UnixTime = Timestamp ;
577+ type DAOPortalWeightInfo = pallet_daoportal:: weights:: SubstrateWeight < Runtime > ;
578+ }
579+
558580impl pallet_sudo:: Config for Runtime {
559581 type Event = Event ;
560582 type Call = Call ;
@@ -1053,6 +1075,7 @@ construct_runtime!(
10531075 ChainBridge : pallet_bridge:: { Pallet , Call , Storage , Event <T >} ,
10541076 BridgeTransfer : pallet_bridgetransfer:: { Pallet , Call , Event <T >} ,
10551077 Game : pallet_game:: { Pallet , Call , Storage , Event <T >} ,
1078+ DAOPortal : pallet_daoportal:: { Pallet , Call , Storage , Event <T >} ,
10561079 }
10571080) ;
10581081
@@ -1275,6 +1298,20 @@ impl_runtime_apis! {
12751298 // }
12761299 // }
12771300
1301+ impl apis:: DAOPortalApi <Block > for Runtime {
1302+ fn get_projects( ) -> Vec <( ProjectId , Project <AccountId >) > {
1303+ DAOPortal :: get_projects( )
1304+ }
1305+
1306+ fn get_proposals( project_id: ProjectId ) -> Vec <( ProjectId , DAOProposal <AccountId >) > {
1307+ DAOPortal :: get_proposals( project_id)
1308+ }
1309+
1310+ fn get_all_proposals( ) -> Vec <( ProjectId , ProposalId , DAOProposal <AccountId >) > {
1311+ DAOPortal :: get_all_proposals( )
1312+ }
1313+ }
1314+
12781315 impl fp_rpc:: EthereumRuntimeRPCApi <Block > for Runtime {
12791316 fn chain_id( ) -> u64 {
12801317 <Runtime as pallet_evm:: Config >:: ChainId :: get( )
0 commit comments