Expose getSize to transaction interface (#5983)

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
pull/5980/head
Gabriel-Trintinalia 1 year ago committed by GitHub
parent 7ee5b736f3
commit 10b956f75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      datatypes/src/main/java/org/hyperledger/besu/datatypes/Transaction.java
  2. 1
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java

@ -219,4 +219,11 @@ public interface Transaction {
* @return the encoded transaction as Bytes
*/
Bytes encoded();
/**
* Returns the size in bytes of the encoded transaction.
*
* @return the size in bytes of the encoded transaction.
*/
int getSize();
}

@ -670,6 +670,7 @@ public class Transaction
*
* @return the size in bytes of the encoded transaction.
*/
@Override
public int getSize() {
if (size == -1) {
memoizeHashAndSize();

Loading…
Cancel
Save