Skip to content

Commit

Permalink
Finish removing "snapshotURL" from the app everywhere except the edges
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Apr 17, 2024
1 parent d4af814 commit deff8d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
11 changes: 3 additions & 8 deletions src/components/DaoCreator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -49,7 +44,7 @@ function DaoCreator({
}
case GovernanceType.AZORIUS_ERC20: {
const data = await prepareAzoriusERC20FormData({
...valuesEssentialsWithSnapshotURL,
...values.essentials,
...values.azorius,
...values.erc20Token,
freezeGuard,
Expand All @@ -61,7 +56,7 @@ function DaoCreator({
}
case GovernanceType.AZORIUS_ERC721: {
const data = await prepareAzoriusERC721FormData({
...valuesEssentialsWithSnapshotURL,
...values.essentials,
...values.azorius,
...values.erc721Token,
freezeGuard,
Expand Down
2 changes: 1 addition & 1 deletion src/models/DaoTxBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/daos/[daoAddress]/edit/governance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ModifyGovernancePage() {
deployAzorius(
daoData as AzoriusERC20DAO | AzoriusERC721DAO,
!daoName || createAccountSubstring(daoAddress!) === daoName,
!daoSnapshotENS && !!daoData.snapshotURL,
!daoSnapshotENS && !!daoData.snapshotENS,
);
};

Expand Down
14 changes: 2 additions & 12 deletions src/types/createDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DAOEssentials, 'snapshotENS'> & { snapshotURL: string };

export type DAOGovernorERC20Token<T = bigint> = {
tokenCreationType: TokenCreationType;
tokenImportAddress?: string;
Expand Down Expand Up @@ -100,7 +90,7 @@ export interface SubDAO<T = bigint>
DAOFreezeGuardConfig<T> {}

export interface AzoriusGovernanceDAO<T = bigint>
extends DAOEssentialsEdge,
extends DAOEssentials,
DAOGovernorModuleConfig<T> {}

export interface AzoriusERC20DAO<T = bigint>
Expand All @@ -114,7 +104,7 @@ export interface AzoriusERC721DAO<T = bigint>
extends AzoriusGovernanceDAO<T>,
DAOGovernorERC721Token<T> {}

export interface SafeMultisigDAO extends DAOEssentialsEdge, SafeConfiguration {}
export interface SafeMultisigDAO extends DAOEssentials, SafeConfiguration {}

export type DAOTrigger = (
daoData: SafeMultisigDAO | AzoriusERC20DAO | AzoriusERC721DAO | SubDAO,
Expand Down

0 comments on commit deff8d6

Please sign in to comment.