diff --git a/listings/applications/components/src/switchable.cairo b/listings/applications/components/src/switchable.cairo index b2ce28ea..6ed87a95 100644 --- a/listings/applications/components/src/switchable.cairo +++ b/listings/applications/components/src/switchable.cairo @@ -48,4 +48,31 @@ pub mod switchable_component { } // ANCHOR_END: component +#[cfg(test)] +mod tests { + use super::{ + switchable_component, ISwitchable, ISwitchableDispatcher, ISwitchableDispatcherTrait + }; + use starknet::{ContractAddress, syscalls::deploy_syscall, SyscallResultTrait}; + + // fn deploy() -> ISwitchableDispatcher { + // let (contract_address, _) = deploy_syscall( + // switchable_component::TEST_CLASS_HASH.try_into().unwrap(), 0, array![].span(), false + // ) + // .unwrap_syscall(); + + // ISwitchableDispatcherr { contract_address } + // } + + type TestingState = switchable_component::ComponentState; + + // You can derive even `Default` on this type alias + + #[test] + fn test_is_on() { + let mut result: TestingState = Default::default(); + + assert_eq!(result.is_on(), false); + } +} diff --git a/listings/applications/constant_product_amm/src/lib.cairo b/listings/applications/constant_product_amm/src/lib.cairo index 0e88faff..a37a19db 100644 --- a/listings/applications/constant_product_amm/src/lib.cairo +++ b/listings/applications/constant_product_amm/src/lib.cairo @@ -1,4 +1,4 @@ -mod contracts; +pub mod contracts; #[cfg(test)] mod tests; diff --git a/listings/applications/erc20/src/token.cairo b/listings/applications/erc20/src/token.cairo index 51660642..13066c29 100644 --- a/listings/applications/erc20/src/token.cairo +++ b/listings/applications/erc20/src/token.cairo @@ -249,7 +249,7 @@ mod tests { fn test_deploy_when_recipient_is_address_zero() { let recipient: ContractAddress = Zero::zero(); - let (_contract_address, _) = deploy_syscall( + let (contract_address, _) = deploy_syscall( erc20::TEST_CLASS_HASH.try_into().unwrap(), recipient.into(), array![recipient.into(), token_name, decimals.into(), initial_supply, symbols].span(), diff --git a/listings/applications/upgradeable_contract/src/tests.cairo b/listings/applications/upgradeable_contract/src/tests.cairo index 91dfdcfb..dfff4f74 100644 --- a/listings/applications/upgradeable_contract/src/tests.cairo +++ b/listings/applications/upgradeable_contract/src/tests.cairo @@ -1,4 +1,4 @@ -mod tests { +mod tests { use starknet::class_hash::ClassHash; use super::super::upgradeable_contract_v0::{