-
Notifications
You must be signed in to change notification settings - Fork 11
APP-42: Decode uploaded actions #932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
APP-42: Decode uploaded actions #932
Conversation
Signed-off-by: Milos Dzepina <[email protected]>
…e-action-name-when-we
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
…e-action-name-when-we
|
🚀 Preview Deployment: View Here |
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements decoding functionality for uploaded proposal actions, allowing users to import action files with automatic decoding and normalization. The implementation supports various action types including transfers, DAO/plugin metadata updates, TokenVoting operations, Multisig member management, and GaugeVoter gauge creation. Actions that cannot be explicitly normalized are marked as 'Unknown' and rendered with decoded view only.
Changes:
- Added
decodeActionsandnormalizeDecodedActionsmethods to proposalActionsImportExportUtils for decoding and transforming imported actions into proper form data - Enhanced transferAssetAction component to fetch and display balance information for imported actions
- Integrated decoding flow into actionComposer with loading state management
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts | Core implementation of action decoding and normalization logic with support for multiple action types |
| src/modules/governance/components/createProposalForm/createProposalFormActions/proposalActions/transferAssetAction/transferAssetAction.tsx | Enhanced to fetch balance data for imported transfer actions |
| src/modules/governance/components/actionComposer/actionComposer/actionComposer.tsx | Integrated decoding flow with loading state and error handling |
| src/assets/locales/en.json | Added loading message for action decoding |
| config/.env.local | Configuration changes to backend URL and API version |
| .changeset/public-otters-itch.md | Changeset documenting the minor version bump |
Comments suppressed due to low confidence (1)
src/modules/governance/components/actionComposer/actionComposer/actionComposer.tsx:177
- The function signature indicates it expects IExportedAction[], but it's now being called with decoded IProposalAction[] at line 210. The function should be updated to accept IProposalAction[] as its parameter type, or the parameter name should be changed to reflect that these are already decoded actions.
const handleImportActions = (actions: IExportedAction[]) => {
const parsedActions = actions.map((action) => {
const actionId = crypto.randomUUID();
return {
...action,
value: BigInt(action.value),
id: actionId,
daoId,
} as unknown as IProposalActionData;
});
onAddAction(parsedActions);
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Outdated
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Outdated
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Show resolved
Hide resolved
...odules/governance/utils/proposalActionsImportExportUtils/proposalActionsImportExportUtils.ts
Show resolved
Hide resolved
...alForm/createProposalFormActions/proposalActions/transferAssetAction/transferAssetAction.tsx
Show resolved
Hide resolved
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
Signed-off-by: Milos Dzepina <[email protected]>
…e-action-name-when-we
Co-authored-by: Copilot <[email protected]> Signed-off-by: Milos Dzepina <[email protected]>
Description
Implement decoding of uploaded actions. Not all basic views are supported yet. General approach is that actions not explicitly handled are marked as
Unknown.Unknownactions are rendered with decoded view only.Basic view status:
Implemented:
Not implemented due to the lack of IPFS resolution support:
Not implemented due to complexity, needs a separate ticket:
Type of Change
Developer Checklist:
Review Checklist: