Skip to content

Commit

Permalink
Add javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
  • Loading branch information
Gabriel-Trintinalia committed Sep 4, 2023
1 parent a877c99 commit b678893
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@

import java.util.List;

/**
* Class responsible for decoding blob transactions from the transaction pool. Blob transactions
* have two network representations. During transaction gossip responses (PooledTransactions), the
* EIP-2718 TransactionPayload of the blob transaction is wrapped to become: rlp([tx_payload_body,
* blobs, commitments, proofs]).
*/
public class BlobPooledTransactionDecoder {

/**
* Decodes a blob transaction from the provided RLP input.
*
* @param input the RLP input to decode
* @return the decoded transaction
*/
public static Transaction decode(final RLPInput input) {
input.enterList();
final Transaction.Builder builder = Transaction.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public class BlobTransactionDecoder {
private static final Supplier<SignatureAlgorithm> SIGNATURE_ALGORITHM =
Suppliers.memoize(SignatureAlgorithmFactory::getInstance);

/*
* [chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data,
* access_list, max_fee_per_blob_gas, blob_versioned_hashes, y_parity, r, s]
/**
* Decodes a blob transaction from the provided RLP input.
*
* @param input the RLP input to decode
* @return the decoded transaction
*/
public static Transaction decode(final RLPInput input) {
Transaction transaction;
Expand All @@ -50,6 +52,15 @@ private static Transaction readTransactionPayload(final RLPInput input) {
return builder.build();
}

/**
* Reads the payload of a blob transaction from the provided RLP input.
*
* <p>[chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data,
* access_list, max_fee_per_blob_gas, blob_versioned_hashes, y_parity, r, s]
*
* @param builder the transaction builder
* @param input the RLP input to read from
*/
static void readTransactionPayloadInner(final Transaction.Builder builder, final RLPInput input) {
builder
.type(TransactionType.BLOB)
Expand Down

0 comments on commit b678893

Please sign in to comment.