|
|
|
@ -42,14 +42,14 @@ public class CoinbaseFeePriceCalculatorTest { |
|
|
|
|
private final Gas coinbaseFee; |
|
|
|
|
private final Wei transactionGasPrice; |
|
|
|
|
private final Optional<Long> baseFee; |
|
|
|
|
private final Wei expectedPrice; |
|
|
|
|
private final long expectedPrice; |
|
|
|
|
|
|
|
|
|
public CoinbaseFeePriceCalculatorTest( |
|
|
|
|
final CoinbaseFeePriceCalculator coinbaseFeePriceCalculator, |
|
|
|
|
final Gas coinbaseFee, |
|
|
|
|
final Wei transactionGasPrice, |
|
|
|
|
final Optional<Long> baseFee, |
|
|
|
|
final Wei expectedPrice) { |
|
|
|
|
final long expectedPrice) { |
|
|
|
|
this.coinbaseFeePriceCalculator = coinbaseFeePriceCalculator; |
|
|
|
|
this.coinbaseFee = coinbaseFee; |
|
|
|
|
this.transactionGasPrice = transactionGasPrice; |
|
|
|
@ -62,9 +62,11 @@ public class CoinbaseFeePriceCalculatorTest { |
|
|
|
|
return Arrays.asList( |
|
|
|
|
new Object[][] { |
|
|
|
|
// legacy transaction must return gas price * gas
|
|
|
|
|
{FRONTIER_CALCULATOR, Gas.of(100), Wei.of(10L), Optional.empty(), Wei.of(1000L)}, |
|
|
|
|
{FRONTIER_CALCULATOR, Gas.of(100), Wei.of(10L), Optional.empty(), 1000L}, |
|
|
|
|
// EIP-1559 must return gas * (gas price - base fee)
|
|
|
|
|
{EIP_1559_CALCULATOR, Gas.of(100), Wei.of(10L), Optional.of(4L), Wei.of(600L)} |
|
|
|
|
{EIP_1559_CALCULATOR, Gas.of(100), Wei.of(10L), Optional.of(4L), 600L}, |
|
|
|
|
// Negative transaction gas price case
|
|
|
|
|
{EIP_1559_CALCULATOR, Gas.of(100), Wei.of(95L), Optional.of(100L), -500L} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|