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

Replace .sign() with .requireSignature() #558

Merged
merged 4 commits into from
Nov 15, 2022

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Nov 15, 2022

closes #441

This PR deprecates .sign() on SmartContract as well as AccountUpdate in favor of .requireSignature().

requireSignature() is different in that it doesn't take an optional private key as input. The idea is to move to a default flow where all private keys are passed into tx.sign([...]) after constructing the tx. This is already possible with this.sign() but we now want to make this the only supported flow of signing transactions. The reason is that only with this flow, it's possible to have the tx signed by a wallet, and it's confusing to have two different ways of doing it.

We also add doc-comments to sign / requireSignature!

Copy link
Member

@Trivo25 Trivo25 left a comment

Choose a reason for hiding this comment

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

very nice!

@mitschabaude mitschabaude merged commit c3d602f into main Nov 15, 2022
@mitschabaude mitschabaude deleted the feature/require-signature branch November 15, 2022 17:50
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.

Rename SmartContract.sign() to requireSignature() (?)
2 participants