Skip to content
Snippets Groups Projects
operator_provider.rs 392 B
Newer Older
  • Learn to ignore specific revisions
  • Ermal Kaleci's avatar
    Ermal Kaleci committed
    use rstd::prelude::Vec;
    
    pub trait OperatorProvider<AccountId> {
    	// Make sure `who` has permission to feed data
    	fn can_feed_data(who: &AccountId) -> bool;
    
    	// return a list of operators
    	fn operators() -> Vec<AccountId>;
    }
    
    Xiliang Chen's avatar
    Xiliang Chen committed
    
    impl<AccountId> OperatorProvider<AccountId> for () {
    	fn can_feed_data(_who: &AccountId) -> bool {
    		false
    	}
    
    	fn operators() -> Vec<AccountId> {
    		Vec::new()
    	}
    }