use of org.hyperledger.besu.ethereum.core.Transaction in project besu by hyperledger.
the class TransactionDecoderTest method decodeEIP1559NominalCase.
@Test
void decodeEIP1559NominalCase() {
final Transaction transaction = TransactionDecoder.decodeForWire(RLP.input(Bytes.fromHexString(EIP1559_TX_RLP)));
assertThat(transaction).isNotNull();
assertThat(transaction.getMaxPriorityFeePerGas()).hasValue(Wei.of(2L));
assertThat(transaction.getMaxFeePerGas()).hasValue(Wei.of(new BigInteger("5000000000", 10)));
}
use of org.hyperledger.besu.ethereum.core.Transaction in project besu by hyperledger.
the class TransactionDecoderTest method shouldDecodeWithHighNonce.
@Test
void shouldDecodeWithHighNonce() {
final Transaction transaction = TransactionDecoder.decodeForWire(RLP.input(Bytes.fromHexString(NONCE_64_BIT_MAX_MINUS_2_TX_RLP)));
assertThat(transaction).isNotNull();
assertThat(transaction.getNonce()).isEqualTo(MAX_NONCE - 1);
}
use of org.hyperledger.besu.ethereum.core.Transaction in project besu by hyperledger.
the class TransactionDecoderTest method decodeGoQuorumPrivateTransactionRlp.
@Test
void decodeGoQuorumPrivateTransactionRlp() {
boolean goQuorumCompatibilityMode = true;
RLPInput input = RLP.input(Bytes.fromHexString(GOQUORUM_PRIVATE_TX_RLP));
final Transaction transaction = TransactionDecoder.decodeForWire(input, goQuorumCompatibilityMode);
assertThat(transaction).isNotNull();
assertThat(transaction.getV()).isEqualTo(38);
assertThat(transaction.getSender()).isEqualByComparingTo(Address.fromHexString("0xed9d02e382b34818e88b88a309c7fe71e65f419d"));
}
use of org.hyperledger.besu.ethereum.core.Transaction in project besu by hyperledger.
the class TransactionEncoderTest method shouldEncodeWithHighNonce.
@Test
void shouldEncodeWithHighNonce() {
final Transaction transaction = TransactionDecoder.decodeForWire(RLP.input(Bytes.fromHexString(NONCE_64_BIT_MAX_MINUS_2_TX_RLP)));
final BytesValueRLPOutput output = new BytesValueRLPOutput();
TransactionEncoder.encodeForWire(transaction, output);
assertThat(output.encoded().toHexString()).isEqualTo(NONCE_64_BIT_MAX_MINUS_2_TX_RLP);
}
use of org.hyperledger.besu.ethereum.core.Transaction in project besu by hyperledger.
the class AccountLocalConfigPermissioningControllerTest method isPermittedShouldReturnFalseIfTransactionDoesNotContainSender.
@Test
public void isPermittedShouldReturnFalseIfTransactionDoesNotContainSender() {
final Transaction transactionWithoutSender = mock(Transaction.class);
when(transactionWithoutSender.getSender()).thenReturn(null);
verifyCountersUntouched();
boolean permitted = controller.isPermitted(transactionWithoutSender);
assertThat(permitted).isFalse();
verifyCountersUnpermitted();
}
Aggregations