-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
fix: specify encoding when calling bytes
[APE-1186]
#1539
Conversation
bytes
bytes
[APE-1186]
bytes
[APE-1186]bytes
[APE-1186]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test can be really simple:
def test_txn_str_when_data_is_bytes(ethereum):
txn = ethereum.create_transaction(data=HexBytes("0x123"))
actual = str(txn)
assert isinstance(actual, str)
^ this fails on main
I recently encountered an analogous issue, and the resolution was accomplished via the installation of this specific branch. This is to shed light on a plausible implication associated with the constant handling of UTF-8 formatted strings, particularly when they are passed as ape strings that represent parameters such as the Universal Resource Identifier (URI) for NFT images. In the wake of recent updates to the Vyper, Python, and Ape environments, I have started experiencing difficulties with a previously operational contract. This has specifically impacted the ability to load NFT image assets on various marketplaces including, but not limited to, Rarible and OpenSea. Token Minted Transaction: Goerli Etherscan Please note the associated links for further perusal and analysis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I added the test for you.
What I did
Specify encoding as utf-8 when calling bytes
fixes: #1535
fixes: APE-1181
How I did it
in this case we should always be dealing with utf8 strings
How to verify it
I kept getting contract deployment failures like reported in the discord and in #1535
with this fix I was able to deploy contracts successfully
Checklist