Skip to content

Commit

Permalink
fixed build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
the-first-elder committed Jun 4, 2024
1 parent 8148b2c commit 19a20cc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
27 changes: 27 additions & 0 deletions listings/applications/components/src/switchable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<MockContract::ContractState>;

// 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);
}
}

2 changes: 1 addition & 1 deletion listings/applications/constant_product_amm/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod contracts;
pub mod contracts;

#[cfg(test)]
mod tests;
2 changes: 1 addition & 1 deletion listings/applications/erc20/src/token.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion listings/applications/upgradeable_contract/src/tests.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod tests {
mod tests {
use starknet::class_hash::ClassHash;

use super::super::upgradeable_contract_v0::{
Expand Down

0 comments on commit 19a20cc

Please sign in to comment.