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: sign transactions before submitting them to the client #160

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

iqdecay
Copy link
Contributor

@iqdecay iqdecay commented Mar 18, 2022

  • This PR closes Integrate wallet/signer abstraction with the contract abstraction #130 by signing transactions before submitting them to the client.
  • The "sign transactions before submission" portion isn't tested because I struggled
    to find a way to meaningfully test the whole workflow. Feel free to chime in with ideas
    if you think this is important, but to me the unit tests are enough.

@iqdecay iqdecay requested a review from digorithm as a code owner March 18, 2022 15:21
@iqdecay iqdecay self-assigned this Mar 18, 2022
@iqdecay iqdecay added the enhancement New feature or request label Mar 18, 2022
Copy link
Member

@digorithm digorithm left a comment

Choose a reason for hiding this comment

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

The "sign transactions before submission" portion isn't tested because I struggled
to find a way to meaningfully test the whole workflow. Feel free to chime in with ideas
if you think this is important, but to me the unit tests are enough.

IMO that's good enough for now.

I think that for this to be properly tested, the Sway contract that we deploy with a given signature, would have to check, in its ABI method, say, foo(), if the caller of foo() (who signed the call) is the one who signed the deployment, something like Solidity's owner() modifier. This way we could verify that they match. But that would be basically testing Sway + core (including tx, VM) abilities to verify signatures -- not sure this would be valuable at the SDK level. That could be a longer discussion and we can prioritize that for later.

@iqdecay iqdecay merged commit 4837620 into master Mar 18, 2022
@iqdecay iqdecay deleted the vnepveu/feat-sign-tx branch March 18, 2022 21:55
@digorithm digorithm mentioned this pull request Mar 21, 2022
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
Archived in project
Development

Successfully merging this pull request may close these issues.

Integrate wallet/signer abstraction with the contract abstraction
3 participants