Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbucur1 committed Aug 8, 2024
1 parent f29280c commit edbe34b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 5 additions & 2 deletions contracts/on-chain-claim/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub trait OnChainClaimContract:
address_info.last_epoch_claimed + 1 == current_epoch,
"missed epoch"
);

address_info.current_streak += 1;
address_info.total_epochs_claimed += 1;
address_info.last_epoch_claimed = current_epoch;
Expand All @@ -68,7 +68,10 @@ pub trait OnChainClaimContract:
let current_epoch = self.blockchain().get_block_epoch();

let address_info_mapper = self.address_info(&caller);
require!(!address_info_mapper.is_empty(), "can't reset streak for new address");
require!(
!address_info_mapper.is_empty(),
"can't reset streak for new address"
);

address_info_mapper.update(|address_info| {
address_info.current_streak = 1;
Expand Down
5 changes: 1 addition & 4 deletions contracts/on-chain-claim/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,7 @@ fn check_after_claim() {
.set_state_step(SetStateStep::new().block_epoch(25))
.whitebox_call_check(
&on_chain_claim_whitebox,
ScCallStep::new()
.from(USER1_ADDR)
.to(SC_ADDR)
.no_expect(),
ScCallStep::new().from(USER1_ADDR).to(SC_ADDR).no_expect(),
|sc| {
sc.claim();
},
Expand Down

0 comments on commit edbe34b

Please sign in to comment.