Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemiiah committed Nov 22, 2024
1 parent e3f2cfa commit ae7e80b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
36 changes: 16 additions & 20 deletions src/campaign.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
7 changes: 3 additions & 4 deletions src/token_giver_nft.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae7e80b

Please sign in to comment.