Merge pull request #10151 from filecoin-project/maciej/1614
Eth JSON-RPC: from in eth_getTransactionByHash is not correctly popul…
This commit is contained in:
commit
27465e5faf
@ -83,6 +83,11 @@ func TestValueTransferValidSignature(t *testing.T) {
|
||||
|
||||
// Success.
|
||||
require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status)
|
||||
|
||||
ethTx, err := client.EthGetTransactionByHash(ctx, &hash)
|
||||
require.Nil(t, err)
|
||||
require.EqualValues(t, ethAddr, ethTx.From)
|
||||
|
||||
}
|
||||
|
||||
func TestLegacyTransaction(t *testing.T) {
|
||||
|
@ -1569,8 +1569,15 @@ func newEthTxFromSignedMessage(ctx context.Context, smsg *types.SignedMessage, s
|
||||
|
||||
tx.Hash, err = tx.TxHash()
|
||||
if err != nil {
|
||||
return ethtypes.EthTx{}, err
|
||||
return ethtypes.EthTx{}, xerrors.Errorf("failed to calculate hash for ethTx: %w", err)
|
||||
}
|
||||
|
||||
fromAddr, err := lookupEthAddress(ctx, smsg.Message.From, sa)
|
||||
if err != nil {
|
||||
return ethtypes.EthTx{}, xerrors.Errorf("failed to resolve Ethereum address: %w", err)
|
||||
}
|
||||
|
||||
tx.From = fromAddr
|
||||
} else if smsg.Signature.Type == crypto.SigTypeSecp256k1 { // Secp Filecoin Message
|
||||
tx = ethTxFromNativeMessage(ctx, smsg.VMMessage(), sa)
|
||||
tx.Hash, err = ethtypes.EthHashFromCid(smsg.Cid())
|
||||
|
Loading…
Reference in New Issue
Block a user