Skip to content

Commit

Permalink
rename set up approver action to become approver
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 17, 2024
1 parent e4c8ac9 commit 4607844
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 56 deletions.
4 changes: 2 additions & 2 deletions packages/i18n/locales/bad/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@
"available": "bad",
"availableBalance": "bad bad",
"availableHistoryLoaded": "bad bad bad bad bad bad",
"becomeApproverDescription": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"betterNonPfmIbcPathAvailable": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"betterPfmIbcPathAvailable_one": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"betterPfmIbcPathAvailable_other": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
Expand Down Expand Up @@ -1174,7 +1175,6 @@
"searchValidatorsPlaceholder": "bad bad bad",
"selectPressChain": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"selfRelayDescription": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"setUpApproverDescription": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
"setUpDiscordNotificationsTooltip": "bad bad bad bad",
"signedInAs": "bad bad bad bad",
"socialLoginWarning": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad",
Expand Down Expand Up @@ -1420,6 +1420,7 @@
"averages": "bad",
"balance": "bad",
"balances": "bad",
"becomeApprover": "bad bad bad",
"beforeYouEnter": "bad bad bad",
"beginVesting": "bad bad",
"browserWallets": "bad bad",
Expand Down Expand Up @@ -1670,7 +1671,6 @@
"selectNftToTransfer": "bad bad bad bad",
"send": "bad",
"setItem": "bad bad",
"setUpApprover": "bad bad bad",
"setWithdrawAddress": "bad bad bad",
"signingAs": "bad bad",
"slashAmountToRegister": "bad bad bad bad",
Expand Down
8 changes: 4 additions & 4 deletions packages/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@
"approvalProposalExplanation_pending": "This proposal is waiting to be accepted by the approver so that it can open for voting.",
"approvalProposalExplanation_rejected": "This proposal was not allowed to open for voting because the approver rejected it.",
"approverEnabledNoMultipleChoice": "Approver is enabled, which is currently incompatible with multiple choice proposals.",
"approverExplanation_choosing": "DAOs shown below have this DAO ({{daoName}}) set as their approver. This action completes the approval setup process by enabling the creation of approval proposals in {{daoName}} when the selected DAO below attempts to create a new proposal.",
"approverExplanation_chose": "The DAO shown below has this DAO ({{daoName}}) set as their approver. This action completes the approval setup process by enabling the creation of approval proposals in {{daoName}} when the selected DAO below attempts to create a new proposal.",
"approverExplanation_choosing": "DAOs shown below have this DAO ({{daoName}}) set as their approver. This action completes the setup process and automates the creation of approval proposals in {{daoName}} when the selected DAO below attempts to create a new proposal. Proposals created in the selected DAO before this setup is complete must be manually approved with the Execute Smart Contract action.",
"approverExplanation_chose": "The DAO shown below has this DAO ({{daoName}}) set as their approver. This action completes the setup process and automates the creation of approval proposals in {{daoName}} when the selected DAO below attempts to create a new proposal. Proposals created in the selected DAO before this setup is complete must be manually approved with the Execute Smart Contract action.",
"approverProposalExplanation_closed": "This proposal is responsible for approving a proposal in another DAO. Since it was rejected and closed, the original proposal was not allowed to open for voting.",
"approverProposalExplanation_executed": "This proposal is responsible for approving a proposal in another DAO. Since it was passed and executed, the original proposal opened for voting.",
"approverProposalExplanation_execution_failed": "This proposal is responsible for approving a proposal in another DAO. An unexpected error occurred (execution failed). Something is wrong.",
Expand All @@ -967,6 +967,7 @@
"available": "available",
"availableBalance": "Available balance",
"availableHistoryLoaded": "All available history has been loaded.",
"becomeApproverDescription": "Assume responsibility for approving another DAO's proposals before they open for voting.",
"becomeSubDaoActionDescription": "Provide the address of a DAO to request to become its SubDAO. The DAO will then need to accept your request to complete the ownership transfer and become your parent. Once the transfer is complete, only your new parent DAO can transfer ownership in the future. Keep in mind that your parent DAO will have full authority to execute anything it wants to on behalf of this DAO.",
"becomeSubDaoActionDescription_created": "The parent DAO needs to accept this request to complete the ownership transfer and become your parent. Once the transfer is complete, only your new parent DAO can transfer ownership in the future. Keep in mind that your parent DAO will have full authority to execute anything it wants to on behalf of this DAO.",
"becomeSubDaoDescription": "Request to become a SubDAO of a DAO.",
Expand Down Expand Up @@ -1352,7 +1353,6 @@
"selectExistingProposalBelow": "Select an existing proposal below.",
"selectPressChain": "Each post will be minted as an NFT on this chain and then deposited into the DAO's treasury.",
"selfRelayDescription": "One or more messages in this proposal require self-relaying across chains since automatic relayers do not exist or are inactive right now.",
"setUpApproverDescription": "Set up this DAO as an approver that is responsible for approving another DAO's proposals before they open for voting.",
"setUpDiscordNotificationsTooltip": "Set up Discord notifications",
"signedInAs": "Signed in as {{name}}",
"socialLoginWarning": "Social logins may be less secure than a self-managed wallet. We recommend the self-managed wallets, above, if you plan on storing large amounts of money.",
Expand Down Expand Up @@ -1632,6 +1632,7 @@
"averages": "Averages",
"balance": "Balance",
"balances": "Balances",
"becomeApprover": "Become Approver",
"becomeSubDao": "Become SubDAO",
"beforeYouEnter": "Before you enter",
"beginVesting": "Begin vesting",
Expand Down Expand Up @@ -1914,7 +1915,6 @@
"send": "Send",
"setAdminToParent": "Set admin to {{parent}}",
"setItem": "Set Item",
"setUpApprover": "Set Up Approver",
"setWithdrawAddress": "Set Withdraw Address",
"signingAs": "Signing as",
"slashAmountToRegister": "Slash amount to register",
Expand Down
8 changes: 4 additions & 4 deletions packages/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,8 @@
"approvalProposalExplanation_pending": "Esta propuesta está esperando ser aceptada por el aprobador para que pueda abrirse a votación.",
"approvalProposalExplanation_rejected": "Esta propuesta no se permitió abrir a votación porque el aprobador la rechazó.",
"approverEnabledNoMultipleChoice": "El aprobador está habilitado, lo cual actualmente es incompatible con propuestas de opción múltiple.",
"approverExplanation_choosing": "Los DAOs que se muestran a continuación han establecido este DAO ({{daoName}}) como su aprobador. Esta acción completa el proceso de configuración de la aprobación al habilitar la creación de propuestas de aprobación en {{daoName}} cuando el DAO seleccionado a continuación intenta crear una nueva propuesta.",
"approverExplanation_chose": "El DAO que se muestra a continuación ha establecido este DAO ({{daoName}}) como su aprobador. Esta acción completa el proceso de configuración de la aprobación al habilitar la creación de propuestas de aprobación en {{daoName}} cuando el DAO seleccionado a continuación intenta crear una nueva propuesta.",
"approverExplanation_choosing": "Los DAOs que se muestran a continuación han establecido este DAO ({{daoName}}) como su aprobador. Esta acción completa el proceso de configuración y automatiza la creación de propuestas de aprobación en {{daoName}} cuando el DAO seleccionado a continuación intenta crear una nueva propuesta. Las propuestas creadas en el DAO seleccionado antes de que se complete esta configuración deben aprobarse manualmente con la acción Ejecutando el Contrato inteligente.",
"approverExplanation_chose": "El DAO que se muestra a continuación ha establecido este DAO ({{daoName}}) como su aprobador. Esta acción completa el proceso de configuración y automatiza la creación de propuestas de aprobación en {{daoName}} cuando el DAO seleccionado a continuación intenta crear una nueva propuesta. Las propuestas creadas en el DAO seleccionado antes de que se complete esta configuración deben aprobarse manualmente con la acción Ejecutando el Contrato inteligente.",
"approverProposalExplanation_closed": "Esta propuesta es responsable de aprobar una propuesta en otro DAO. Dado que fue rechazada y cerrada, no se permitió abrir la propuesta original para votación.",
"approverProposalExplanation_executed": "Esta propuesta es responsable de aprobar una propuesta en otro DAO. Dado que fue aprobada y ejecutada, la propuesta original se abrió para votación.",
"approverProposalExplanation_execution_failed": "Esta propuesta es responsable de aprobar una propuesta en otro DAO. Ocurrió un error inesperado (fallo en la ejecución). Algo está mal.",
Expand All @@ -1023,6 +1023,7 @@
"available": "Disponible",
"availableBalance": "Saldo disponible",
"availableHistoryLoaded": "Toda la historia disponible se ha cargado.",
"becomeApproverDescription": "Asume la responsabilidad de aprobar las propuestas de otro DAO antes de que se abran para votación.",
"becomeSubDaoActionDescription": "Proporciona la dirección de un DAO para solicitar convertirte en su SubDAO. Luego, el DAO deberá aceptar tu solicitud para completar la transferencia de propiedad y convertirse en tu matriz. Una vez que la transferencia se complete, solo tu nuevo DAO matriz podrá transferir la propiedad en el futuro. Ten en cuenta que tu DAO matriz tendrá plena autoridad para ejecutar cualquier cosa que desee en nombre de este DAO.",
"becomeSubDaoActionDescription_created": "El DAO matriz necesita aceptar esta solicitud para completar la transferencia de propiedad y convertirse en tu matriz. Una vez que la transferencia se complete, solo tu nuevo DAO matriz podrá transferir la propiedad en el futuro. Ten en cuenta que tu DAO matriz tendrá plena autoridad para ejecutar cualquier cosa que desee en nombre de este DAO.",
"becomeSubDaoDescription": "Solicitar convertirse en un SubDAO de un DAO.",
Expand Down Expand Up @@ -1454,7 +1455,6 @@
"selectPressChain": "Cada publicación se acuñará como un NFT en esta cadena y luego se depositará en el tesoro del DAO.",
"selfRelayDescription": "Uno o más mensajes en esta propuesta requieren auto-retransmisión a través de cadenas ya que los retransmisores automáticos no existen o están inactivos en este momento.",
"setAnImage": "Establecer una imágen",
"setUpApproverDescription": "Configura este DAO como un aprobador responsable de aprobar las propuestas de otro DAO antes de que se abran para votación.",
"setUpDiscordNotificationsTooltip": "Configurar notificaciones de Discord",
"signedInAs": "Conectado como {{name}}",
"socialLoginWarning": "Los inicios de sesión sociales pueden ser menos seguros que una billetera autogestionada. Recomendamos las billeteras autogestionadas, arriba, si planeas almacenar grandes cantidades de dinero.",
Expand Down Expand Up @@ -1749,6 +1749,7 @@
"balance": "Saldo",
"balanceUnstaked": "Balance (retirado {{nombre}})",
"balances": "Saldos",
"becomeApprover": "Convertirse en aprobador",
"becomeSubDao": "Convertirse en SubDAO",
"beforeYouEnter": "antes de entrar",
"beginVesting": "Comenzar el período de adquisición",
Expand Down Expand Up @@ -2042,7 +2043,6 @@
"send": "Enviar",
"setAdminToParent": "Establecer admin a {{parent}}",
"setItem": "Establecer ítem",
"setUpApprover": "Configurar aprobador",
"setWithdrawAddress": "Establecer dirección de retiro",
"signingAs": "Firmando como",
"slashAmountToRegister": "Cantidad de penalización a registrar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
} from '@dao-dao/types'
import { ActionComponent } from '@dao-dao/types/actions'

