Skip to content

Commit

Permalink
💄 Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Nov 8, 2023
1 parent fcf3426 commit e8355d7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ mod random {

mod security {
mod commitment;
}
}
2 changes: 1 addition & 1 deletion src/tokens/src/erc1155/erc1155.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mod erc1155;
mod models;
mod interface;

use erc1155::ERC1155;
use erc1155::ERC1155;
4 changes: 1 addition & 3 deletions src/tokens/src/erc1155/erc1155/erc1155.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#[starknet::contract]
mod ERC1155 {
use dojo_erc::token::erc1155::models::{
ERC1155Meta, ERC1155OperatorApproval, ERC1155Balance
};
use dojo_erc::token::erc1155::models::{ERC1155Meta, ERC1155OperatorApproval, ERC1155Balance};
use dojo_erc::token::erc1155::interface;
use dojo_erc::token::erc1155::interface::{IERC1155, IERC1155CamelOnly};
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/src/erc1155/erc1155/models.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ struct ERC1155Balance {
#[key]
id: u256,
amount: u256
}
}
6 changes: 1 addition & 5 deletions src/tokens/src/erc721/erc721.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ mod ERC721 {
// Internal imports

use presets::erc721::models::{
ERC721Meta,
ERC721OperatorApproval,
ERC721Owner,
ERC721Balance,
ERC721TokenApproval,
ERC721Meta, ERC721OperatorApproval, ERC721Owner, ERC721Balance, ERC721TokenApproval,
};

// Local imports
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/src/erc721/models.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ struct ERC721TokenApproval {
#[key]
token_id: u256,
address: ContractAddress,
}
}
16 changes: 8 additions & 8 deletions src/tokens/src/erc721/tests.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ fn test_transfer_from_nonexistent() {
#[should_panic(expected: ('ERC721: invalid token ID',))]
fn test_transferFrom_nonexistent() {
//let mut state = STATE();
let (world, mut state) = STATE();
ERC721CamelOnlyImpl::transferFrom(ref state, ZERO(), RECIPIENT(), TOKEN_ID);
let (world, mut state) = STATE();
ERC721CamelOnlyImpl::transferFrom(ref state, ZERO(), RECIPIENT(), TOKEN_ID);
}

#[test]
Expand All @@ -489,7 +489,7 @@ fn test_transferFrom_to_zero() {
let mut state = setup();

testing::set_caller_address(OWNER());
ERC721CamelOnlyImpl::transferFrom(ref state, OWNER(), ZERO(), TOKEN_ID);
ERC721CamelOnlyImpl::transferFrom(ref state, OWNER(), ZERO(), TOKEN_ID);
}

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

testing::set_caller_address(OWNER());
ERC721CamelOnlyImpl::transferFrom(ref state, OWNER(), OWNER(), TOKEN_ID);
assert_event_transfer( OWNER(), OWNER(), TOKEN_ID);
assert_event_transfer(OWNER(), OWNER(), TOKEN_ID);

assert(ERC721Impl::owner_of(@state, TOKEN_ID) == OWNER(), 'Ownership after');
assert(ERC721Impl::balance_of(@state, OWNER()) == 1, 'Balance of owner after');
Expand Down Expand Up @@ -551,7 +551,7 @@ fn test_transferFrom_approved() {
let token_id = TOKEN_ID;
let owner = OWNER();
let recipient = RECIPIENT();
assert_state_before_transfer(@state,owner, recipient, token_id);
assert_state_before_transfer(@state, owner, recipient, token_id);

testing::set_caller_address(owner);
ERC721Impl::approve(ref state, OPERATOR(), token_id);
Expand All @@ -561,7 +561,7 @@ fn test_transferFrom_approved() {
ERC721CamelOnlyImpl::transferFrom(ref state, owner, recipient, token_id);
assert_event_transfer(owner, recipient, token_id);

assert_state_after_transfer(@state,owner, recipient, token_id);
assert_state_after_transfer(@state, owner, recipient, token_id);
}

#[test]
Expand Down Expand Up @@ -593,7 +593,7 @@ fn test_transferFrom_approved_for_all() {
let owner = OWNER();
let recipient = RECIPIENT();

assert_state_before_transfer(@state,owner, recipient, token_id);
assert_state_before_transfer(@state, owner, recipient, token_id);

testing::set_caller_address(owner);
ERC721Impl::set_approval_for_all(ref state, OPERATOR(), true);
Expand All @@ -603,7 +603,7 @@ fn test_transferFrom_approved_for_all() {
ERC721CamelOnlyImpl::transferFrom(ref state, owner, recipient, token_id);
assert_event_transfer(owner, recipient, token_id);

assert_state_after_transfer(@state,owner, recipient, token_id);
assert_state_after_transfer(@state, owner, recipient, token_id);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mod erc721 {
mod tests {
mod constants;
mod utils;
}
}

0 comments on commit e8355d7

Please sign in to comment.