Skip to content

Add unapprove instruction#51

Open
archseer wants to merge 1 commit into
coral-xyz:masterfrom
smartcontractkit:add-unapprove
Open

Add unapprove instruction#51
archseer wants to merge 1 commit into
coral-xyz:masterfrom
smartcontractkit:add-unapprove

Conversation

@archseer

@archseer archseer commented Mar 7, 2022

Copy link
Copy Markdown

Reverse of approve (I just copied approve and flipped the bool), allows a signer to undo a previous approval.

@fanatid

fanatid commented Mar 7, 2022

Copy link
Copy Markdown
Contributor

Maybe will better to change approve for accepting bool as second argument?

pub fn approve(ctx: Context<Approve>, state: bool) -> Result<()> {
    ctx.accounts.transaction.signers[owner_index] = state;

@archseer

Copy link
Copy Markdown
Author

We could but it would be a breaking change to the current API

@fanatid

fanatid commented Mar 14, 2022

Copy link
Copy Markdown
Contributor

If we want to skip breaking change we can introduce approve2 like initialize_account2 in spl-token.

@archseer

Copy link
Copy Markdown
Author

I can implement it either way, let me know if you'd like me to change it.

@fanatid

fanatid commented Mar 18, 2022

Copy link
Copy Markdown
Contributor

ping @armaniferrante

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.

2 participants