From 92ca53e5208a62fdb06a0df2ec3a4cc245df6c8a Mon Sep 17 00:00:00 2001 From: Stefan Pingel <16143240+pinges@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:06:08 +1000 Subject: [PATCH] add versioned hashes and number of blobs to toString() (#5831) Signed-off-by: Stefan --- .../besu/ethereum/core/Transaction.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java index e04d036c73..827c9241b5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java @@ -1091,10 +1091,26 @@ public class Transaction sb.append("value=").append(getValue()).append(", "); sb.append("sig=").append(getSignature()).append(", "); if (chainId.isPresent()) sb.append("chainId=").append(getChainId().get()).append(", "); - sb.append("payload=").append(getPayload()); if (transactionType.equals(TransactionType.ACCESS_LIST)) { - sb.append(", ").append("accessList=").append(maybeAccessList); + sb.append("accessList=").append(maybeAccessList).append(", "); + } + if (versionedHashes.isPresent()) { + final List vhs = versionedHashes.get(); + if (!vhs.isEmpty()) { + sb.append("versionedHashes=["); + sb.append( + vhs.get(0) + .toString()); // can't be empty if present, as this is checked in the constructor + for (int i = 1; i < vhs.size(); i++) { + sb.append(", ").append(vhs.get(i).toString()); + } + sb.append("], "); + } } + if (transactionType.supportsBlob() && this.blobsWithCommitments.isPresent()) { + sb.append("numberOfBlobs=").append(blobsWithCommitments.get().getBlobs().size()).append(", "); + } + sb.append("payload=").append(getPayload()); return sb.append("}").toString(); }