pallet_encointer_treasuries_rpc_runtime_api/lib.rs
1// Copyright (c) 2019 Alain Brenzikofer
2// This file is part of Encointer
3//
4// Encointer is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Encointer is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Encointer. If not, see <http://www.gnu.org/licenses/>.
16
17//! Runtime API definition required by Treasuries RPC extensions.
18
19#![cfg_attr(not(feature = "std"), no_std)]
20
21use encointer_primitives::communities::CommunityIdentifier;
22use parity_scale_codec::{Decode, Encode};
23
24sp_api::decl_runtime_apis! {
25 pub trait TreasuriesApi<AccountId>
26 where AccountId: Encode + Decode
27 {
28 fn get_community_treasury_account_unchecked(maybecid: &Option<CommunityIdentifier>) -> AccountId;
29 }
30}