Skip to content

Commit

Permalink
fix: temp - downgrade to goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Jun 18, 2024
1 parent df2611d commit 638f210
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 162 deletions.
22 changes: 11 additions & 11 deletions packages/d-node-notif/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -213,7 +213,7 @@ const CONFIG = {
},
},
[ENV.STAGING]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
EPNS_COMMUNICATOR_CONTRACT: '0x0c34d54a09cfe75bccd878a469206ae77e0fe6e7',
},
[BLOCKCHAIN_NETWORK.POLYGON_AMOY]: {
Expand Down Expand Up @@ -242,7 +242,7 @@ const CONFIG = {
},
},
[ENV.DEV]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c',
},
[BLOCKCHAIN_NETWORK.POLYGON_AMOY]: {
Expand Down Expand Up @@ -271,7 +271,7 @@ const CONFIG = {
},
},
[ENV.LOCAL]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c',
},
[BLOCKCHAIN_NETWORK.POLYGON_AMOY]: {
Expand Down Expand Up @@ -372,7 +372,7 @@ export const VIEM_CONFIG = {
},
},
[ENV.STAGING]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
NETWORK: sepolia,

EPNS_COMMUNICATOR_CONTRACT: '0x0c34d54a09cfe75bccd878a469206ae77e0fe6e7',
Expand Down Expand Up @@ -419,7 +419,7 @@ export const VIEM_CONFIG = {
},
},
[ENV.DEV]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
NETWORK: sepolia,
EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c',
},
Expand Down Expand Up @@ -458,7 +458,7 @@ export const VIEM_CONFIG = {
},
},
[ENV.LOCAL]: {
[BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: {
[BLOCKCHAIN_NETWORK.ETH_GOERLI]: {
NETWORK: sepolia,
EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/d-node-notif/src/lib/helpers/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
8 changes: 4 additions & 4 deletions packages/d-node-notif/src/lib/payloads/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/d-node-notif/tests/lib/notification/alias.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ 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;
});

it('With signer and without provider :: should throw error', async () => {
await expect(() =>
userAlice.channel.alias.initiate(
'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924'
'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924'
)
).to.Throw;
});
Expand Down Expand Up @@ -145,15 +145,15 @@ 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;
});

it('With signer and without provider :: should throw error', async () => {
await expect(() =>
userAlice.channel.alias.verify(
'eip155:11155111:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924'
'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924'
)
).to.Throw;
});
Expand Down
Loading

0 comments on commit 638f210

Please sign in to comment.