@@ -107,28 +107,35 @@ pub trait Trait: system::Trait{
107107
108108// Events in order of expected incidence
109109decl_event ! (
110- pub enum Event <T >{
110+ pub enum Event <T > where
111+ <T as Trait >:: EncoderId ,
112+ <T as Trait >:: HosterId ,
113+ <T as Trait >:: FeedId ,
114+ <T as Trait >:: ContractId ,
115+ <T as Trait >:: PlanId ,
116+ <T as Trait >:: ChallengeId
117+ {
111118 /// New feed registered
112- NewFeed ( T :: FeedId ) ,
119+ NewFeed ( FeedId ) ,
113120 /// New hosting plan
114- NewPlan ( T :: PlanId ) ,
121+ NewPlan ( PlanId ) ,
115122 //const data = [encoderID, hosterID, selectedPlan.feed, contractID, contract.ranges]
116123 /// A new contract is created between publisher, encoder, and hoster
117- NewContract ( T :: EncoderId , T :: HosterId , T :: FeedId , T :: ContractId , ContractRanges ) ,
124+ NewContract ( EncoderId , HosterId , FeedId , ContractId , ContractRanges ) ,
118125 /// Hosting (contract) started
119- HostingStarted ( T :: ContractId ) ,
126+ HostingStarted ( ContractId ) ,
120127 /// New proof-of-storage challenge
121- ProofOfStorageChallenge ( T :: ChallengeId ) ,
128+ ProofOfStorageChallenge ( ChallengeId ) ,
122129 /// Proof of storage confirmed
123- ProofOfStorageConfirmed ( T :: AttestorId , T :: ChallengeId ) ,
130+ ProofOfStorageConfirmed ( AttestorId , ChallengeId ) ,
124131 /// Proof of storage not confirmed
125- ProofOfStorageFailed ( T :: ChallengeId ) ,
132+ ProofOfStorageFailed ( ChallengeId ) ,
126133 /// Attestation of retrievability requested
127- ProofOfRetrievabilityAttestation ( T :: ChallengeId ) ,
134+ ProofOfRetrievabilityAttestation ( ChallengeId ) ,
128135 /// Proof of retrievability confirmed
129- ProofOfRetrievabilityConfirmed ( T :: ChallengeId ) ,
136+ ProofOfRetrievabilityConfirmed ( ChallengeId ) ,
130137 /// Data serving not verified
131- ProofOfRetrievabilityFailed ( T :: ChallengeId ) ,
138+ ProofOfRetrievabilityFailed ( ChallengeId ) ,
132139 }
133140) ;
134141
@@ -220,12 +227,12 @@ struct Attestation<T: Trait> {
220227decl_storage ! {
221228 trait Store for Module <T : Trait > as DatVerify {
222229 // public/api
223- pub GetFeedByID : map hasher( twox_64_concat) T :: FeedId => Feed <T >;
224- pub GetUserByID : map hasher( twox_64_concat) T :: UserId => User <T >;
225- pub GetContractByID : map hasher( twox_64_concat) T :: ContractId => Contract <T >;
226- pub GetChallengeByID : map hasher( twox_64_concat) T :: ChallengeId => Challenge <T >;
227- pub GetPlanByID : map hasher( twox_64_concat) T :: PlanId => Plan <T >;
228- pub GetAttestationByID : map hasher( twox_64_concat) T :: AttestationId => Attestation <T >;
230+ pub GetFeedByID : map hasher( twox_64_concat) T :: FeedId => Option < Feed <T > >;
231+ pub GetUserByID : map hasher( twox_64_concat) T :: UserId => Option < User <T > >;
232+ pub GetContractByID : map hasher( twox_64_concat) T :: ContractId => Option < Contract <T > >;
233+ pub GetChallengeByID : map hasher( twox_64_concat) T :: ChallengeId => Option < Challenge <T > >;
234+ pub GetPlanByID : map hasher( twox_64_concat) T :: PlanId => Option < Plan <T > >;
235+ pub GetAttestationByID : map hasher( twox_64_concat) T :: AttestationId => Option < Attestation <T > >;
229236 // internally required storage
230237 pub GetNextFeedID : T :: FeedId ;
231238 pub GetNextUserID : T :: UserId ;
0 commit comments