|
|
|
@ -25,9 +25,7 @@ import org.hyperledger.besu.datatypes.Wei; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.Transaction; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.TransactionTestFixture; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.RlpPooledTransactionProvider; |
|
|
|
|
|
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.RlpTransactionProvider; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.RlpPooledTransactionProvider; |
|
|
|
|
import org.hyperledger.besu.ethereum.eth.transactions.layered.BaseTransactionPoolTest; |
|
|
|
|
import org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput; |
|
|
|
|
import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; |
|
|
|
@ -76,7 +74,9 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); |
|
|
|
|
RlpTransactionProvider.writeTo(txTo, rlpOut); |
|
|
|
|
|
|
|
|
|
txTo = RlpTransactionProvider.readFrom(new BytesValueRLPInput(rlpOut.encoded(), false)).detachedCopy(); |
|
|
|
|
txTo = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txTo.getSender()); |
|
|
|
|
System.out.println(txTo.getHash()); |
|
|
|
|
System.out.println(txTo.getSize()); |
|
|
|
@ -120,7 +120,8 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txPayload = preparedTx.createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txPayload = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txPayload.encoded(), false)).detachedCopy(); |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txPayload.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txPayload.getSender()); |
|
|
|
|
System.out.println(txPayload.getHash()); |
|
|
|
|
System.out.println(txPayload.getSize()); |
|
|
|
@ -212,8 +213,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
RlpPooledTransactionProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
|
|
|
|
|
txBlob = |
|
|
|
|
RlpPooledTransactionProvider.readFrom( |
|
|
|
|
new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
RlpPooledTransactionProvider.readFrom(new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txBlob.getSender()); |
|
|
|
|
System.out.println(txBlob.getHash()); |
|
|
|
@ -244,8 +244,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
RlpPooledTransactionProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
|
|
|
|
|
txBlob = |
|
|
|
|
RlpPooledTransactionProvider.readFrom( |
|
|
|
|
new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
RlpPooledTransactionProvider.readFrom(new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txBlob.getSender()); |
|
|
|
|
System.out.println(txBlob.getHash()); |
|
|
|
@ -271,7 +270,8 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txPayload = preparedTx.createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txPayload = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txPayload.encoded(), false)).detachedCopy(); |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txPayload.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txPayload.getSender()); |
|
|
|
|
System.out.println(txPayload.getHash()); |
|
|
|
|
System.out.println(txPayload.getSize()); |
|
|
|
@ -301,7 +301,8 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txAccessList = preparedTx.accessList(ales).createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txAccessList = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txAccessList.encoded(), false)).detachedCopy(); |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txAccessList.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txAccessList.getSender()); |
|
|
|
|
System.out.println(txAccessList.getHash()); |
|
|
|
|
System.out.println(txAccessList.getSize()); |
|
|
|
@ -341,7 +342,8 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txEip1559 = createEIP1559Transaction(1, KEYS1, 10); |
|
|
|
|
|
|
|
|
|
txEip1559 = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txEip1559.encoded(), false)).detachedCopy(); |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txEip1559.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txEip1559.getSender()); |
|
|
|
|
System.out.println(txEip1559.getHash()); |
|
|
|
|
System.out.println(txEip1559.getSize()); |
|
|
|
@ -383,7 +385,8 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txFrontier = createTransaction(TransactionType.FRONTIER, 1, Wei.of(500), 0, KEYS1); |
|
|
|
|
|
|
|
|
|
txFrontier = |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txFrontier.encoded(), false)).detachedCopy(); |
|
|
|
|
RlpTransactionProvider.readFrom(new BytesValueRLPInput(txFrontier.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txFrontier.getSender()); |
|
|
|
|
System.out.println(txFrontier.getHash()); |
|
|
|
|
System.out.println(txFrontier.getSize()); |
|
|
|
|