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

Simplify TransactionSummary type #952

Open
izri16 opened this issue Apr 11, 2021 · 0 comments
Open

Simplify TransactionSummary type #952

izri16 opened this issue Apr 11, 2021 · 0 comments
Assignees
Labels

Comments

@izri16
Copy link
Collaborator

izri16 commented Apr 11, 2021

Based on @xdzurman comment:

Now we have:

export type TransactionSummary = {
  type: TxType
  fee: Lovelace
  plan: TxPlan
} & (
  | SendTransactionSummary
  | WithdrawTransactionSummary
  | DelegateTransactionSummary
  | DeregisterStakingKeyTransactionSummary
)

and every sub-summary is an extension of that, perhaps I'd opt for having only the type, fee, plan in the bare default TransactionSummary and the more specific plans would be defined like SendTransactionSummary = TransactionSummary & {whatever...} and use just that, because there are multiple places in the code where this is handled very freestyle-like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants