Skip to content

Conversation

@fayi-da
Copy link
Contributor

@fayi-da fayi-da commented Sep 30, 2025

Fixes #2413

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

@fayi-da fayi-da force-pushed the fayi/2413-amulet-form-to-action-encoder branch 2 times, most recently from 34be433 to 980d09c Compare September 30, 2025 16:29
@fayi-da fayi-da marked this pull request as ready for review October 1, 2025 07:13
@fayi-da fayi-da force-pushed the fayi/2413-amulet-form-to-action-encoder branch from 980d09c to 5c01928 Compare October 1, 2025 07:14
Copy link
Contributor

Copilot AI left a 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 PR implements an amulet form to action encoder that builds AmuletConfig objects from configuration changes. The implementation enables conversion of form data to the required configuration format for submission.

  • Adds a utility function to construct AmuletConfig objects from ConfigChange arrays
  • Updates the transfer fee steps indexing to be 1-based for consistency
  • Integrates the new encoder into the SetAmuletConfigRulesForm for action creation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
buildAmuletRulesConfigFromChanges.ts New utility function that converts ConfigChange arrays to AmuletConfig objects
buildAmuletConfigChanges.ts Fixes transfer fee steps indexing and adds required synchronizers handling
SetAmuletConfigRulesForm.tsx Integrates the new encoder to create actions for form submission
buildAmuletRulesConfigFromChanges.test.tsx Comprehensive test coverage for the new encoder utility

@fayi-da fayi-da force-pushed the fayi/2413-amulet-form-to-action-encoder branch from 5c01928 to 35d18eb Compare October 1, 2025 07:31
Fixes #2413

Signed-off-by: fayi-da <fayimora.femibalogun@digitalasset.com>
@fayi-da fayi-da force-pushed the fayi/2413-amulet-form-to-action-encoder branch from 35d18eb to ec7acf1 Compare October 1, 2025 07:40
Signed-off-by: fayi-da <fayimora.femibalogun@digitalasset.com>
Copy link
Contributor

@pawelperek-da pawelperek-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

defaultValues,
onSubmit: async ({ value }) => {
onSubmit: async ({ value: formData }) => {
console.log('submit amulet config form data: ', formData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave the logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i'll remove it in the PR that implements the full submission flow

},
},
};
console.log('action for submission', action);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave the logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i'll remove it in the PR that implements the full submission flow


const allSynchronizers = [
...new Set([...beforeRequiredSynchronizers, ...afterRequiredSynchronizers]),
].sort();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.sort is fishy as it's modifying the original array, I'd rather use the immutable .toSorted in modern code but in this case it's not all that important

@fayi-da fayi-da merged commit 615e623 into main Oct 2, 2025
57 checks passed
@fayi-da fayi-da deleted the fayi/2413-amulet-form-to-action-encoder branch October 2, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement amulet form -> json/action encoder

3 participants