Skip to content

Commit

Permalink
fix: fixed unused variables and typo (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNilesh authored Nov 20, 2024
1 parent 0e4778b commit 526d127
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ pub mod PushComm {
delegated_notification_senders: Map<ContractAddress, Map<ContractAddress, bool>>,
// Contract State
governance: ContractAddress,
push_core_address: EthAddress,
push_token_address: ContractAddress,
// Chain Info
chain_name: felt252,
Expand Down Expand Up @@ -76,7 +75,7 @@ pub mod PushComm {
AddDelegate: AddDelegate,
RemoveDelegate: RemoveDelegate,
SendNotification: SendNotification,
UserNotifcationSettingsAdded: UserNotifcationSettingsAdded
UserNotificationSettingsAdded: UserNotificationSettingsAdded
}

#[derive(Drop, starknet::Event)]
Expand Down Expand Up @@ -131,7 +130,7 @@ pub mod PushComm {
}

#[derive(Drop, starknet::Event)]
pub struct UserNotifcationSettingsAdded {
pub struct UserNotificationSettingsAdded {
#[key]
pub channel: ContractAddress,
#[key]
Expand Down Expand Up @@ -244,7 +243,7 @@ pub mod PushComm {
}

fn _check_notif_req(
self: @ContractState, channel: ContractAddress, recipient: ContractAddress
self: @ContractState, channel: ContractAddress
) -> bool {
let caller_address = get_caller_address();

Expand All @@ -262,7 +261,7 @@ pub mod PushComm {
recipient: ContractAddress,
identity: ByteArray
) -> bool {
let success = self._check_notif_req(channel, recipient);
let success = self._check_notif_req(channel);
if success {
self
.emit(
Expand Down Expand Up @@ -320,7 +319,7 @@ pub mod PushComm {

self
.emit(
UserNotifcationSettingsAdded {
UserNotificationSettingsAdded {
channel: channel,
recipient: caller_address,
notif_id: notif_id,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_channel_settings.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn test_channel_channel_user_settings() {
let setting_saved = push_comm.user_to_channel_notifs(USER_1(), CHANNEL_ADDRESS);
assert(setting_saved == modified_notif_settings, 'Settings saved');

// Assert UserNotifcationSettingsAdded event was emitted
// Assert UserNotificationSettingsAdded event was emitted
spy
.assert_emitted(
@array![
Expand Down

0 comments on commit 526d127

Please sign in to comment.