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

πŸ› (context-module) [DSDK-615]: Iterate on transaction calldata #563

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

aussedatlo
Copy link
Contributor

@aussedatlo aussedatlo commented Dec 16, 2024

πŸ“ Description

Iterate on transaction calldata descriptors to avoid empty objects.
image

❓ Context

  • Feature:

βœ… Checklist

Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.

  • Covered by automatic tests
  • Changeset is provided
  • Impact of the changes:
    • list of the changes

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

@aussedatlo aussedatlo requested a review from a team as a code owner December 16, 2024 10:26
Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
device-sdk-ts-sample βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Dec 16, 2024 0:40am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
doc-device-management-kit ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 0:40am

Copy link
Contributor

github-actions bot commented Dec 16, 2024

Messages
βœ… Danger: All checks passed successfully! πŸŽ‰

Generated by 🚫 dangerJS against 62d0721

Copy link
Contributor

@paoun-ledger paoun-ledger left a comment

Choose a reason for hiding this comment

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

lgtm

const calldataDescriptor =
calldata.descriptors_calldata?.[address]?.[selector];
if (!calldataDescriptor) {
if (!Array.isArray(dto)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to check the array length as well and add a test case for it. The return in line 76 and at the end of the loop have the same message, I think it's better to clarify / differentiate the known error at early step (not an array or empty), which can also help us locate where the problem is in real use case.

@aussedatlo aussedatlo added this pull request to the merge queue Dec 16, 2024
Merged via the queue into develop with commit 1b8d75c Dec 16, 2024
10 checks passed
@aussedatlo aussedatlo deleted the fix/dsdk-615-handle-empty-calldata branch December 16, 2024 15:35
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.

3 participants