Open bguiz opened 3 months ago
This bug is also occurring on TokenFreezeTransaction()
It was reported by a dev who is part of the Hello Future Hackathon.
Error Output:
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. Either locally using a mathematical conversion using "long-zero" EVM address, or by making a network request (e.g. to a mirror node API) to obtain the "standard" EVM address. ... and then use that as a substitute prior to invoking the HAPI on the Hedera nodes.
(2) Slower solution: Implement the lookup/ conversion in the HAPI implementation on the Hedera nodes.
This bug is also occurring on
TokenFreezeTransaction()
It was reported by a dev who is part of the Hello Future Hackathon.
Hello, @bguiz @a-ridley
@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. According to this issue: Using aliases in functions other than crypto transfer transaction was deprecated because we were not supporting aliases everywhere in mono-service.
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. So the question is about whether the SDK will automatically call the relevant mirror node API for you. If this is feasible, I think we should do it.
As of right now I think there is no better way than using mirror node API.
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 whengetReceipt
is invoked.Hedera network
testnet
Version
2.48.1
Operating system
macOS