-
Notifications
You must be signed in to change notification settings - Fork 757
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
fix: contract class splitArgsAndOptions #1253
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the ArgsOrCalldataWithOptions
type is accurate, the ContractOptions
object is used as a concatenation to the regular parameters of the encapsulated method and these get passed to the splitArgsAndOptions
utility. Example from the tests: link. So the type would be closer to something like this: [...ArgsOrCalldata, ContractOptions?]
The issue boils down to differentiating whether the last element is a ContractOptions
or a RawArgsObject
or MultiType
object.
Yea it is [ArgsOrCalldataWithOptions] actually as args are array. |
OK i belave at least now i fixed type |
Yes, that is a more accurate representation. I believe the spread I don't see any utility in restoring the full support, so refactoring the code to exclude the supported scenario seems preferable, it should also simplify detecting whether a |
I agree focused on this pr to fix type and new one to propose solution |
@@ -21,8 +21,37 @@ export type Result = | |||
| boolean | |||
| CairoEnum; | |||
|
|||
export type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata; | |||
export type ArgsOrCalldataWithOptions = ArgsOrCalldata & ContractOptions; | |||
// export type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only q I have is if these are left intentionally here commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No remarks.
Motivation and Resolution
fix type splitArgsAndOptions
Usage related changes
type updated to represent better what it is
Checklist: