Skip to content
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

Operations. Split CallDecoder and details view to core and feature-specific modules. #2659

Open
johnthecat opened this issue Nov 14, 2024 · 0 comments
Assignees
Milestone

Comments

@johnthecat
Copy link
Contributor

johnthecat commented Nov 14, 2024

Operations page became bloated with different operation types handling and specific code for each of them. Our new approach address this problem by decoupling core logic (unwrapping batch and proxy) and render of feature-specific details about extrinsic.
Main idea is to create DI slot for injecting details and pass unwrapped extrinsic as prop.
Image
DI handler in every feature should check if it's known extrinsic and if yes - render details. Pseudo-code:

governanceMultisigFeature.inject(operationDetailsSlot, ({ extrinsic }) => {
  if (!knownExtrinsic(extrinsic)) {
    return null;
  }
  const decodedData = decode(extrinsic);

  return (
    <DetailsRow label="Referendum">{decodedData.referendumId}</DetailsRow>
  );
});

Same way we should inject operation name, operation icon and details on confirm screen.

After this changes, operations page should become yet-another-feature with self contained logic. When new operation type appear, feature related to it should inject handlers and it should be enough.

@johnthecat johnthecat self-assigned this Nov 14, 2024
@johnthecat johnthecat converted this from a draft issue Nov 14, 2024
@johnthecat johnthecat assigned Asmadek and unassigned johnthecat Nov 14, 2024
@pgolovkin pgolovkin modified the milestones: Milestone 5, Milestone 4 Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Development
Development

No branches or pull requests

3 participants