Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort imports alphabetically #679

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/access/accesscontrol.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod accesscontrol;
use accesscontrol::AccessControl;

mod dual_accesscontrol;
mod interface;

use accesscontrol::AccessControl;

const DEFAULT_ADMIN_ROLE: felt252 = 0;
4 changes: 2 additions & 2 deletions src/access/accesscontrol/accesscontrol.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#[starknet::contract]
mod AccessControl {
use starknet::ContractAddress;
use starknet::get_caller_address;
use openzeppelin::access::accesscontrol::interface;
use openzeppelin::introspection::interface::ISRC5;
use openzeppelin::introspection::interface::ISRC5Camel;
use openzeppelin::introspection::src5::SRC5;
use starknet::ContractAddress;
use starknet::get_caller_address;

#[storage]
struct Storage {
Expand Down
6 changes: 3 additions & 3 deletions src/access/accesscontrol/dual_accesscontrol.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// OpenZeppelin Contracts for Cairo v0.7.0 (access/accesscontrol/dual_accesscontrol.cairo)

use array::ArrayTrait;
use starknet::ContractAddress;
use starknet::SyscallResultTrait;

use openzeppelin::utils::Felt252TryIntoBool;
use openzeppelin::utils::UnwrapAndCast;
use openzeppelin::utils::selectors;
use openzeppelin::utils::serde::SerializedAppend;
use openzeppelin::utils::try_selector_with_fallback;
use openzeppelin::utils::UnwrapAndCast;
use starknet::ContractAddress;
use starknet::SyscallResultTrait;

#[derive(Copy, Drop)]
struct DualCaseAccessControl {
Expand Down
6 changes: 3 additions & 3 deletions src/access/ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod dual_ownable;
mod interface;
mod ownable;
use ownable::Ownable;

mod interface;
mod dual_ownable;
use ownable::Ownable;
14 changes: 7 additions & 7 deletions src/access/ownable/dual_ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts for Cairo v0.7.0 (access/ownable/dual_ownable.cairo)

use array::SpanTrait;
use array::ArrayTrait;
use array::SpanTrait;
use core::result::ResultTrait;

use openzeppelin::utils::Felt252TryIntoBool;
use openzeppelin::utils::UnwrapAndCast;
use openzeppelin::utils::selectors;
use openzeppelin::utils::serde::SerializedAppend;
use openzeppelin::utils::try_selector_with_fallback;
use option::OptionTrait;
use starknet::ContractAddress;
use starknet::Felt252TryIntoContractAddress;
use starknet::SyscallResultTrait;
use starknet::call_contract_syscall;
use traits::TryInto;

use openzeppelin::utils::Felt252TryIntoBool;
use openzeppelin::utils::selectors;
use openzeppelin::utils::serde::SerializedAppend;
use openzeppelin::utils::try_selector_with_fallback;
use openzeppelin::utils::UnwrapAndCast;

#[derive(Copy, Drop)]
struct DualCaseOwnable {
contract_address: ContractAddress
Expand Down
6 changes: 3 additions & 3 deletions src/account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ mod dual_account;
mod interface;

use account::Account;
use account::TRANSACTION_VERSION;
use account::QUERY_VERSION;
use interface::AccountCamelABIDispatcher;
use interface::AccountCamelABIDispatcherTrait;
use account::TRANSACTION_VERSION;
use interface::AccountABIDispatcher;
use interface::AccountABIDispatcherTrait;
use interface::AccountCamelABIDispatcher;
use interface::AccountCamelABIDispatcherTrait;
14 changes: 7 additions & 7 deletions src/account/account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use array::ArrayTrait;
use array::SpanTrait;
use option::OptionTrait;
use serde::Serde;
use starknet::account::Call;
use starknet::ContractAddress;
use starknet::account::Call;

const TRANSACTION_VERSION: felt252 = 1;

Expand All @@ -25,24 +25,24 @@ trait PublicKeyCamelTrait<TState> {

#[starknet::contract]
mod Account {
use array::SpanTrait;
use array::ArrayTrait;
use array::SpanTrait;
use box::BoxTrait;
use ecdsa::check_ecdsa_signature;
use option::OptionTrait;
use starknet::get_tx_info;
use starknet::get_caller_address;
use starknet::get_contract_address;
use zeroable::Zeroable;

use openzeppelin::account::interface;
use openzeppelin::introspection::interface::ISRC5;
use openzeppelin::introspection::interface::ISRC5Camel;
use openzeppelin::introspection::src5::SRC5;
use option::OptionTrait;
use starknet::get_caller_address;
use starknet::get_contract_address;
use starknet::get_tx_info;

use super::Call;
use super::QUERY_VERSION;
use super::TRANSACTION_VERSION;
use zeroable::Zeroable;

#[storage]
struct Storage {
Expand Down
7 changes: 3 additions & 4 deletions src/account/dual_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

use array::ArrayTrait;
use array::SpanTrait;
use starknet::ContractAddress;
use starknet::SyscallResultTrait;

use openzeppelin::utils::UnwrapAndCast;
use openzeppelin::utils::selectors;
use openzeppelin::utils::serde::SerializedAppend;
use openzeppelin::utils::try_selector_with_fallback;
use openzeppelin::utils::UnwrapAndCast;
use starknet::ContractAddress;
use starknet::SyscallResultTrait;

#[derive(Copy, Drop)]
struct DualCaseAccount {
Expand Down
2 changes: 1 addition & 1 deletion src/account/interface.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use array::ArrayTrait;
use array::SpanTrait;
use starknet::account::Call;
use starknet::ContractAddress;
use starknet::account::Call;

const ISRC6_ID: felt252 = 0x2ceccef7f994940b3962a6c67e0ba4fcd37df7d131417c604f91e03caecc1cd;

Expand Down
2 changes: 1 addition & 1 deletion src/introspection.cairo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mod src5;
mod dual_src5;
mod interface;
mod src5;
5 changes: 2 additions & 3 deletions src/introspection/dual_src5.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// OpenZeppelin Contracts for Cairo v0.7.0 (introspection/dual_src5.cairo)

use array::ArrayTrait;
use starknet::ContractAddress;

use openzeppelin::utils::UnwrapAndCast;
use openzeppelin::utils::selectors;
use openzeppelin::utils::try_selector_with_fallback;
use openzeppelin::utils::UnwrapAndCast;
use starknet::ContractAddress;

#[derive(Copy, Drop)]
struct DualCaseSRC5 {
Expand Down
4 changes: 2 additions & 2 deletions src/security.cairo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mod reentrancyguard;
mod pausable;
mod initializable;
mod pausable;
mod reentrancyguard;
2 changes: 1 addition & 1 deletion src/tests/access.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod test_accesscontrol;
mod test_dual_accesscontrol;
mod test_ownable;
mod test_dual_ownable;
mod test_ownable;
12 changes: 6 additions & 6 deletions src/tests/access/test_accesscontrol.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use starknet::contract_address_const;
use starknet::ContractAddress;
use starknet::testing;
use openzeppelin::access::accesscontrol::AccessControl;
use openzeppelin::access::accesscontrol::AccessControl::InternalImpl;
use openzeppelin::access::accesscontrol::AccessControl::AccessControlImpl;
use openzeppelin::access::accesscontrol::AccessControl::AccessControlCamelImpl;
use openzeppelin::access::accesscontrol::AccessControl::AccessControlImpl;
use openzeppelin::access::accesscontrol::AccessControl::InternalImpl;
use openzeppelin::access::accesscontrol::AccessControl;
use openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin::access::accesscontrol::interface::IACCESSCONTROL_ID;
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing;

const ROLE: felt252 = 41;
const OTHER_ROLE: felt252 = 42;
Expand Down
21 changes: 10 additions & 11 deletions src/tests/access/test_dual_accesscontrol.cairo
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
use array::ArrayTrait;
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing::set_contract_address;

use openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin::access::accesscontrol::dual_accesscontrol::DualCaseAccessControl;
use openzeppelin::access::accesscontrol::dual_accesscontrol::DualCaseAccessControlTrait;
use openzeppelin::access::accesscontrol::interface::IACCESSCONTROL_ID;
use openzeppelin::access::accesscontrol::interface::IAccessControlDispatcher;
use openzeppelin::access::accesscontrol::interface::IAccessControlCamelDispatcher;
use openzeppelin::access::accesscontrol::interface::IAccessControlDispatcherTrait;
use openzeppelin::access::accesscontrol::interface::IAccessControlCamelDispatcherTrait;
use openzeppelin::access::accesscontrol::dual_accesscontrol::DualCaseAccessControlTrait;
use openzeppelin::access::accesscontrol::dual_accesscontrol::DualCaseAccessControl;
use openzeppelin::tests::mocks::snake_accesscontrol_mock::SnakeAccessControlMock;
use openzeppelin::tests::mocks::camel_accesscontrol_mock::CamelAccessControlMock;
use openzeppelin::tests::mocks::accesscontrol_panic_mock::SnakeAccessControlPanicMock;
use openzeppelin::access::accesscontrol::interface::IAccessControlDispatcher;
use openzeppelin::access::accesscontrol::interface::IAccessControlDispatcherTrait;
use openzeppelin::tests::mocks::accesscontrol_panic_mock::CamelAccessControlPanicMock;
use openzeppelin::tests::mocks::accesscontrol_panic_mock::SnakeAccessControlPanicMock;
use openzeppelin::tests::mocks::camel_accesscontrol_mock::CamelAccessControlMock;
use openzeppelin::tests::mocks::non_implementing_mock::NonImplementingMock;
use openzeppelin::tests::mocks::snake_accesscontrol_mock::SnakeAccessControlMock;
use openzeppelin::tests::utils;
use openzeppelin::utils::serde::SerializedAppend;
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing::set_contract_address;

//
// Constants
Expand Down
23 changes: 11 additions & 12 deletions src/tests/access/test_dual_ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing::set_caller_address;
use starknet::testing::set_contract_address;
use zeroable::Zeroable;

use openzeppelin::access::ownable::interface::IOwnableDispatcher;
use openzeppelin::access::ownable::dual_ownable::DualCaseOwnable;
use openzeppelin::access::ownable::dual_ownable::DualCaseOwnableTrait;
use openzeppelin::access::ownable::interface::IOwnableCamelOnlyDispatcher;
use openzeppelin::access::ownable::interface::IOwnableDispatcherTrait;
use openzeppelin::access::ownable::interface::IOwnableCamelOnlyDispatcherTrait;
use openzeppelin::access::ownable::dual_ownable::DualCaseOwnableTrait;
use openzeppelin::access::ownable::dual_ownable::DualCaseOwnable;
use openzeppelin::tests::mocks::dual_ownable_mocks::SnakeOwnableMock;
use openzeppelin::access::ownable::interface::IOwnableDispatcher;
use openzeppelin::access::ownable::interface::IOwnableDispatcherTrait;
use openzeppelin::tests::mocks::dual_ownable_mocks::CamelOwnableMock;
use openzeppelin::tests::mocks::dual_ownable_mocks::SnakeOwnablePanicMock;
use openzeppelin::tests::mocks::dual_ownable_mocks::CamelOwnablePanicMock;
use openzeppelin::tests::mocks::dual_ownable_mocks::SnakeOwnableMock;
use openzeppelin::tests::mocks::dual_ownable_mocks::SnakeOwnablePanicMock;
use openzeppelin::tests::mocks::non_implementing_mock::NonImplementingMock;
use openzeppelin::tests::utils;
use openzeppelin::utils::serde::SerializedAppend;
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing::set_caller_address;
use starknet::testing::set_contract_address;
use zeroable::Zeroable;

//
// Constants
Expand Down
10 changes: 5 additions & 5 deletions src/tests/access/test_ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use openzeppelin::access::ownable::Ownable::InternalImpl;
use openzeppelin::access::ownable::Ownable::OwnableCamelOnlyImpl;
use openzeppelin::access::ownable::Ownable::OwnableImpl;
use openzeppelin::access::ownable::Ownable::_owner::InternalContractStateTrait;
use openzeppelin::access::ownable::Ownable;
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::testing;
use zeroable::Zeroable;
use openzeppelin::access::ownable::Ownable;
use openzeppelin::access::ownable::Ownable::OwnableImpl;
use openzeppelin::access::ownable::Ownable::OwnableCamelOnlyImpl;
use openzeppelin::access::ownable::Ownable::InternalImpl;
use openzeppelin::access::ownable::Ownable::_owner::InternalContractStateTrait;

fn ZERO() -> ContractAddress {
contract_address_const::<0>()
Expand Down
15 changes: 7 additions & 8 deletions src/tests/account/test_account.cairo
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
use array::ArrayTrait;
use core::traits::Into;
use option::OptionTrait;
use serde::Serde;
use starknet::account::Call;
use starknet::contract_address_const;
use starknet::ContractAddress;
use starknet::testing;

use openzeppelin::account::Account;
use openzeppelin::account::AccountABIDispatcher;
use openzeppelin::account::AccountABIDispatcherTrait;
use openzeppelin::account::interface::ISRC6_ID;
use openzeppelin::account::QUERY_VERSION;
use openzeppelin::account::TRANSACTION_VERSION;
use openzeppelin::account::interface::ISRC6_ID;
use openzeppelin::introspection::interface::ISRC5_ID;
use openzeppelin::tests::utils;
use openzeppelin::token::erc20::ERC20;
use openzeppelin::token::erc20::interface::IERC20Dispatcher;
use openzeppelin::token::erc20::interface::IERC20DispatcherTrait;
use openzeppelin::utils::selectors;
use openzeppelin::utils::serde::SerializedAppend;
use option::OptionTrait;
use serde::Serde;
use starknet::ContractAddress;
use starknet::account::Call;
use starknet::contract_address_const;
use starknet::testing;

//
// Constants
Expand Down
11 changes: 5 additions & 6 deletions src/tests/account/test_dual_account.cairo
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use starknet::testing;

use openzeppelin::account::dual_account::DualCaseAccount;
use openzeppelin::account::dual_account::DualCaseAccountABI;
use openzeppelin::account::AccountCamelABIDispatcher;
use openzeppelin::account::AccountCamelABIDispatcherTrait;
use openzeppelin::account::AccountABIDispatcher;
use openzeppelin::account::AccountABIDispatcherTrait;
use openzeppelin::account::AccountCamelABIDispatcher;
use openzeppelin::account::AccountCamelABIDispatcherTrait;
use openzeppelin::account::dual_account::DualCaseAccount;
use openzeppelin::account::dual_account::DualCaseAccountABI;
use openzeppelin::introspection::interface::ISRC5_ID;
use openzeppelin::tests::account::test_account::SIGNED_TX_DATA;
use openzeppelin::tests::mocks::account_panic_mock::CamelAccountPanicMock;
Expand All @@ -14,6 +12,7 @@ use openzeppelin::tests::mocks::camel_account_mock::CamelAccountMock;
use openzeppelin::tests::mocks::non_implementing_mock::NonImplementingMock;
use openzeppelin::tests::mocks::snake_account_mock::SnakeAccountMock;
use openzeppelin::tests::utils;
use starknet::testing;

//
// Constants
Expand Down
2 changes: 1 addition & 1 deletion src/tests/introspection.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mod test_src5;
mod test_dual_src5;
mod test_src5;
16 changes: 8 additions & 8 deletions src/tests/introspection/test_dual_src5.cairo
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use array::ArrayTrait;
use openzeppelin::introspection::interface::ISRC5_ID;
use openzeppelin::introspection::interface::ISRC5Dispatcher;
use openzeppelin::introspection::interface::ISRC5DispatcherTrait;
use openzeppelin::introspection::interface::ISRC5CamelDispatcher;
use openzeppelin::introspection::interface::ISRC5CamelDispatcherTrait;
use openzeppelin::introspection::dual_src5::DualCaseSRC5;
use openzeppelin::introspection::dual_src5::DualCaseSRC5Trait;
use openzeppelin::tests::mocks::src5_mocks::SnakeSRC5Mock;
use openzeppelin::introspection::interface::ISRC5CamelDispatcher;
use openzeppelin::introspection::interface::ISRC5CamelDispatcherTrait;
use openzeppelin::introspection::interface::ISRC5Dispatcher;
use openzeppelin::introspection::interface::ISRC5DispatcherTrait;
use openzeppelin::introspection::interface::ISRC5_ID;
use openzeppelin::tests::mocks::non_implementing_mock::NonImplementingMock;
use openzeppelin::tests::mocks::src5_mocks::CamelSRC5Mock;
use openzeppelin::tests::mocks::src5_mocks::SnakeSRC5PanicMock;
use openzeppelin::tests::mocks::src5_mocks::CamelSRC5PanicMock;
use openzeppelin::tests::mocks::non_implementing_mock::NonImplementingMock;
use openzeppelin::tests::mocks::src5_mocks::SnakeSRC5Mock;
use openzeppelin::tests::mocks::src5_mocks::SnakeSRC5PanicMock;
use openzeppelin::tests::utils;

//
Expand Down
6 changes: 3 additions & 3 deletions src/tests/introspection/test_src5.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use openzeppelin::introspection::src5::SRC5;
use openzeppelin::introspection::src5::SRC5::SRC5Impl;
use openzeppelin::introspection::src5::SRC5::InternalImpl;
use openzeppelin::introspection::interface::ISRC5_ID;
use openzeppelin::introspection::src5::SRC5::InternalImpl;
use openzeppelin::introspection::src5::SRC5::SRC5Impl;
use openzeppelin::introspection::src5::SRC5;

const OTHER_ID: felt252 = 0x12345678;

Expand Down
Loading