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

[Refactor] change TransactionRequest to field to Option<TxKind> #549

Closed
7 tasks
prestwich opened this issue Apr 16, 2024 · 1 comment
Closed
7 tasks

[Refactor] change TransactionRequest to field to Option<TxKind> #549

prestwich opened this issue Apr 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@prestwich
Copy link
Member

prestwich commented Apr 16, 2024

  • Modify to field to make creates explicit
  • Error on non-4844 build if to is unset
  • Error on 4844 build if to is unset or create
  • Add following to the builder trait
    • fn as_create(self) -> Self shortcut to set the field to Some(Create)

    • fn deploy_code(self, code: Vec<u8>) -> Self to set data and to fields at once

    • fn with_call<T: SolCall>(self, t: T) -> Self to set data and ensure to is NOT Create (set to to None if it is currently Create)

          not convinced we should default to create instead of erroring if not specifically set to create, as creating with `value` and empty data is a valid tx that burns user funds. We should probably error on building if `to` is unset, and provide a shortcut for `.create()`
      

Originally posted by @prestwich in #505 (comment)

@prestwich prestwich added the enhancement New feature or request label Apr 16, 2024
@EmperorOrokuSaki
Copy link
Contributor

I'll give this a try.

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

No branches or pull requests

3 participants