export type SetUpApproverData = {
export type BecomeApproverData = {
address: string
// Loaded once created from `address`.
dao?: string
}

export type SetUpApproverOptions = {
export type BecomeApproverOptions = {
options: LoadingDataWithError<
{
dao: string
Expand All @@ -30,14 +30,12 @@ export type SetUpApproverOptions = {
EntityDisplay: ComponentType<StatefulEntityDisplayProps>
}

export const SetUpApproverComponent: ActionComponent<SetUpApproverOptions> = ({
fieldNamePrefix,
isCreating,
options: { options, EntityDisplay },
}) => {
export const BecomeApproverComponent: ActionComponent<
BecomeApproverOptions
> = ({ fieldNamePrefix, isCreating, options: { options, EntityDisplay } }) => {
const { t } = useTranslation()
const { name: daoName } = useDaoInfoContext()
const { watch, setValue } = useFormContext<SetUpApproverData>()
const { watch, setValue } = useFormContext<BecomeApproverData>()

const dao = watch((fieldNamePrefix + 'dao') as 'dao')

Expand Down
26 changes: 26 additions & 0 deletions packages/stateful/actions/core/actions/BecomeApprover/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# BecomeApprover

Set up this DAO as an approver for another DAO with a pre-propose-approval-*
module whose approver is already set to this DAO. This will automatically create
proposals in this DAO that decide whether or not to allow proposals in the other
DAO to open for voting.

## Bulk import format

This is relevant when bulk importing actions, as described in [this
guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions).

### Key

`becomeApprover`

### Data format

```json
{
"address": "<ADDRESS>"
}
```

`address` refers to the `dao-pre-propose-approval-*` contract created with this
DAO as the approver.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import {
import { EntityDisplay } from '../../../../components/EntityDisplay'
import { useQueryLoadingDataWithError } from '../../../../hooks'
import {
SetUpApproverData,
SetUpApproverComponent as StatelessComponent,
BecomeApproverData,
BecomeApproverComponent as StatelessComponent,
} from './Component'

const Component: ActionComponent = (props) => {
Expand All @@ -55,7 +55,7 @@ const Component: ActionComponent = (props) => {
chain: { chain_id: chainId },
} = useActionOptions()

const { watch, setValue } = useFormContext<SetUpApproverData>()
const { watch, setValue } = useFormContext<BecomeApproverData>()
const preProposeApprovalSingle = watch(
(props.fieldNamePrefix + 'address') as 'address'
)
Expand Down Expand Up @@ -95,11 +95,11 @@ const Component: ActionComponent = (props) => {
)
}

export class SetUpApproverAction extends ActionBase<SetUpApproverData> {
public readonly key = ActionKey.SetUpApprover
export class BecomeApproverAction extends ActionBase<BecomeApproverData> {
public readonly key = ActionKey.BecomeApprover
public readonly Component = Component

protected _defaults: SetUpApproverData = {
protected _defaults: BecomeApproverData = {
address: '',
}

Expand All @@ -108,25 +108,25 @@ export class SetUpApproverAction extends ActionBase<SetUpApproverData> {
options.context.type !== ActionContextType.Dao ||
!options.context.dao.info.supportedFeatures[Feature.Approval]
) {
throw new Error('Invalid context for setting up an approver')
throw new Error('Invalid context for becoming an approver')
}

super(options, {
Icon: PersonRaisingHandEmoji,
label: options.t('title.setUpApprover'),
description: options.t('info.setUpApproverDescription'),
label: options.t('title.becomeApprover'),
description: options.t('info.becomeApproverDescription'),
})
}

async encode({
address: preProposeApprovalContract,
}: SetUpApproverData): Promise<UnifiedCosmosMsg> {
}: BecomeApproverData): Promise<UnifiedCosmosMsg> {
// Type-check. This is already checked in the constructor.
if (
this.options.context.type !== ActionContextType.Dao ||
this.options.chainContext.type !== ActionChainContextType.Supported
) {
throw new Error('Invalid context for setting up an approver')
throw new Error('Invalid context for becoming an approver')
}

if (!preProposeApprovalContract) {
Expand Down Expand Up @@ -257,7 +257,7 @@ export class SetUpApproverAction extends ActionBase<SetUpApproverData> {
})
}

decode([{ decodedMessage }]: ProcessedMessage[]): SetUpApproverData {
decode([{ decodedMessage }]: ProcessedMessage[]): BecomeApproverData {
const parsedPreProposeMsg = decodeJsonFromBase64(
decodeJsonFromBase64(
decodedMessage.wasm.execute.msg.update_proposal_modules.to_add[0].msg,
Expand Down
23 changes: 0 additions & 23 deletions packages/stateful/actions/core/actions/SetUpApprover/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/stateful/actions/core/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './AcceptSubDao'
export * from './AuthzExec'
export * from './AuthzGrantRevoke'
export * from './BecomeApprover'
export * from './BecomeSubDao'
export * from './BulkImport'
export * from './BurnNft'
Expand Down Expand Up @@ -43,7 +44,6 @@ export * from './MintNft'
export * from './NeutronOverruleSubDaoProposal'
export * from './PauseRebalancer'
export * from './ResumeRebalancer'
export * from './SetUpApprover'
export * from './Spend'
export * from './TransferNft'
export * from './UpdateAdmin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const makeDaoGovernanceActionCategory: ActionCategoryMaker = ({
ActionKey.DaoAdminExec,
ActionKey.UpgradeV1ToV2,
ActionKey.CreateCrossChainAccount,
ActionKey.SetUpApprover,
ActionKey.BecomeApprover,
ActionKey.VetoProposal,
ActionKey.ExecuteProposal,
ActionKey.ManageVetoableDaos,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export enum ActionKey {
EnableRetroactiveCompensation = 'enableRetroactiveCompensation',
DaoAdminExec = 'daoAdminExec',
EnableMultipleChoice = 'enableMultipleChoice',
SetUpApprover = 'setUpApprover',
BecomeApprover = 'becomeApprover',
ManageWidgets = 'manageWidgets',
FeeShare = 'feeShare',
ManageMembers = 'manageMembers',
Expand Down

0 comments on commit 4607844

Please sign in to comment.