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(API): add a user agent #40

Merged
merged 2 commits into from
Jun 6, 2024
Merged

refactor(API): add a user agent #40

merged 2 commits into from
Jun 6, 2024

Conversation

fubuloubu
Copy link
Member

What I did

Noticed in the Safe API transaction service code that a User Agent string is appended to the transaction request when you make a transaction, so I added it

How I did it

Leverage Ape core's user agent string, as well as do a little researching on how it is supposed to be done

How to verify it

Make a transaction on a testnet safe

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
    - [ ] New test cases have been added and are passing
    - [ ] Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

ape_safe/client/__init__.py Show resolved Hide resolved
@@ -117,7 +121,7 @@ def post_transaction(
b"",
)
)
post_dict: Dict = {"signature": signature.hex()}
post_dict: Dict = {"signature": signature.hex(), "origin": ORIGIN}
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this is valid? I don't see it in the OpenAPI doc whereas I do so "origin" in some of the other parts of the doc.

Copy link
Member Author

Choose a reason for hiding this comment

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

I got this from safe-eth-py but come to think of it, basically everything else about that package is wrong lol

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you sure this is valid? I don't see it in the OpenAPI doc whereas I do so "origin" in some of the other parts of the doc.

For some reason, only SafeMultisigTransaction has this (optional) field in the swagger

@fubuloubu fubuloubu enabled auto-merge (squash) June 6, 2024 17:10
@fubuloubu fubuloubu merged commit 4c0891b into main Jun 6, 2024
24 checks passed
@fubuloubu fubuloubu deleted the refactor/api/user-agent branch June 6, 2024 17:34
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