From 638f2109e770a4bb1e85614755be34744fef9d9d Mon Sep 17 00:00:00 2001 From: aman035 Date: Tue, 18 Jun 2024 18:53:01 +0530 Subject: [PATCH] fix: temp - downgrade to goerli --- packages/d-node-notif/src/lib/config.ts | 22 +-- .../d-node-notif/src/lib/helpers/address.ts | 2 +- .../src/lib/payloads/constants.ts | 8 +- .../pushNotification/pushNotificationBase.ts | 2 +- .../tests/lib/notification/alias.test.ts | 8 +- .../tests/lib/notification/channel.test.ts | 137 +++--------------- .../tests/lib/notification/delegate.test.ts | 20 +-- .../lib/notification/notification.test.ts | 32 ++-- 8 files changed, 69 insertions(+), 162 deletions(-) diff --git a/packages/d-node-notif/src/lib/config.ts b/packages/d-node-notif/src/lib/config.ts index 66324562b..00b6af0de 100644 --- a/packages/d-node-notif/src/lib/config.ts +++ b/packages/d-node-notif/src/lib/config.ts @@ -26,7 +26,7 @@ import { const BLOCKCHAIN_NETWORK = { ETH_MAINNET: 'eip155:1', - ETH_SEPOLIA: 'eip155:11155111', + ETH_GOERLI: 'eip155:5', POLYGON_MAINNET: 'eip155:137', POLYGON_AMOY: 'eip155:80002', BSC_MAINNET: 'eip155:56', @@ -56,9 +56,9 @@ export type ALIAS_CHAIN = export const ETH_CHAIN_ID = { [ENV.PROD]: 1, - [ENV.STAGING]: 11155111, - [ENV.DEV]: 11155111, - [ENV.LOCAL]: 11155111, + [ENV.STAGING]: 5, + [ENV.DEV]: 5, + [ENV.LOCAL]: 5, }; export const ALIAS_CHAIN_ID: { @@ -122,7 +122,7 @@ export const CHAIN_ID = { export const CHAIN_NAME: { [key: number]: string } = { // eth 1: 'ETHEREUM', - 11155111: 'ETHEREUM', + 5: 'ETHEREUM', // polygon 137: 'POLYGON', 80002: 'POLYGON', @@ -213,7 +213,7 @@ const CONFIG = { }, }, [ENV.STAGING]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { EPNS_COMMUNICATOR_CONTRACT: '0x0c34d54a09cfe75bccd878a469206ae77e0fe6e7', }, [BLOCKCHAIN_NETWORK.POLYGON_AMOY]: { @@ -242,7 +242,7 @@ const CONFIG = { }, }, [ENV.DEV]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c', }, [BLOCKCHAIN_NETWORK.POLYGON_AMOY]: { @@ -271,7 +271,7 @@ const CONFIG = { }, }, [ENV.LOCAL]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c', }, [BLOCKCHAIN_NETWORK.POLYGON_AMOY]: { @@ -372,7 +372,7 @@ export const VIEM_CONFIG = { }, }, [ENV.STAGING]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { NETWORK: sepolia, EPNS_COMMUNICATOR_CONTRACT: '0x0c34d54a09cfe75bccd878a469206ae77e0fe6e7', @@ -419,7 +419,7 @@ export const VIEM_CONFIG = { }, }, [ENV.DEV]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { NETWORK: sepolia, EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c', }, @@ -458,7 +458,7 @@ export const VIEM_CONFIG = { }, }, [ENV.LOCAL]: { - [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { NETWORK: sepolia, EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c', }, diff --git a/packages/d-node-notif/src/lib/helpers/address.ts b/packages/d-node-notif/src/lib/helpers/address.ts index f50796aa5..a0f8bd159 100644 --- a/packages/d-node-notif/src/lib/helpers/address.ts +++ b/packages/d-node-notif/src/lib/helpers/address.ts @@ -199,7 +199,7 @@ export function getFallbackETHCAIPAddress(env: ENV, address: string) { env === Constants.ENV.STAGING || env === Constants.ENV.LOCAL ) { - chainId = 11155111; + chainId = 5; } return `eip155:${chainId}:${address}`; diff --git a/packages/d-node-notif/src/lib/payloads/constants.ts b/packages/d-node-notif/src/lib/payloads/constants.ts index 1656878ed..abd101c9b 100644 --- a/packages/d-node-notif/src/lib/payloads/constants.ts +++ b/packages/d-node-notif/src/lib/payloads/constants.ts @@ -4,7 +4,7 @@ export interface ChainIdToSourceType { export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = { 1: 'ETH_MAINNET', - 11155111: 'ETH_TEST_SEPOLIA', + 5: 'ETH_TEST_GOERLI', 137: 'POLYGON_MAINNET', 80002: 'POLYGON_TEST_AMOY', 56: 'BSC_MAINNET', @@ -24,7 +24,7 @@ export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = { export const SOURCE_TYPES = { ETH_MAINNET: 'ETH_MAINNET', - ETH_TEST_SEPOLIA: 'ETH_TEST_SEPOLIA', + ETH_TEST_GOERLI: 'ETH_TEST_GOERLI', POLYGON_MAINNET: 'POLYGON_MAINNET', POLYGON_TEST_AMOY: 'POLYGON_TEST_AMOY', BSC_MAINNET: 'BSC_MAINNET', @@ -46,8 +46,8 @@ export const SOURCE_TYPES = { }; export const SUPPORTED_CHAINS = [ - 1, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, - 122, 123, 80085, 111557560, 7560, + 1, 5, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, 122, + 123, 80085, 111557560, 7560, ]; export enum IDENTITY_TYPE { diff --git a/packages/d-node-notif/src/lib/pushNotification/pushNotificationBase.ts b/packages/d-node-notif/src/lib/pushNotification/pushNotificationBase.ts index 722ed38ba..7135f59eb 100644 --- a/packages/d-node-notif/src/lib/pushNotification/pushNotificationBase.ts +++ b/packages/d-node-notif/src/lib/pushNotification/pushNotificationBase.ts @@ -825,7 +825,7 @@ export class PushNotificationBaseClass { ) as CAIPDetailsType; let channelInCaip = channelOrAliasCaip; - if (networkId !== '1' && networkId !== '11155111') { + if (networkId !== '1' && networkId !== '5') { // Alias const aliasInfo = await this.getAliasInfo(address); channelInCaip = aliasInfo?.channel || channelInCaip; diff --git a/packages/d-node-notif/tests/lib/notification/alias.test.ts b/packages/d-node-notif/tests/lib/notification/alias.test.ts index 08f4b798b..bdd657582 100644 --- a/packages/d-node-notif/tests/lib/notification/alias.test.ts +++ b/packages/d-node-notif/tests/lib/notification/alias.test.ts @@ -97,7 +97,7 @@ describe('PushAPI.alias functionality', () => { it('Without signer and account :: should throw error', async () => { await expect(() => userBob.channel.alias.initiate( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); @@ -105,7 +105,7 @@ describe('PushAPI.alias functionality', () => { it('With signer and without provider :: should throw error', async () => { await expect(() => userAlice.channel.alias.initiate( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); @@ -145,7 +145,7 @@ describe('PushAPI.alias functionality', () => { it('Without signer and account :: should throw error', async () => { await expect(() => userBob.channel.alias.verify( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); @@ -153,7 +153,7 @@ describe('PushAPI.alias functionality', () => { it('With signer and without provider :: should throw error', async () => { await expect(() => userAlice.channel.alias.verify( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); diff --git a/packages/d-node-notif/tests/lib/notification/channel.test.ts b/packages/d-node-notif/tests/lib/notification/channel.test.ts index 3869dd0cd..4316f8028 100644 --- a/packages/d-node-notif/tests/lib/notification/channel.test.ts +++ b/packages/d-node-notif/tests/lib/notification/channel.test.ts @@ -83,7 +83,7 @@ describe('PushAPI.channel functionality', () => { it('Without signer and with valid caip account: Should return response', async () => { const res = await userBob.channel.info( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', { raw: false, } @@ -120,7 +120,7 @@ describe('PushAPI.channel functionality', () => { it('Without signer and account : Should return response as address is passed', async () => { const res = await userBob.channel.subscribers({ - channel: 'eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + channel: 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', }); console.log(res); expect(res).not.null; @@ -204,19 +204,7 @@ describe('PushAPI.channel functionality', () => { }); }); - describe('channel :: send', () => { - // TODO: remove skip after signer becomes optional - it.skip('Without signer and account : Should throw error', async () => { - await expect(() => { - userBob.channel.send(['*'], { - notification: { - title: 'test', - body: 'test', - }, - }); - }).to.Throw; - }); - + describe.only('channel :: send', () => { it('With signer : broadcast : Should send notification with title and body', async () => { const res = await userAlice.channel.send(['*'], { notification: { @@ -224,12 +212,12 @@ describe('PushAPI.channel functionality', () => { body: 'test', }, }); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : targeted : Should send notification with title and body', async () => { const res = await userAlice.channel.send( - ['eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681'], + ['eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681'], { notification: { title: 'hi', @@ -237,12 +225,12 @@ describe('PushAPI.channel functionality', () => { }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : targeted : Should send notification with title and body', async () => { const res = await userAlice.channel.send( - ['eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5'], + ['eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5'], { notification: { title: 'hi', @@ -250,14 +238,14 @@ describe('PushAPI.channel functionality', () => { }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : subset : Should send notification with title and body', async () => { const res = await userAlice.channel.send( [ - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', ], { notification: { @@ -266,14 +254,14 @@ describe('PushAPI.channel functionality', () => { }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : subset : Should send notification with title and body along with additional options', async () => { const res = await userAlice.channel.send( [ - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', ], { notification: { @@ -289,14 +277,14 @@ describe('PushAPI.channel functionality', () => { }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : subset : Should send notification with title and body along with additional options', async () => { const res = await userAlice.channel.send( [ - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', ], { notification: { @@ -312,36 +300,14 @@ describe('PushAPI.channel functionality', () => { }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); it('With signer : subset : Should send notification with title and body along with additional options', async () => { const res = await userAlice.channel.send( [ - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:11155111:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', - ], - { - notification: { - title: 'hi', - body: 'test-subset', - }, - payload: { - title: 'testing first subset notification', - body: 'testing with random body', - cta: 'https://google.com/', - embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', - }, - } - ); - expect(res.status).to.equal(204); - }); - - it.skip('With signer : subset : Should send notification with title and body along with additional options for alias', async () => { - const res = await userAlice.channel.send( - [ - 'eip155:97:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:97:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', ], { notification: { @@ -354,68 +320,9 @@ describe('PushAPI.channel functionality', () => { cta: 'https://google.com/', embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', }, - channel: `eip155:97:${account2}`, - } - ); - expect(res.status).to.equal(204); - }); - - it.skip('With signer : subset : Should send notification with title and body along with additional options for alias', async () => { - const res = await userAlice.channel.send( - [ - 'eip155:80001:0xC8c243a4fd7F34c49901fe441958953402b7C024', - 'eip155:80001:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', - ], - { - notification: { - title: 'hi', - body: 'test-subset', - }, - payload: { - title: 'testing first subset notification', - body: 'testing with random body', - cta: 'https://google.com/', - embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', - }, - channel: `eip155:80001:${account2}`, - } - ); - expect(res.status).to.equal(204); - }); - - it.skip('With signer : subset : Should send notification with title and body along with additional options for alias', async () => { - const res = await userAlice.channel.send( - [ - 'eip155:97:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:97:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', - ], - { - notification: { - title: 'hi', - body: 'test-subset', - }, - payload: { - title: 'testing first subset notification', - body: 'testing with random body', - cta: 'https://google.com/', - embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', - }, - channel: 'eip155:97:0xD8634C39BBFd4033c0d3289C4515275102423681', - } - ); - expect(res.status).to.equal(204); - }); - it('With signer : SIMULATED : Should send notification with title and body', async () => { - const res = await userNoChannel.channel.send( - [`eip155:11155111:${noChannelAddress}`], - { - notification: { - title: 'hi', - body: 'test-targeted-simulated', - }, } ); - expect(res.status).to.equal(204); + expect(res.status).to.equal(200); }); }); @@ -561,7 +468,7 @@ describe('PushAPI.channel functionality', () => { describe('notifications', async () => { it('Should fetch channel specific feeds', async () => { const res = await userAlice.channel.notifications( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', { raw: false } ); console.log(inspect(res, { depth: null })); @@ -570,7 +477,7 @@ describe('PushAPI.channel functionality', () => { it('Should fetch channel specific feeds in raw format', async () => { const res = await userAlice.channel.notifications( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', { raw: true } ); console.log(inspect(res, { depth: null })); diff --git a/packages/d-node-notif/tests/lib/notification/delegate.test.ts b/packages/d-node-notif/tests/lib/notification/delegate.test.ts index 85f73ed89..63e88eeb1 100644 --- a/packages/d-node-notif/tests/lib/notification/delegate.test.ts +++ b/packages/d-node-notif/tests/lib/notification/delegate.test.ts @@ -57,7 +57,7 @@ describe('PushAPI.delegate functionality', () => { it.skip('Without signer and account :: should throw error', async () => { await expect(() => userBob.channel.delegate.add( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); @@ -65,14 +65,14 @@ describe('PushAPI.delegate functionality', () => { it('With signer and without provider :: should throw error', async () => { await expect(() => userAlice.channel.delegate.add( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); it('With signer and provider :: should add delegate', async () => { const res = await userKate.channel.delegate.add( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); // console.log(res); expect(res).not.null; @@ -80,7 +80,7 @@ describe('PushAPI.delegate functionality', () => { it('With viem signer and provider :: should add delegate', async () => { const res = await viemUser.channel.delegate.add( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); console.log(res); expect(res).not.null; @@ -112,7 +112,7 @@ describe('PushAPI.delegate functionality', () => { it('With viem signer: Should add delegate', async () => { const res = await viemUser.channel.delegate.add( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); // console.log(res); expect(res).not.null; @@ -124,7 +124,7 @@ describe('PushAPI.delegate functionality', () => { it.skip('Without signer and account :: should throw error', async () => { await expect(() => userBob.channel.delegate.remove( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); @@ -132,14 +132,14 @@ describe('PushAPI.delegate functionality', () => { it('With signer and without provider :: should throw error', async () => { await expect(() => userAlice.channel.delegate.remove( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ) ).to.Throw; }); it('With signer and provider :: should add delegate', async () => { const res = await userKate.channel.delegate.remove( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); console.log(res); expect(res).not.null; @@ -155,7 +155,7 @@ describe('PushAPI.delegate functionality', () => { it('With viem signer: Should remove delegate', async () => { const res = await viemUser.channel.delegate.remove( - 'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' ); // console.log(res); expect(res).not.null; @@ -176,7 +176,7 @@ describe('PushAPI.delegate functionality', () => { it('Without signer : Should fetch delegates', async () => { const res = await userBob.channel.delegate.get({ - channel: 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', }); // console.log(res); expect(res).not.null; diff --git a/packages/d-node-notif/tests/lib/notification/notification.test.ts b/packages/d-node-notif/tests/lib/notification/notification.test.ts index 461e73b8c..7cf17cd48 100644 --- a/packages/d-node-notif/tests/lib/notification/notification.test.ts +++ b/packages/d-node-notif/tests/lib/notification/notification.test.ts @@ -60,14 +60,14 @@ describe('PushAPI.notification functionality', () => { it('Should return feeds with signer object when an account is passed', async () => { const response = await userAlice.notification.list('SPAM', { - account: 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', }); expect(response).not.null; }); it('Should return feeds without signer object when an account is passed', async () => { const response = await userBob.notification.list('SPAM', { - account: 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', }); expect(response).not.null; }); @@ -105,7 +105,7 @@ describe('PushAPI.notification functionality', () => { it('Should return feeds when signer with provider is used', async () => { const response = await userKate.notification.list('INBOX', { - account: 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', channels: ['0xD8634C39BBFd4033c0d3289C4515275102423681'], raw: true, }); @@ -128,10 +128,10 @@ describe('PushAPI.notification functionality', () => { it('Should return feeds when signer with provider is used', async () => { const response = await userKate.notification.list('INBOX', { - account: 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', channels: [ - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', - 'eip155:11155111:0x53474D90663de06BEf5D0017F450730D83168063', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x53474D90663de06BEf5D0017F450730D83168063', ], raw: true, }); @@ -143,24 +143,24 @@ describe('PushAPI.notification functionality', () => { describe('notification :: subscribe', () => { beforeEach(async () => { // await userAlice.notification.unsubscribe( - // 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + // 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // ); // await userKate.notification.unsubscribe( - // 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + // 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // ); // }); // afterEach(async () => { // await userAlice.notification.unsubscribe( - // 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + // 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // ); // await userKate.notification.unsubscribe( - // 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + // 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // ); }); it.skip('Without signer object: should throw error', async () => { await expect(() => userBob.notification.subscribe( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' ) ).to.Throw; }); @@ -183,7 +183,7 @@ describe('PushAPI.notification functionality', () => { it('With signer object: Should subscribe', async () => { const res = await userAlice.notification.subscribe( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', { settings: [ { @@ -202,7 +202,7 @@ describe('PushAPI.notification functionality', () => { it('With signer and provider: Should subscribe', async () => { const res = await userKate.notification.subscribe( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' ); // console.log(res) expect(res).not.null; @@ -210,7 +210,7 @@ describe('PushAPI.notification functionality', () => { it('With signer and provider: Should subscribe', async () => { const res = await userKate.notification.subscribe( - 'eip155:11155111:0xC8c243a4fd7F34c49901fe441958953402b7C024', + 'eip155:5:0xC8c243a4fd7F34c49901fe441958953402b7C024', { settings: [ { @@ -243,14 +243,14 @@ describe('PushAPI.notification functionality', () => { it('With viem signer and provider: Should subscribe', async () => { const res = await userViem.notification.subscribe( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' ); expect(res.message).to.equal('successfully opted into channel'); }); it('With viem signer and provider: Should unsubscribe', async () => { const res = await userViem.notification.unsubscribe( - 'eip155:11155111:0xD8634C39BBFd4033c0d3289C4515275102423681' + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' ); expect(res.message).to.equal('successfully opted out channel'); });