-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from PavitraAgarwal21/main
add : test for channel component
- Loading branch information
Showing
7 changed files
with
1,338 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod IComposable; | ||
pub mod IJoltUpgrade; | ||
pub mod IChannelComposable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
use starknet::ContractAddress; | ||
use karst::base::constants::types::{ChannelDetails, ChannelMember}; | ||
use karst::base::constants::types::{ | ||
GateKeepType, CommunityGateKeepDetails, CommunityType, CommunityDetails, CommunityMember | ||
}; | ||
// ************************************************************************* | ||
// INTERFACE of KARST CHANNEL | ||
// ************************************************************************* | ||
#[starknet::interface] | ||
pub trait IChannelComposable<TState> { | ||
// ************************************************************************* | ||
// INTERFACE of ICHANNEL | ||
// ************************************************************************* | ||
|
||
// ************************************************************************* | ||
// EXTERNALS | ||
// ************************************************************************* | ||
fn create_channel(ref self: TState, community_id: u256) -> u256; | ||
fn join_channel(ref self: TState, channel_id: u256); | ||
fn leave_channel(ref self: TState, channel_id: u256); | ||
fn set_channel_metadata_uri(ref self: TState, channel_id: u256, metadata_uri: ByteArray); | ||
fn add_channel_mods(ref self: TState, channel_id: u256, moderators: Array<ContractAddress>); | ||
fn remove_channel_mods(ref self: TState, channel_id: u256, moderators: Array<ContractAddress>); | ||
fn set_channel_censorship_status(ref self: TState, channel_id: u256, censorship_status: bool); | ||
fn set_channel_ban_status( | ||
ref self: TState, | ||
channel_id: u256, | ||
profiles: Array<ContractAddress>, | ||
ban_statuses: Array<bool> | ||
); | ||
// ************************************************************************* | ||
// GETTERS | ||
// ************************************************************************* | ||
fn get_channel(self: @TState, channel_id: u256) -> ChannelDetails; | ||
fn get_channel_metadata_uri(self: @TState, channel_id: u256) -> ByteArray; | ||
fn is_channel_member( | ||
self: @TState, profile: ContractAddress, channel_id: u256 | ||
) -> (bool, ChannelMember); | ||
fn get_total_channel_members(self: @TState, channel_id: u256) -> u256; | ||
fn is_channel_mod(self: @TState, profile: ContractAddress, channel_id: u256) -> bool; | ||
fn get_channel_censorship_status(self: @TState, channel_id: u256) -> bool; | ||
fn get_channel_ban_status(self: @TState, profile: ContractAddress, channel_id: u256) -> bool; | ||
// ************************************************************************* | ||
// INTERFACE of ICOMMUNITY | ||
// ************************************************************************* | ||
|
||
// ************************************************************************* | ||
// EXTERNALS | ||
// ************************************************************************* | ||
fn create_community(ref self: TState) -> u256; | ||
fn join_community(ref self: TState, community_id: u256); | ||
fn leave_community(ref self: TState, community_id: u256); | ||
fn set_community_metadata_uri(ref self: TState, community_id: u256, metadata_uri: ByteArray); | ||
fn add_community_mods(ref self: TState, community_id: u256, moderators: Array<ContractAddress>); | ||
fn remove_community_mods( | ||
ref self: TState, community_id: u256, moderators: Array<ContractAddress> | ||
); | ||
fn set_ban_status( | ||
ref self: TState, | ||
community_id: u256, | ||
profiles: Array<ContractAddress>, | ||
ban_statuses: Array<bool> | ||
); | ||
fn upgrade_community(ref self: TState, community_id: u256, upgrade_type: CommunityType); | ||
fn gatekeep( | ||
ref self: TState, | ||
community_id: u256, | ||
gate_keep_type: GateKeepType, | ||
nft_contract_address: ContractAddress, | ||
permissioned_addresses: Array<ContractAddress>, | ||
entry_fee: u256 | ||
); | ||
|
||
// ************************************************************************* | ||
// GETTERS | ||
// ************************************************************************* | ||
fn get_community(self: @TState, community_id: u256) -> CommunityDetails; | ||
fn get_community_metadata_uri(self: @TState, community_id: u256) -> ByteArray; | ||
fn is_community_member( | ||
self: @TState, profile: ContractAddress, community_id: u256 | ||
) -> (bool, CommunityMember); | ||
fn get_total_members(self: @TState, community_id: u256) -> u256; | ||
fn is_community_mod(self: @TState, profile: ContractAddress, community_id: u256) -> bool; | ||
fn get_ban_status(self: @TState, profile: ContractAddress, community_id: u256) -> bool; | ||
fn is_premium_community(self: @TState, community_id: u256) -> (bool, CommunityType); | ||
fn is_gatekeeped(self: @TState, community_id: u256) -> (bool, CommunityGateKeepDetails); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.