From 93eb67240afabf13fb9d1c20b375cab9b49aae44 Mon Sep 17 00:00:00 2001 From: iamacook Date: Tue, 7 Nov 2023 18:04:33 +0100 Subject: [PATCH] fix: remove builders --- src/tests/builders/address-ex.ts | 13 ---------- src/tests/builders/safe.ts | 44 -------------------------------- 2 files changed, 57 deletions(-) delete mode 100644 src/tests/builders/address-ex.ts delete mode 100644 src/tests/builders/safe.ts diff --git a/src/tests/builders/address-ex.ts b/src/tests/builders/address-ex.ts deleted file mode 100644 index 3b90750db0..0000000000 --- a/src/tests/builders/address-ex.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { faker } from '@faker-js/faker' -import type { AddressEx } from '@safe-global/safe-gateway-typescript-sdk' - -import { Builder } from '../Builder' -import type { IBuilder } from '../Builder' - -export const addressExBuilder = (): IBuilder => { - return Builder.new().with({ - name: faker.word.words(), - value: faker.finance.ethereumAddress(), - logoUri: faker.image.url(), - }) -} diff --git a/src/tests/builders/safe.ts b/src/tests/builders/safe.ts deleted file mode 100644 index 61c921e80d..0000000000 --- a/src/tests/builders/safe.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { faker } from '@faker-js/faker' -import { ImplementationVersionState } from '@safe-global/safe-gateway-typescript-sdk' -import type { SafeInfo } from '@safe-global/safe-gateway-typescript-sdk' - -import { generateRandomArray } from './utils' -import { addressExBuilder } from './address-ex' -import { LATEST_SAFE_VERSION } from '@/config/constants' -import { Builder } from '../Builder' -import type { IBuilder } from '../Builder' -import type useSafeInfo from '@/hooks/useSafeInfo' - -const OWNERS_LENGTH = 5 - -export const safeInfo = (): IBuilder => { - return Builder.new().with({ - address: addressExBuilder().build(), - chainId: faker.string.numeric({ exclude: '0' }), - nonce: faker.number.int(), - threshold: faker.number.int(), - owners: generateRandomArray(addressExBuilder().build, { min: 1, max: OWNERS_LENGTH }), - implementation: addressExBuilder().build(), - implementationVersionState: faker.helpers.enumValue(ImplementationVersionState), - modules: faker.helpers.arrayElement([generateRandomArray(addressExBuilder().build), null]), - guard: faker.helpers.arrayElement([addressExBuilder().build(), null]), - fallbackHandler: addressExBuilder().build(), - version: faker.helpers.arrayElement(['1.0.0', '1.1.1', '1.2.0', '1.3.0', LATEST_SAFE_VERSION]), - collectiblesTag: faker.string.numeric(), - txQueuedTag: faker.string.numeric(), - txHistoryTag: faker.string.numeric(), - messagesTag: faker.string.numeric(), - }) -} - -export const useSafeInfoBuilder = (): IBuilder> => { - const safe = safeInfo().build() - - return Builder.new>().with({ - safe, - safeAddress: safe.address.value, - safeLoaded: true, - safeError: undefined, - safeLoading: false, - }) -}