-
Notifications
You must be signed in to change notification settings - Fork 147
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
bug: TokenAssociateTransaction#setAccountId does not accept EVM address based account ID #2442
Comments
Thanks @a-ridley - I think this indicates that a broader review is necessary, for all the SDK methods which accept an account ID as an input parameter, and identify which ones accept an EVM address it the place of the account ID, and which ones don't. For those, there could be 2 possible fixes: (1) Faster solution: Implement a util function to convert the EVM address to account ID conversion. (2) Slower solution: Implement the lookup/ conversion in the HAPI implementation on the Hedera nodes.
|
@bguiz, I agree with your given solutions but they have their complications. About your first solution. There is no way to derive an account ID from the EVM Address. They are not generated using mathematical formula so the only way you can get the account ID is using the mirror node. As you mentioned this might make the transactions slow and we already did something similar. The community wasn't happy with the changes so we had to revert them. Also there would be some inconsistencies in how the SDK handles transactions which I am not really a fan of. Your second solution seems better to me but it had some issues too. I found that it used to work like that until this PR . This PR addressed this issue. As of right now I think there is no better way than using mirror node API. (edited) |
💯 agreed, I think that this is the best solution among the various options.
|
Description
Variation 1 - EVM address as string:
Variation 2 - account ID based on EVM address:
Variation 3 - Account ID in S.R.N format:
Steps to reproduce
assocTx
in each of the above variations.assocTx
using the code belowTransferTransaction
, which do accept their own equivalents of variations 1 and 2.Additional context
The error is
INVALID_ACCOUNT_ID
and the full output is copied below.The error occurs when
getReceipt
is invoked.Hedera network
testnet
Version
2.48.1
Operating system
macOS
The text was updated successfully, but these errors were encountered: