Skip to content

Commit

Permalink
💄 Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Jun 20, 2024
1 parent 3e02012 commit ca6cdd2
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 27 deletions.
8 changes: 0 additions & 8 deletions examples/matchmaker/src/helpers/bitmap.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ impl Bitmap of BitmapTrait {

/// The index of the most significant bit of the number,
/// where the least significant bit is at index 0 and the most significant bit is at index 255
/// Source:
///
///
/// https://github.com/lambdaclass/yet-another-swap/blob/main/crates/yas_core/src/libraries/bit_math.cairo
/// # Arguments * `x` - The value for which to compute the most significant bit, must be greater
/// than 0.
/// # Returns
Expand Down Expand Up @@ -111,10 +107,6 @@ impl Bitmap of BitmapTrait {

/// The index of the least significant bit of the number,
/// where the least significant bit is at index 0 and the most significant bit is at index 255
/// Source:
///
///
/// https://github.com/lambdaclass/yet-another-swap/blob/main/crates/yas_core/src/libraries/bit_math.cairo
/// # Arguments * `x` - The value for which to compute the least significant bit, must be
/// greater than 0.
/// # Returns
Expand Down
3 changes: 2 additions & 1 deletion token/src/components/introspection/src5.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// adaptation of https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/introspection/src5.cairo for dojo
/// adaptation of
/// https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/introspection/src5.cairo for dojo

use starknet::ContractAddress;

Expand Down
4 changes: 3 additions & 1 deletion token/src/components/security/initializable.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// adaptation of https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/security/initializable.cairo for dojo
/// adaptation of
/// https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/security/initializable.cairo for
/// dojo

use starknet::ContractAddress;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn test_erc20_allowance_approve_to_zero() {
}

//
// spend_allowance
// spend_allowance
//

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ fn test_transfer_from() {
assert_event_approval(erc20_balance_mock.contract_address, OWNER(), SPENDER(), 0);
assert_only_event_transfer(erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE);

// drop StoreSetRecord ERC20AllowanceModel
// drop StoreSetRecord ERC20AllowanceModel
utils::drop_event(world.contract_address);
assert_event_approval(world.contract_address, OWNER(), SPENDER(), 0);
// drop StoreSetRecord ERC20BalanceModel x2
Expand Down Expand Up @@ -258,7 +258,7 @@ fn test_transfer_from_from_zero_address() {


//
// transferFrom
// transferFrom
//

#[test]
Expand All @@ -277,7 +277,7 @@ fn test_transferFrom() {
assert_event_approval(erc20_balance_mock.contract_address, OWNER(), SPENDER(), 0);
assert_only_event_transfer(erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE);

// drop StoreSetRecord ERC20AllowanceModel
// drop StoreSetRecord ERC20AllowanceModel
utils::drop_event(world.contract_address);
assert_event_approval(world.contract_address, OWNER(), SPENDER(), 0);
// drop StoreSetRecord ERC20BalanceModel x2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn setup() -> erc20_bridgeable_mock::ContractState {
}

//
// initializer
// initializer
//

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fn test_transfer_from() {
erc721_balance_mock.contract_address, OWNER(), RECIPIENT(), TOKEN_ID
);

// // drop StoreSetRecord ERC721TokenApprovalModel
// // drop StoreSetRecord ERC721TokenApprovalModel
utils::drop_event(world.contract_address);
// // drop StoreSetRecord ERC721BalanceModel x3 - incl mint
utils::drop_event(world.contract_address);
Expand Down Expand Up @@ -289,7 +289,7 @@ fn test_safe_transfer_from() {
TOKEN_ID
);

// // drop StoreSetRecord ERC721TokenApprovalModel
// // drop StoreSetRecord ERC721TokenApprovalModel
utils::drop_event(world.contract_address);
// // drop StoreSetRecord ERC721BalanceModel x3 - incl mint
utils::drop_event(world.contract_address);
Expand All @@ -307,7 +307,7 @@ fn test_safe_transfer_from() {
}

//
// transferFrom
// transferFrom
//

#[test]
Expand All @@ -328,7 +328,7 @@ fn test_transferFrom() {
erc721_balance_mock.contract_address, OWNER(), RECIPIENT(), TOKEN_ID
);

// // drop StoreSetRecord ERC721TokenApprovalModel
// // drop StoreSetRecord ERC721TokenApprovalModel
utils::drop_event(world.contract_address);
// // drop StoreSetRecord ERC721BalanceModel x3 - incl mint
utils::drop_event(world.contract_address);
Expand Down Expand Up @@ -364,7 +364,7 @@ fn test_safeTransferFrom() {
TOKEN_ID
);

// // drop StoreSetRecord ERC721TokenApprovalModel
// // drop StoreSetRecord ERC721TokenApprovalModel
utils::drop_event(world.contract_address);
// // drop StoreSetRecord ERC721BalanceModel x3 - incl mint
utils::drop_event(world.contract_address);
Expand Down
2 changes: 1 addition & 1 deletion token/src/components/token/erc721/erc721_enumerable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use starknet::ContractAddress;
///
/// Model
///
///
///

#[dojo::model]
#[derive(Copy, Drop, Serde)]
Expand Down
2 changes: 1 addition & 1 deletion token/src/erc1155/tests.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ fn test__burn_more_than_balance() {


//
// Helpers
// Helpers
//

fn assert_state_before_transfer(
Expand Down
6 changes: 3 additions & 3 deletions token/src/presets/erc20/tests_bridgeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn setup() -> (IWorldDispatcher, IERC20BridgeablePresetDispatcher) {


//
// initializer
// initializer
//

#[test]
Expand Down Expand Up @@ -141,7 +141,7 @@ fn test_approve() {


//
// transfer
// transfer
//

#[test]
Expand Down Expand Up @@ -186,7 +186,7 @@ fn test_transfer_from() {
assert_event_approval(erc20_bridgeable.contract_address, OWNER(), SPENDER(), 0);
assert_only_event_transfer(erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE);

// drop StoreSetRecord ERC20AllowanceModel
// drop StoreSetRecord ERC20AllowanceModel
utils::drop_event(world.contract_address);
assert_event_approval(world.contract_address, OWNER(), SPENDER(), 0);
// drop StoreSetRecord ERC20BalanceModel x2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn setup() -> (IWorldDispatcher, IERC721EnumMintBurnPresetDispatcher) {
}

//
// initializer
// initializer
//

#[test]
Expand Down
2 changes: 1 addition & 1 deletion token/src/presets/erc721/tests_mintable_burnable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn setup() -> (IWorldDispatcher, IERC721MintableBurnablePresetDispatcher) {
}

//
// initializer
// initializer
//

#[test]
Expand Down

0 comments on commit ca6cdd2

Please sign in to comment.