From ae7e80bd20a6ce2a1822373f707b3ecafd8f9abf Mon Sep 17 00:00:00 2001 From: Jemiiah Date: Fri, 22 Nov 2024 08:59:29 +0100 Subject: [PATCH] format --- src/campaign.cairo | 36 ++++++++++++++++-------------------- src/token_giver_nft.cairo | 7 +++---- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/campaign.cairo b/src/campaign.cairo index fe76ac3..0d1e58f 100644 --- a/src/campaign.cairo +++ b/src/campaign.cairo @@ -5,10 +5,8 @@ pub mod CampaignComponent { // ************************************************************************* use core::traits::TryInto; use starknet::{ - ContractAddress, get_caller_address, - storage::{ - Map, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess - } + ContractAddress, get_caller_address, + storage::{Map, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess} }; use tokengiver::interfaces::ITokenGiverNft::{ ITokenGiverNftDispatcher, ITokenGiverNftDispatcherTrait @@ -168,13 +166,12 @@ pub mod CampaignComponent { let count = self.count.read(); let mut i: u16 = 1; - while i < count - + 1 { - let campaignAddress: ContractAddress = self.campaigns.entry(i).read(); - let campaign: Campaign = self.campaign.entry(campaignAddress).read(); - campaigns.append(campaign.metadata_URI); - i += 1; - }; + while i < count + 1 { + let campaignAddress: ContractAddress = self.campaigns.entry(i).read(); + let campaign: Campaign = self.campaign.entry(campaignAddress).read(); + campaigns.append(campaign.metadata_URI); + i += 1; + }; campaigns } @@ -185,15 +182,14 @@ pub mod CampaignComponent { let count = self.count.read(); let mut i: u16 = 1; - while i < count - + 1 { - let campaignAddress: ContractAddress = self.campaigns.entry(i).read(); - let campaign: Campaign = self.campaign.entry(campaignAddress).read(); - if campaign.campaign_owner == user { - campaigns.append(campaign.metadata_URI); - } - i += 1; - }; + while i < count + 1 { + let campaignAddress: ContractAddress = self.campaigns.entry(i).read(); + let campaign: Campaign = self.campaign.entry(campaignAddress).read(); + if campaign.campaign_owner == user { + campaigns.append(campaign.metadata_URI); + } + i += 1; + }; campaigns } diff --git a/src/token_giver_nft.cairo b/src/token_giver_nft.cairo index a2d3faf..f6fb2c1 100644 --- a/src/token_giver_nft.cairo +++ b/src/token_giver_nft.cairo @@ -36,10 +36,9 @@ pub mod TokenGiverNFT { // IMPORTS // ************************************************************************* use openzeppelin::token::erc721::interface::IERC721Metadata; - use starknet::{ContractAddress, get_caller_address, get_block_timestamp, - storage::{ - Map, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess - } + use starknet::{ + ContractAddress, get_caller_address, get_block_timestamp, + storage::{Map, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess} }; use core::num::traits::zero::Zero; use tokengiver::interfaces::ITokenGiverNft;