harmony-one / sdk

Javascript SDK of Harmony protocol.
MIT License
92 stars 43 forks source link

TruffleProvider is not processing web3.eth.getTransaction calls explicitly, causing errors #87

Open polymorpher opened 3 years ago

polymorpher commented 3 years ago

With TruffleProvider as the provider, if one uses web3.eth.getTransaction(txHash) with a valid txHash, the web3 client would complain the underlying sender address one1xxxxxx... is not a valid Ethereum address. I noticed hmy_getTransactionReceipt is overloaded and handled in a special way in truffleProvider.ts, but not hmy_getTransaction. That may be the underlying reason for the error.

A workaround is to use getTransactionByHash in @harmony-js/core/blockchain.ts, but that requires creating a separate instance for RPC call rather than using web3, which would be undesirable