You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2023. It is now read-only.
I tried encoding a 64-length UTF-8 string using ethereum.abi.ContractTranslator.encode() to a function requiring a bytes32 variable, and recieved the error message "string must be utf8 encoded" instead of anything regarding length.
Type length error checking would save many people time when debugging what they're trying to encode with.
The text was updated successfully, but these errors were encountered:
I changed the smart contract variable to be a larger size to accomodate the
length of the variable I was trying to pass to it. The problem I submitted
what that the error message gave was about encoding but the underlying
problem was length.
It seems as though you might not have the proper encoding for your string,
so you might want to try adding a `.encode(‘utf-8’)` to the end of your
string to see if that is an issue.
Corey
On January 13, 2018 at 5:52:47 PM, Guillermo Cruz ([email protected]) wrote:
Hi @corpetty <https://github.com/corpetty> , how did you solve your
problem?. I'm also trying to encode a function call like this.
v, r, s = ecsign(web3.toBytes(hexstr=hash),web3.toBytes(hexstr=pkey))
After I calculate the signature I'm encoding it like so
encode_hex(encode_int32(r))
encode_hex(encode_int32(s))
But when I try to encode it with translator.encode I get the "string must
be utf8 encoded" error.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#852 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWJ8ch_BaWQetYFchgBszKgGWNjQ-5Kks5tKTO-gaJpZM4RYEvR>
.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried encoding a 64-length UTF-8 string using ethereum.abi.ContractTranslator.encode() to a function requiring a
bytes32
variable, and recieved the error message "string must be utf8 encoded" instead of anything regarding length.Type length error checking would save many people time when debugging what they're trying to encode with.
The text was updated successfully, but these errors were encountered: