fix: Eth JSON-RPC API: eth_getTransactionReceipt logs-related fixes.
Hardhat doesn't like logs: null in transaction receipts when no logs were emitted. Wants empty array. Size logsBloom correctly.
This commit is contained in:
parent
08382c6f48
commit
b8b3b5d48b
@ -79,6 +79,8 @@ var (
|
|||||||
_ EthEventAPI = *new(api.FullNode)
|
_ EthEventAPI = *new(api.FullNode)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var EmptyLogsBloom = make([]byte, 256)
|
||||||
|
|
||||||
// EthModule provides a default implementation of EthModuleAPI.
|
// EthModule provides a default implementation of EthModuleAPI.
|
||||||
// It can be swapped out with another implementation through Dependency
|
// It can be swapped out with another implementation through Dependency
|
||||||
// Injection (for example with a thin RPC client).
|
// Injection (for example with a thin RPC client).
|
||||||
@ -1604,7 +1606,8 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
|
|||||||
BlockHash: blockHash,
|
BlockHash: blockHash,
|
||||||
BlockNumber: blockNumber,
|
BlockNumber: blockNumber,
|
||||||
Type: ethtypes.EthUint64(2),
|
Type: ethtypes.EthUint64(2),
|
||||||
LogsBloom: []byte{0},
|
LogsBloom: EmptyLogsBloom,
|
||||||
|
Logs: make([]ethtypes.EthLog, 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
if receipt.To == nil && lookup.Receipt.ExitCode.IsSuccess() {
|
if receipt.To == nil && lookup.Receipt.ExitCode.IsSuccess() {
|
||||||
|
Loading…
Reference in New Issue
Block a user