Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Dec 20, 2024
1 parent a8206d4 commit 56e622d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions pop-api/examples/dao/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,10 @@ mod dao {
// Execute the proposal
let treasury_balance = api::balance_of(self.token_id, contract).unwrap_or_default();
if treasury_balance < proposal.amount {
// Not enough tokens in treasury to distribute
return Err(Error::TryAgainLater);
}
// Not enough tokens in treasury to distribute
return Err(Error::TryAgainLater);
}


api::transfer(self.token_id, proposal.beneficiary, proposal.amount)
.map_err(Psp22Error::from)?;
self.env().emit_event(Transfer {
Expand Down
8 changes: 2 additions & 6 deletions pop-api/examples/dao/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use drink::{
assert_last_contract_event, assert_ok, call,
devnet::{
account_id_from_slice,
AccountId, Balance, Runtime,
},
devnet::{account_id_from_slice, AccountId, Balance, Runtime},
sandbox_api::system_api::SystemAPI,
session::Session,
AssetsAPI, TestExternalities, NO_SALT,
Expand Down Expand Up @@ -195,7 +192,7 @@ fn vote_fails_if_voting_period_ended(mut session: Session) {
assert_ok!(create_proposal(&mut session, BOB, amount, description));

// Moving to blocks beyond voting period
session.sandbox().build_blocks(VOTING_PERIOD + 1);
session.sandbox().build_blocks(VOTING_PERIOD + 1);

session.set_actor(CHARLIE);
// Charlie tries to vote
Expand Down Expand Up @@ -311,7 +308,6 @@ fn proposal_enactment_fails_if_proposal_is_rejected(mut session: Session) {
session.sandbox().build_blocks(VOTING_PERIOD + 1);

assert_eq!(execute_proposal(&mut session, 1), Err(Error::ProposalRejected));

}

// Deploy the contract with `NO_SALT and `INIT_VALUE`.
Expand Down

0 comments on commit 56e622d

Please sign in to comment.