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

feat: allow passing raw call data to sendUserOperation #272

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

moldy530
Copy link
Collaborator

@moldy530 moldy530 commented Nov 21, 2023

Pull Request Checklist

  • Did you add new tests and confirm existing tests pass? (yarn test)
  • Did you update relevant docs? (docs are found in the site folder, see guidleines below)
  • Do your commits follow the Conventional Commits standard?
  • Does your PR title also follow the Conventional Commits standard?
  • If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples? (e.g. feat!: breaking change)
  • Did you run lint (yarn lint:check) and fix any issues? (yarn lint:fix)
  • Is the base branch you're merging into development and not main?

PR-Codex overview

Focus of the PR:

This PR focuses on modifying the UserOperationCallData type to allow for an additional property Hex, and updating related code to accommodate this change.

Detailed summary:

  • Modified UserOperationCallData type to include an additional property Hex
  • Updated KernelUserOperationCallData type to exclude Hex
  • Updated KernelBatchUserOperationCallData type to exclude Hex
  • Updated BatchUserOperationCallData type to exclude Hex
  • Updated sendUserOperation.md guide to include Hex as a possible parameter type

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link
Contributor

@denniswon denniswon left a comment

Choose a reason for hiding this comment

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

we should update the sendUO doc. otherwise lgtm

@moldy530 moldy530 force-pushed the moldy/senduo-data-escape-hatch branch from b7dc0c9 to eb94a54 Compare November 21, 2023 23:04
@moldy530
Copy link
Collaborator Author

@denniswon docs are updated

Comment on lines +4 to +9
export type KernelUserOperationCallData = Exclude<
UserOperationCallData,
Hex
> & {
delegateCall?: boolean;
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

oh so does Exclude only work when UserOperationCallData is the Hex type alias, vs. the calldata object of target, data, value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other way around, the use of Exclude here means take all the union types of UserOperationCallData and omit the Hex one. Essentially: Exclude<a | b, b> = a

### `UserOperationCallData | UserOperationCallData[]`
### `UserOperationCallData | UserOperationCallData[] | Hex`

`UserOperationCallData` is an object with the following properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`UserOperationCallData` is an object with the following properties:
`UserOperationCallData` is either a `Hex`value, or an object with the following properties:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I didn't want to confuse that here actually... I add the | Hex explicitly already above to make that clearer. because otherwise it might be the case that you can do Hex[] as batch (which is not the case)

Copy link
Contributor

@avasisht23 avasisht23 left a comment

Choose a reason for hiding this comment

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

two nits, lgtm

@moldy530 moldy530 merged commit 19e5738 into development Nov 22, 2023
3 checks passed
@moldy530 moldy530 deleted the moldy/senduo-data-escape-hatch branch November 22, 2023 17:35
@moldy530 moldy530 mentioned this pull request Dec 1, 2023
8 tasks
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.

None yet

3 participants