Skip to content

Commit

Permalink
Move contracts imports to prelude.
Browse files Browse the repository at this point in the history
commit-id:357a8f6c
  • Loading branch information
gilbens-starkware committed Jul 2, 2024
1 parent ef9607c commit 321286b
Show file tree
Hide file tree
Showing 26 changed files with 11 additions and 388 deletions.
6 changes: 6 additions & 0 deletions corelib/src/prelude/v2023_01.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ use core::{zeroable, zeroable::{NonZero, Zeroable}};
#[cfg(test)]
use core::test;
pub use core::ops::Deref;


pub use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait, StoragePointerReadAccess,
StoragePointerWriteAccess
};
5 changes: 5 additions & 0 deletions corelib/src/prelude/v2023_10.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ pub use core::traits::Index;
pub use core::traits::IndexView;
pub use core::zeroable::NonZero;
pub use core::ops::Deref;

pub use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait, StoragePointerReadAccess,
StoragePointerWriteAccess
};
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -281,10 +277,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -460,10 +452,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -635,10 +623,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -810,10 +794,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -989,10 +969,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -1164,10 +1140,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -1335,10 +1307,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -1518,10 +1486,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -1746,10 +1710,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down Expand Up @@ -1925,10 +1885,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,6 @@ pub fn component_state_for_testing<TContractState>() -> ComponentState<TContract
}


use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ pub fn contract_state_for_testing() -> ContractState {
unsafe_new_contract_state()
}

use starknet::storage::{
StorageMapReadAccessTrait, StorageMapWriteAccessTrait,
StorableStoragePointerReadAccess, StorableStoragePointerWriteAccess
};
// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one.
#[deprecated(
feature: "deprecated_legacy_map",
Expand Down
Loading

0 comments on commit 321286b

Please sign in to comment.