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

Improving method DX for getMessageProof #2736

Closed
mvares opened this issue Jul 8, 2024 · 2 comments
Closed

Improving method DX for getMessageProof #2736

mvares opened this issue Jul 8, 2024 · 2 comments
Assignees
Labels
chore Issue is a chore

Comments

@mvares
Copy link
Contributor

mvares commented Jul 8, 2024

Currently, the code doesn't allow the use of both parameters at the same time. To use commitBlockHeight, I need to define commitBlockId as undefined, which doesn't seem to be a comprehensible approach for users.

async getMessageProof(
transactionId: string,
nonce: string,
commitBlockId?: string,
commitBlockHeight?: BN
): Promise<MessageProof | null> {

Therefore, I think it might be interesting if we could define this within an object:

async getMessageProof(
    transactionId: string,
    nonce: string,
    options: { 
      commitBlockId?: string,
      commitBlockHeight?: BN 
     }
  )
@mvares mvares added the triage Issue needs to be triaged label Jul 8, 2024
@mvares mvares closed this as completed Jul 11, 2024
@mvares mvares reopened this Jul 11, 2024
@petertonysmith94 petertonysmith94 self-assigned this Jul 12, 2024
@petertonysmith94 petertonysmith94 added chore Issue is a chore p2 and removed triage Issue needs to be triaged labels Jul 12, 2024
@petertonysmith94 petertonysmith94 added this to the 0.x post-launch milestone Jul 12, 2024
@petertonysmith94 petertonysmith94 removed their assignment Jul 12, 2024
@petertonysmith94
Copy link
Contributor

I think this has merit:

  • Has better conformity with our approach to options.
  • More explicit for the end user.

@petertonysmith94 petertonysmith94 changed the title Improving UX from getMessageProof Improving method DX for getMessageProof Jul 12, 2024
@mvares
Copy link
Contributor Author

mvares commented Jul 12, 2024

Makes sense. I think it's better to stick with the current DX.

Thanks for comment, @petertonysmith94!

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

No branches or pull requests

2 participants