From deff8d60bf8a7dbaec942d8adabd74c8b6c22082 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Wed, 17 Apr 2024 09:03:03 -0400 Subject: [PATCH] Finish removing "snapshotURL" from the app everywhere except the edges --- src/components/DaoCreator/index.tsx | 11 +++-------- src/models/DaoTxBuilder.ts | 2 +- .../daos/[daoAddress]/edit/governance/index.tsx | 2 +- src/types/createDAO.ts | 14 ++------------ 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/components/DaoCreator/index.tsx b/src/components/DaoCreator/index.tsx index e49f575cf7..646cdd6eeb 100644 --- a/src/components/DaoCreator/index.tsx +++ b/src/components/DaoCreator/index.tsx @@ -30,15 +30,10 @@ function DaoCreator({ const choosenGovernance = values.essentials.governance; const freezeGuard = isSubDAO ? values.freeze : undefined; - const valuesEssentialsWithSnapshotURL = { - ...values.essentials, - snapshotURL: values.essentials.snapshotENS, - }; - switch (choosenGovernance) { case GovernanceType.MULTISIG: { const data = await prepareMultisigFormData({ - ...valuesEssentialsWithSnapshotURL, + ...values.essentials, ...values.multisig, freezeGuard, }); @@ -49,7 +44,7 @@ function DaoCreator({ } case GovernanceType.AZORIUS_ERC20: { const data = await prepareAzoriusERC20FormData({ - ...valuesEssentialsWithSnapshotURL, + ...values.essentials, ...values.azorius, ...values.erc20Token, freezeGuard, @@ -61,7 +56,7 @@ function DaoCreator({ } case GovernanceType.AZORIUS_ERC721: { const data = await prepareAzoriusERC721FormData({ - ...valuesEssentialsWithSnapshotURL, + ...values.essentials, ...values.azorius, ...values.erc721Token, freezeGuard, diff --git a/src/models/DaoTxBuilder.ts b/src/models/DaoTxBuilder.ts index 1b64e2d568..723b78b094 100644 --- a/src/models/DaoTxBuilder.ts +++ b/src/models/DaoTxBuilder.ts @@ -231,7 +231,7 @@ export class DaoTxBuilder extends BaseTxBuilder { return buildContractCall( this.baseContracts.keyValuePairsContract, 'updateValues', - [['snapshotURL'], [this.daoData.snapshotURL]], + [['snapshotURL'], [this.daoData.snapshotENS]], 0, false, ); diff --git a/src/pages/daos/[daoAddress]/edit/governance/index.tsx b/src/pages/daos/[daoAddress]/edit/governance/index.tsx index 0a1a7475ce..81d45f7550 100644 --- a/src/pages/daos/[daoAddress]/edit/governance/index.tsx +++ b/src/pages/daos/[daoAddress]/edit/governance/index.tsx @@ -36,7 +36,7 @@ export default function ModifyGovernancePage() { deployAzorius( daoData as AzoriusERC20DAO | AzoriusERC721DAO, !daoName || createAccountSubstring(daoAddress!) === daoName, - !daoSnapshotENS && !!daoData.snapshotURL, + !daoSnapshotENS && !!daoData.snapshotENS, ); }; diff --git a/src/types/createDAO.ts b/src/types/createDAO.ts index 9b5dd926c8..9d68f47b75 100644 --- a/src/types/createDAO.ts +++ b/src/types/createDAO.ts @@ -41,16 +41,6 @@ export type DAOEssentials = { snapshotENS: string; }; -/** - * `DAOEssentialsEdge` is a transitionary type that is used in place of the in-app-only `DAOEssentials` type. - * `DAOEssentialsEdge` has a `snapshotURL` field in place of a `snapshotENS` field. - * - * A recent update necessitated the renaming of references to `snapshotURL` to `snapshotENS`, - * but as the contracts and subgraph already use `snapshotURL`, this type is used to maintain compatibility - * of the app with the contracts and subgraph of the outside world. - */ -type DAOEssentialsEdge = Omit & { snapshotURL: string }; - export type DAOGovernorERC20Token = { tokenCreationType: TokenCreationType; tokenImportAddress?: string; @@ -100,7 +90,7 @@ export interface SubDAO DAOFreezeGuardConfig {} export interface AzoriusGovernanceDAO - extends DAOEssentialsEdge, + extends DAOEssentials, DAOGovernorModuleConfig {} export interface AzoriusERC20DAO @@ -114,7 +104,7 @@ export interface AzoriusERC721DAO extends AzoriusGovernanceDAO, DAOGovernorERC721Token {} -export interface SafeMultisigDAO extends DAOEssentialsEdge, SafeConfiguration {} +export interface SafeMultisigDAO extends DAOEssentials, SafeConfiguration {} export type DAOTrigger = ( daoData: SafeMultisigDAO | AzoriusERC20DAO | AzoriusERC721DAO | SubDAO,