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

Add function to insert ordered signature to SafeTx #713

Closed
moisses89 opened this issue Dec 12, 2023 · 0 comments · Fixed by #1060
Closed

Add function to insert ordered signature to SafeTx #713

moisses89 opened this issue Dec 12, 2023 · 0 comments · Fixed by #1060
Assignees
Labels
enhancement New feature or request

Comments

@moisses89
Copy link
Member

What is needed?

Currently some projects that uses the safe-eth-py library as safe-cli are keeping by themself the sorting of safeTx signatures each time that new signature is added to safeTx, for example:

 # Insert signature sorted
            if wallet.address not in safe_tx.signers:
                new_owners = safe_tx.signers + [wallet.address]
                new_owner_pos = sorted(new_owners, key=lambda x: int(x, 16)).index(
                    wallet.address
                )
                safe_tx.signatures = (
                    safe_tx.signatures[: 65 * new_owner_pos]
                    + signature
                    + safe_tx.signatures[65 * new_owner_pos :]
                )

I'd suggest include a function in safeTx class that lets a developer to just provide a signature or list of signatures and the function insert the new signature sorted in the safeTx.

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

Successfully merging a pull request may close this issue.

3 participants