Skip to content

Commit

Permalink
ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkas committed Aug 7, 2024
1 parent 1b87f99 commit aad7f2e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
9 changes: 6 additions & 3 deletions src/identity/utils/getAvatar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ describe('getAvatar', () => {
expect(getChainPublicClient).toHaveBeenNthCalledWith(2, mainnet);
});


it('should use default base avatar when both mainnet and base mainnet avatar are not available', async () => {
const ensName = 'shrek.base.eth';
const expectedBaseAvatarUrl = null;
Expand All @@ -137,7 +136,9 @@ describe('getAvatar', () => {

const avatarUrl = await getAvatar({ ensName, chain: base });

const avatarUrlIsUriData = avatarUrl?.startsWith('data:image/svg+xml;base64')
const avatarUrlIsUriData = avatarUrl?.startsWith(
'data:image/svg+xml;base64',
);
expect(avatarUrlIsUriData).toBe(true);
expect(mockGetEnsAvatar).toHaveBeenNthCalledWith(1, {
name: ensName,
Expand All @@ -164,7 +165,9 @@ describe('getAvatar', () => {

const avatarUrl = await getAvatar({ ensName, chain: baseSepolia });

const avatarUrlIsUriData = avatarUrl?.startsWith('data:image/svg+xml;base64')
const avatarUrlIsUriData = avatarUrl?.startsWith(
'data:image/svg+xml;base64',
);
expect(avatarUrlIsUriData).toBe(true);
expect(mockGetEnsAvatar).toHaveBeenNthCalledWith(1, {
name: ensName,
Expand Down
2 changes: 1 addition & 1 deletion src/identity/utils/getAvatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const getAvatar = async ({
name: normalize(ensName),
});

if(mainnetEnsAvatar) {
if (mainnetEnsAvatar) {
return mainnetEnsAvatar;
}

Expand Down
1 change: 0 additions & 1 deletion src/identity/utils/getBaseDefaultProfilePicture.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { getBaseDefaultProfilePicture } from './getBaseDefaultProfilePicture';

describe('getBaseDefaultProfilePicture', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/identity/utils/getBaseDefaultProfilePictureIndex.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { getBaseDefaultProfilePictureIndex } from './getBaseDefaultProfilePictureIndex';

describe('getBaseDefaultProfilePictureIndex', () => {
Expand All @@ -13,6 +12,8 @@ describe('getBaseDefaultProfilePictureIndex', () => {
expect(getBaseDefaultProfilePictureIndex('leo.base.eth', 7)).toBe(0);
expect(getBaseDefaultProfilePictureIndex('leo.basetest.eth', 7)).toBe(3);
expect(getBaseDefaultProfilePictureIndex('zimmania.base.eth', 7)).toBe(5);
expect(getBaseDefaultProfilePictureIndex('zimmania.basetest.eth', 7)).toBe(4);
expect(getBaseDefaultProfilePictureIndex('zimmania.basetest.eth', 7)).toBe(
4,
);
});
});
4 changes: 2 additions & 2 deletions src/identity/utils/getBaseDefaultProfilePictureIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sha256 } from "viem";
import { sha256 } from 'viem';

// Will return a an index between 0 and optionsLength
export const getBaseDefaultProfilePictureIndex = (
Expand All @@ -13,4 +13,4 @@ export const getBaseDefaultProfilePictureIndex = (
const remainder = hashValue % optionsLength;
const index = remainder;
return index;
};
};
1 change: 0 additions & 1 deletion src/identity/utils/isBasename.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { isBasename } from './isBasename';

describe('isBasename', () => {
Expand Down
9 changes: 7 additions & 2 deletions src/identity/utils/isBasename.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
export const isBasename = (username: string) => {
if (username.endsWith('.base.eth')) return true;
if (username.endsWith('.basetest.eth')) return true;
if (username.endsWith('.base.eth')) {
return true;
}

if (username.endsWith('.basetest.eth')) {
return true;
}
return false;
};

0 comments on commit aad7f2e

Please sign in to comment.