Skip to content

Commit

Permalink
Scarb fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts committed Apr 11, 2024
1 parent 5c22c6c commit ddfe56a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion onchain/src/art_peace.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ pub mod ArtPeace {
quests.span()
}

fn claim_daily_quest(ref self: ContractState, day_index: u32, quest_id: u32, calldata: Span<felt252>) {
fn claim_daily_quest(
ref self: ContractState, day_index: u32, quest_id: u32, calldata: Span<felt252>
) {
let now = starknet::get_block_timestamp();
assert!(now <= self.end_time.read());
// TODO: Only allow to claim the quest of the current day
Expand Down
4 changes: 3 additions & 1 deletion onchain/src/interface.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ pub trait IArtPeace<TContractState> {
fn get_main_quests(self: @TContractState) -> Span<starknet::ContractAddress>;

// Claim quests
fn claim_daily_quest(ref self: TContractState, day_index: u32, quest_id: u32, calldata: Span<felt252>);
fn claim_daily_quest(
ref self: TContractState, day_index: u32, quest_id: u32, calldata: Span<felt252>
);
fn claim_today_quest(ref self: TContractState, quest_id: u32, calldata: Span<felt252>);
fn claim_main_quest(ref self: TContractState, quest_id: u32, calldata: Span<felt252>);

Expand Down
4 changes: 3 additions & 1 deletion onchain/src/quests/pixel_quest.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ mod PixelQuest {
return self.reward.read();
}

fn is_claimable(self: @ContractState, user: ContractAddress, calldata: Span<felt252>) -> bool {
fn is_claimable(
self: @ContractState, user: ContractAddress, calldata: Span<felt252>
) -> bool {
let art_peace = self.art_peace.read();
if self.claimed.read(user) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions onchain/src/tests/art_peace.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,5 @@ fn increase_day_panic_test() {
art_peace.increase_day_index();
}
// TODO: test invalid template inputs


0 comments on commit ddfe56a

Please sign in to comment.