enha: ensure all primitives implement DebugAsJson #1570
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Tests
Description
DebugAsJson
for various Ethereum primitive structs and enums.Debug
implementations where applicable.serde_debug_json
test macro to ensure JSON serialization matchesDebug
output.Changes walkthrough 📝
23 files
address.rs
Implement `DebugAsJson` for `Address` struct
src/eth/primitives/address.rs
DebugAsJson
derive toAddress
struct.block_header.rs
Implement `DebugAsJson` for `BlockHeader` struct
src/eth/primitives/block_header.rs
DebugAsJson
derive toBlockHeader
struct.block_number.rs
Implement `DebugAsJson` for `BlockNumber` struct
src/eth/primitives/block_number.rs
DebugAsJson
derive toBlockNumber
struct.bytes.rs
Implement `DebugAsJson` for `Bytes` struct and remove custom `Debug`
src/eth/primitives/bytes.rs
DebugAsJson
derive toBytes
struct.Debug
implementation forBytes
.call_input.rs
Implement `DebugAsJson` for `CallInput` struct
src/eth/primitives/call_input.rs
DebugAsJson
derive toCallInput
struct.chain_id.rs
Implement `DebugAsJson` for `ChainId` struct
src/eth/primitives/chain_id.rs
DebugAsJson
derive toChainId
struct.code_hash.rs
Implement `DebugAsJson` for `CodeHash` struct
src/eth/primitives/code_hash.rs
DebugAsJson
derive toCodeHash
struct.difficulty.rs
Implement `DebugAsJson` for `Difficulty` struct
src/eth/primitives/difficulty.rs
DebugAsJson
derive toDifficulty
struct.execution_result.rs
Implement `DebugAsJson` for `ExecutionResult` enum
src/eth/primitives/execution_result.rs
DebugAsJson
derive toExecutionResult
enum.execution_value_change.rs
Implement
DebugAsJson
forValueState
andDebug
forExecutionValueChange
src/eth/primitives/execution_value_change.rs
DebugAsJson
derive toValueState
enum.Debug
implementation forExecutionValueChange
.gas.rs
Implement `DebugAsJson` for `Gas` struct
src/eth/primitives/gas.rs
DebugAsJson
derive toGas
struct.hash.rs
Implement `DebugAsJson` for `Hash` struct
src/eth/primitives/hash.rs
DebugAsJson
derive toHash
struct.index.rs
Implement `DebugAsJson` for `Index` struct
src/eth/primitives/index.rs
DebugAsJson
derive toIndex
struct.log.rs
Implement `DebugAsJson` for `Log` struct
src/eth/primitives/log.rs
DebugAsJson
derive toLog
struct.log_mined.rs
Implement `DebugAsJson` for `LogMined` struct
src/eth/primitives/log_mined.rs
DebugAsJson
derive toLogMined
struct.log_topic.rs
Implement `DebugAsJson` for `LogTopic` struct
src/eth/primitives/log_topic.rs
DebugAsJson
derive toLogTopic
struct.miner_nonce.rs
Implement `DebugAsJson` for `MinerNonce` struct
src/eth/primitives/miner_nonce.rs
DebugAsJson
derive toMinerNonce
struct.nonce.rs
Implement `DebugAsJson` for `Nonce` struct
src/eth/primitives/nonce.rs
DebugAsJson
derive toNonce
struct.size.rs
Implement `DebugAsJson` for `Size` struct
src/eth/primitives/size.rs
DebugAsJson
derive toSize
struct.slot_index.rs
Implement
DebugAsJson
forSlotIndex
struct and remove customDebug
src/eth/primitives/slot_index.rs
DebugAsJson
derive toSlotIndex
struct.Debug
implementation forSlotIndex
.slot_value.rs
Implement `DebugAsJson` for `SlotValue` struct
src/eth/primitives/slot_value.rs
DebugAsJson
derive toSlotValue
struct.unix_time.rs
Implement `DebugAsJson` for `UnixTime` struct
src/eth/primitives/unix_time.rs
DebugAsJson
derive toUnixTime
struct.wei.rs
Implement `DebugAsJson` for `Wei` struct
src/eth/primitives/wei.rs
DebugAsJson
derive toWei
struct.1 files
ext.rs
Add `serde_debug_json` test macro
src/ext.rs
serde_debug_json
test macro to verify JSON serialization matchesDebug
output.