Skip to content

Commit

Permalink
Improve naming in test
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisPH3 committed Nov 13, 2024
1 parent d3155fe commit b74b0b6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/transaction_gas_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ func TestTransactionGasPrice(t *testing.T) {
})
})

t.Run("EIP-1559 transaction max gas price", func(t *testing.T) {
t.Run("EIP-1559 transaction no tip", func(t *testing.T) {

// This test:
// 1. Compute a valid maximum gas price
// 2. Sends an EIP-1559 transaction with specified gas price (max fee)
// 3. Checks:
// - effective gas price is greater or equal than basefee
// - subtracted balance equals gas price * gas used + value transferred
// - effective gas price is equal to the basefee
// - subtracted balance equals gas price * gas used + value transferred

balanceBefore := getBalance(t, client, account.Address())

Expand All @@ -110,7 +109,7 @@ func TestTransactionGasPrice(t *testing.T) {
basefeeAfter := getBaseFee(t, client)

// 3: checks
t.Run("Transaction gas price X; BaseFee <= X <= maxGasPrice", func(t *testing.T) {
t.Run("BaseFee <= EffectiveGasPrice <= maxGasPrice", func(t *testing.T) {

require.LessOrEqual(t,
basefeeAfter, receipt.EffectiveGasPrice.Int64(),
Expand Down Expand Up @@ -173,7 +172,7 @@ func TestTransactionGasPrice(t *testing.T) {
basefeeAfter := getBaseFee(t, client)

// 3: checks
t.Run("Transaction gas price X; BaseFee <= X <= maxGasPrice ", func(t *testing.T) {
t.Run("BaseFee <= EffectiveGasPrice <= maxGasPrice ", func(t *testing.T) {

require.LessOrEqual(t,
basefeeAfter, receipt.EffectiveGasPrice.Int64(),
Expand Down Expand Up @@ -233,7 +232,7 @@ func TestTransactionGasPrice(t *testing.T) {
basefeeAfter := getBaseFee(t, client)

// 3: checks
t.Run("Transaction gas price X; BaseFee <= X <= maxGasPrice ", func(t *testing.T) {
t.Run("BaseFee <= EffectiveGasPrice <= maxGasPrice ", func(t *testing.T) {

require.LessOrEqual(t,
basefeeAfter, receipt.EffectiveGasPrice.Int64(),
Expand Down

0 comments on commit b74b0b6

Please sign in to comment.