diff --git a/src/base/constants/types.cairo b/src/base/constants/types.cairo index 261ca94..202de64 100644 --- a/src/base/constants/types.cairo +++ b/src/base/constants/types.cairo @@ -26,7 +26,7 @@ pub struct Profile { pub enum BackVariants { BLUEFLAG, BLUEGOLFSTICK, - FISHINGSTICK, + FISHINGSTICK, REDFLAG, STYLIZEDBATON, WHITEGOLFSTICK, @@ -69,7 +69,7 @@ pub enum FaceVariants { FACE4, FACE5, FACE6, - FACE7, + FACE7, FACE8, } @@ -78,8 +78,8 @@ pub enum AccessoryVariants { BLACKVISOR, BLUEMASK, CAP, - ORANGEMASK, - PINKVISOR, + ORANGEMASK, + PINKVISOR, REDMASK, VRHEADSET, } diff --git a/src/base/token_uris/profile_token_uri.cairo b/src/base/token_uris/profile_token_uri.cairo index 41e47b8..53d583c 100644 --- a/src/base/token_uris/profile_token_uri.cairo +++ b/src/base/token_uris/profile_token_uri.cairo @@ -5,7 +5,9 @@ pub mod ProfileTokenUri { use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray; use coloniz::base::utils::base64_extended::{get_base64_encode, convert_into_byteArray}; - fn get_attributes(token_id: u256, mint_timestamp: u64) -> Array { // TODO: review necessary attributes + fn get_attributes( + token_id: u256, mint_timestamp: u64 + ) -> Array { // TODO: review necessary attributes let token_id_felt: felt252 = token_id.try_into().unwrap(); let timestamp_felt: felt252 = mint_timestamp.try_into().unwrap(); let token_id_byte: ByteArray = token_id_felt.try_into().unwrap(); @@ -41,7 +43,9 @@ pub mod ProfileTokenUri { json } - pub fn get_token_uri(token_id: u256, mint_timestamp: u64, profile_variant: ProfileVariants) -> ByteArray { + pub fn get_token_uri( + token_id: u256, mint_timestamp: u64, profile_variant: ProfileVariants + ) -> ByteArray { let baseuri = 'data:image/svg+xml;base64,'; let mut svg = gen_profile_svg(profile_variant); let svg_encoded: ByteArray = get_base64_encode(svg); diff --git a/src/base/token_uris/traits/profile.cairo b/src/base/token_uris/traits/profile.cairo index f0f297d..5379163 100644 --- a/src/base/token_uris/traits/profile.cairo +++ b/src/base/token_uris/traits/profile.cairo @@ -17,7 +17,7 @@ pub mod profile { pub fn gen_profile_svg(profile_variant: ProfileVariants) -> ByteArray { let mut profilesvg: ByteArray = ""; - + profilesvg.append(@backgroundVariant(profile_variant.background)); profilesvg.append(@bodyVariant(profile_variant.body)); profilesvg.append(@clothVariant(profile_variant.cloth)); diff --git a/src/base/token_uris/traits/profile/body.cairo b/src/base/token_uris/traits/profile/body.cairo index 162c0a8..d9f51ae 100644 --- a/src/base/token_uris/traits/profile/body.cairo +++ b/src/base/token_uris/traits/profile/body.cairo @@ -1,7 +1,7 @@ pub mod body { use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray; use coloniz::base::constants::types::BodyVariants; - + pub fn bodyVariant(variant: BodyVariants) -> ByteArray { getBodyvariant(variant) } diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo index 3717ec6..2676d54 100644 --- a/src/channel/channel.cairo +++ b/src/channel/channel.cairo @@ -15,9 +15,7 @@ pub mod ChannelComponent { use coloniz::jolt::jolt::JoltComponent; use coloniz::community::community::CommunityComponent; - use coloniz::interfaces::{ - IChannel::IChannel, ICommunity::ICommunity, - }; + use coloniz::interfaces::{IChannel::IChannel, ICommunity::ICommunity,}; use coloniz::base::{ constants::errors::Errors::{ NOT_CHANNEL_OWNER, ALREADY_MEMBER, NOT_CHANNEL_MEMBER, NOT_COMMUNITY_MEMBER, diff --git a/src/coloniznft/coloniznft.cairo b/src/coloniznft/coloniznft.cairo index a37ec75..5b67671 100644 --- a/src/coloniznft/coloniznft.cairo +++ b/src/coloniznft/coloniznft.cairo @@ -13,8 +13,7 @@ pub mod ColonizNFT { use core::num::traits::zero::Zero; use coloniz::interfaces::IColonizNFT; use coloniz::base::{ - constants::errors::Errors::ALREADY_MINTED, - constants::types::ProfileVariants, + constants::errors::Errors::ALREADY_MINTED, constants::types::ProfileVariants, token_uris::profile_token_uri::ProfileTokenUri::get_token_uri, }; use openzeppelin::{ @@ -91,7 +90,9 @@ pub mod ColonizNFT { // ************************************************************************* /// @notice mints the coloniz NFT /// @param address address of user trying to mint the coloniz NFT - fn mint_coloniznft(ref self: ContractState, address: ContractAddress, profile_variant: ProfileVariants) { + fn mint_coloniznft( + ref self: ContractState, address: ContractAddress, profile_variant: ProfileVariants + ) { let balance = self.erc721.balance_of(address); assert(balance.is_zero(), ALREADY_MINTED); diff --git a/src/interfaces/IColonizNFT.cairo b/src/interfaces/IColonizNFT.cairo index 67ad468..b6fb183 100644 --- a/src/interfaces/IColonizNFT.cairo +++ b/src/interfaces/IColonizNFT.cairo @@ -8,7 +8,9 @@ pub trait IColonizNFT { // ************************************************************************* // EXTERNALS // ************************************************************************* - fn mint_coloniznft(ref self: TState, address: ContractAddress, profile_variant: ProfileVariants); + fn mint_coloniznft( + ref self: TState, address: ContractAddress, profile_variant: ProfileVariants + ); // ************************************************************************* // GETTERS // ************************************************************************* diff --git a/src/lib.cairo b/src/lib.cairo index 5dfa69e..5f1b7b6 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -10,4 +10,4 @@ pub mod presets; pub mod hub; pub mod jolt; pub mod community; -pub mod channel; \ No newline at end of file +pub mod channel; diff --git a/src/profile/profile.cairo b/src/profile/profile.cairo index fa2ef61..d51b8cf 100644 --- a/src/profile/profile.cairo +++ b/src/profile/profile.cairo @@ -17,8 +17,7 @@ pub mod ProfileComponent { use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use coloniz::interfaces::IProfile::IProfile; use coloniz::base::{ - constants::types::Profile, - constants::types::ProfileVariants, + constants::types::Profile, constants::types::ProfileVariants, constants::errors::Errors::NOT_PROFILE_OWNER }; diff --git a/tests/test_coloniznft.cairo b/tests/test_coloniznft.cairo index 8973f82..487fc73 100644 --- a/tests/test_coloniznft.cairo +++ b/tests/test_coloniznft.cairo @@ -8,10 +8,13 @@ use snforge_std::{ DeclareResultTrait }; -use openzeppelin::{ token::erc721::interface::{ERC721ABIDispatcher, ERC721ABIDispatcherTrait} }; +use openzeppelin::{token::erc721::interface::{ERC721ABIDispatcher, ERC721ABIDispatcherTrait}}; -use coloniz::interfaces::IColonizNFT::{ IColonizNFTDispatcher, IColonizNFTDispatcherTrait }; -use coloniz::base::constants::types::{ ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, BodyVariants, BackVariants }; +use coloniz::interfaces::IColonizNFT::{IColonizNFTDispatcher, IColonizNFTDispatcherTrait}; +use coloniz::base::constants::types::{ + ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, + BodyVariants, BackVariants +}; const ADMIN: felt252 = 'ADMIN'; const USER_ONE: felt252 = 'BOB'; diff --git a/tests/test_hub.cairo b/tests/test_hub.cairo index f8081df..027d968 100644 --- a/tests/test_hub.cairo +++ b/tests/test_hub.cairo @@ -15,7 +15,10 @@ use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait}; use coloniz::interfaces::IHandleRegistry::{ IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait }; -use coloniz::base::constants::types::{ ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, BodyVariants, BackVariants }; +use coloniz::base::constants::types::{ + ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, + BodyVariants, BackVariants +}; const ADMIN: felt252 = 13245; const ADDRESS1: felt252 = 1234; diff --git a/tests/test_profile.cairo b/tests/test_profile.cairo index a493ca8..19f5369 100644 --- a/tests/test_profile.cairo +++ b/tests/test_profile.cairo @@ -13,7 +13,10 @@ use snforge_std::{ use coloniz::interfaces::IColonizNFT::{IColonizNFTDispatcher, IColonizNFTDispatcherTrait}; use coloniz::profile::profile::ProfileComponent::{Event as ProfileEvent, CreatedProfile}; use coloniz::interfaces::IProfile::{IProfileDispatcher, IProfileDispatcherTrait}; -use coloniz::base::constants::types::{ ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, BodyVariants, BackVariants }; +use coloniz::base::constants::types::{ + ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, + BodyVariants, BackVariants +}; const HUB_ADDRESS: felt252 = 'HUB'; const USER: felt252 = 'USER1'; @@ -80,7 +83,9 @@ fn test_profile_creation() { start_cheat_caller_address(profile_contract_address, USER.try_into().unwrap()); start_cheat_caller_address(nft_contract_address, USER.try_into().unwrap()); let profile_address = profileDispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant + ); // test a new coloniz nft is minted let last_minted_id = colonizNFTDispatcher.get_last_minted_id(); @@ -120,7 +125,9 @@ fn test_profile_metadata() { start_cheat_caller_address(profile_contract_address, USER.try_into().unwrap()); start_cheat_caller_address(nft_contract_address, USER.try_into().unwrap()); let profile_address = profileDispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant + ); profileDispatcher .set_profile_metadata_uri( @@ -148,7 +155,7 @@ fn test_profile_creation_event() { let colonizNFTDispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address }; let profileDispatcher = IProfileDispatcher { contract_address: profile_contract_address }; let mut spy = spy_events(); - + let profile_variant = ProfileVariants { body: BodyVariants::Body1, back: BackVariants::BLUEFLAG, @@ -163,7 +170,9 @@ fn test_profile_creation_event() { start_cheat_caller_address(nft_contract_address, USER.try_into().unwrap()); let profile_address = profileDispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2456, profile_variant + ); let token_id = colonizNFTDispatcher.get_user_token_id(USER.try_into().unwrap()); diff --git a/tests/test_publication.cairo b/tests/test_publication.cairo index 4a9901c..5601a53 100644 --- a/tests/test_publication.cairo +++ b/tests/test_publication.cairo @@ -19,7 +19,10 @@ use coloniz::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatc use coloniz::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait}; use coloniz::interfaces::IChannel::{IChannelDispatcher, IChannelDispatcherTrait}; use coloniz::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait}; -use coloniz::base::constants::types::{ ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, BodyVariants, BackVariants }; +use coloniz::base::constants::types::{ + ProfileVariants, AccessoryVariants, FaceVariants, ClothVariants, BackgroundVariants, + BodyVariants, BackVariants +}; const HUB_ADDRESS: felt252 = 'HUB'; @@ -36,7 +39,14 @@ const ADMIN: felt252 = 'ADMIN'; // SETUP // ************************************************************************* fn __setup__() -> ( - ContractAddress, ContractAddress, ContractAddress, felt252, felt252, felt252, ContractAddress, ProfileVariants + ContractAddress, + ContractAddress, + ContractAddress, + felt252, + felt252, + felt252, + ContractAddress, + ProfileVariants ) { // deploy NFT let nft_contract = declare("ColonizNFT").unwrap().contract_class(); @@ -127,7 +137,9 @@ fn test_post_community_post() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -171,7 +183,9 @@ fn test_if_is_community_post() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -223,7 +237,9 @@ fn test_community_censorship_post_status_tobe_true() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -271,7 +287,9 @@ fn test_community_censorship_post_status_tobe_false() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); community_dispatcher.set_community_censorship_status(community_id, true); @@ -320,7 +338,9 @@ fn test_channel_censorship_post_status_tobe_true() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -367,7 +387,9 @@ fn test_channel_censorship_post_status_tobe_false() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); @@ -418,7 +440,9 @@ fn test_if_is_channel_post() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -472,7 +496,9 @@ fn test_should_fail_if_user_is_not_a_community_member() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if channel is created @@ -493,7 +519,9 @@ fn test_should_fail_if_user_is_not_a_community_member() { let content_URI: ByteArray = "ipfs://helloworld"; // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Attempt to post let _pub_assigned_id = publication_dispatcher .post( @@ -533,7 +561,9 @@ fn test_should_fail_if_user_is_not_a_channel_member() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if channel is created @@ -554,7 +584,9 @@ fn test_should_fail_if_user_is_not_a_channel_member() { let content_URI: ByteArray = "ipfs://helloworld"; // Create profile let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Attempt to post community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); @@ -574,7 +606,9 @@ fn test_should_fail_if_user_is_not_a_channel_member() { let content_URI: ByteArray = "ipfs://helloworld"; // Create profile let user_three_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Attempt to post community_dispatcher.join_community(community_id); let _pub_assigned_id = publication_dispatcher @@ -614,7 +648,9 @@ fn test_post_channel_post() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -657,7 +693,9 @@ fn test_upvote() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); let pub_assigned_id = publication_dispatcher @@ -701,7 +739,9 @@ fn test_downvote() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); let pub_assigned_id = publication_dispatcher @@ -747,7 +787,9 @@ fn test_upvote_event_emission() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -804,7 +846,9 @@ fn test_downvote_event_emission() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -860,7 +904,9 @@ fn test_upvote_should_fail_if_user_already_upvoted() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); let pub_assigned_id = publication_dispatcher @@ -904,7 +950,9 @@ fn test_downvote_should_fail_if_user_already_downvoted() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); let pub_assigned_id = publication_dispatcher @@ -949,7 +997,9 @@ fn test_post_event_emission() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1005,7 +1055,9 @@ fn test_comment() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1022,7 +1074,9 @@ fn test_comment() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/"; @@ -1088,7 +1142,9 @@ fn test_comment_event_emission() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1105,7 +1161,9 @@ fn test_comment_event_emission() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); let user_two_comment_on_user_one_assigned_pub_id = publication_dispatcher @@ -1167,7 +1225,9 @@ fn test_repost() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1184,7 +1244,9 @@ fn test_repost() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); let repost_params = RepostParams { @@ -1239,7 +1301,9 @@ fn test_repost_event_emission() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1257,7 +1321,9 @@ fn test_repost_event_emission() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); let repost_params = RepostParams { @@ -1316,7 +1382,9 @@ fn test_get_publication_content_uri() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1358,7 +1426,9 @@ fn test_get_publication_type() { let content_URI: ByteArray = "ipfs://helloworld"; start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); @@ -1405,7 +1475,9 @@ fn test_should_fail_if_banned_profile_from_posting() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -1422,7 +1494,9 @@ fn test_should_fail_if_banned_profile_from_posting() { ); start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); stop_cheat_caller_address(publication_contract_address); @@ -1474,7 +1548,9 @@ fn test_should_fail_if_not_community_member_while_posting() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); let community_id = community_dispatcher.create_community(); let channel_id = channel_dispatcher.create_channel(community_id); let _pub_assigned_id = publication_dispatcher @@ -1489,7 +1565,9 @@ fn test_should_fail_if_not_community_member_while_posting() { stop_cheat_caller_address(publication_contract_address); start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 24998, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 24998, profile_variant + ); let _pub_assigned_id = publication_dispatcher .post( PostParams { @@ -1528,7 +1606,9 @@ fn test_tip() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -1547,7 +1627,9 @@ fn test_tip() { // USER_TWO joins community start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let _user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); stop_cheat_caller_address(publication_contract_address); @@ -1603,7 +1685,9 @@ fn test_collect() { start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap()); // Create profile let user_one_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); // Check if community is created let community_id = community_dispatcher.create_community(); // Check if community is created @@ -1622,14 +1706,18 @@ fn test_collect() { start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap()); let _user_two_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); stop_cheat_caller_address(publication_contract_address); start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap()); let _user_three_profile_address = publication_dispatcher - .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant); + .create_profile( + nft_contract_address, registry_class_hash, account_class_hash, 2478, profile_variant + ); community_dispatcher.join_community(community_id); channel_dispatcher.join_channel(channel_id); stop_cheat_caller_address(publication_contract_address);