|
|
|
@ -24,11 +24,10 @@ import org.hyperledger.besu.datatypes.TransactionType; |
|
|
|
|
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.PooledTransactionEncoderProvider; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.RlpPooledTransactionProvider; |
|
|
|
|
|
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.TransactionEncoderProvider; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.PooledTransactionDecoderProvider; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.encoding.registry.TransactionDecoderProvider; |
|
|
|
|
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; |
|
|
|
@ -75,9 +74,9 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txTo = |
|
|
|
|
preparedTx.to(Optional.of(Address.extract(Bytes32.random()))).createTransaction(KEYS1); |
|
|
|
|
BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); |
|
|
|
|
TransactionEncoderProvider.writeTo(txTo, rlpOut); |
|
|
|
|
RlpTransactionProvider.writeTo(txTo, rlpOut); |
|
|
|
|
|
|
|
|
|
txTo = TransactionDecoderProvider.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()); |
|
|
|
@ -121,7 +120,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txPayload = preparedTx.createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txPayload = |
|
|
|
|
TransactionDecoderProvider.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()); |
|
|
|
@ -210,10 +209,10 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), Wei.of(50), 10, 1); |
|
|
|
|
Transaction txBlob = preparedTx.createTransaction(KEYS1); |
|
|
|
|
BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); |
|
|
|
|
PooledTransactionEncoderProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
RlpPooledTransactionProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
|
|
|
|
|
txBlob = |
|
|
|
|
PooledTransactionDecoderProvider.readFrom( |
|
|
|
|
RlpPooledTransactionProvider.readFrom( |
|
|
|
|
new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txBlob.getSender()); |
|
|
|
@ -242,10 +241,10 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), Wei.of(50), 10, 1); |
|
|
|
|
Transaction txBlob = preparedTx.createTransaction(KEYS1); |
|
|
|
|
BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); |
|
|
|
|
PooledTransactionEncoderProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
RlpPooledTransactionProvider.writeTo(txBlob, rlpOut); |
|
|
|
|
|
|
|
|
|
txBlob = |
|
|
|
|
PooledTransactionDecoderProvider.readFrom( |
|
|
|
|
RlpPooledTransactionProvider.readFrom( |
|
|
|
|
new BytesValueRLPInput(rlpOut.encoded(), false)) |
|
|
|
|
.detachedCopy(); |
|
|
|
|
System.out.println(txBlob.getSender()); |
|
|
|
@ -272,7 +271,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txPayload = preparedTx.createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txPayload = |
|
|
|
|
TransactionDecoderProvider.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()); |
|
|
|
@ -302,7 +301,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txAccessList = preparedTx.accessList(ales).createTransaction(KEYS1); |
|
|
|
|
|
|
|
|
|
txAccessList = |
|
|
|
|
TransactionDecoderProvider.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()); |
|
|
|
@ -342,7 +341,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txEip1559 = createEIP1559Transaction(1, KEYS1, 10); |
|
|
|
|
|
|
|
|
|
txEip1559 = |
|
|
|
|
TransactionDecoderProvider.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()); |
|
|
|
@ -384,7 +383,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo |
|
|
|
|
Transaction txFrontier = createTransaction(TransactionType.FRONTIER, 1, Wei.of(500), 0, KEYS1); |
|
|
|
|
|
|
|
|
|
txFrontier = |
|
|
|
|
TransactionDecoderProvider.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()); |
|
|
|
|