github.com/cryptotooltop/go-ethereum@v0.0.0-20231103184714-151d1922f3e5/rollup/fees/rollup_fee_test.go (about)

     1  package fees
     2  
     3  import (
     4  	"math/big"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestCalculateEncodedL1DataFee(t *testing.T) {
    11  	l1BaseFee := new(big.Int).SetUint64(15000000)
    12  
    13  	data := []byte{0, 10, 1, 0}
    14  	overhead := new(big.Int).SetUint64(100)
    15  	scalar := new(big.Int).SetUint64(10)
    16  
    17  	expected := new(big.Int).SetUint64(184) // 184.2
    18  	actual := calculateEncodedL1DataFee(data, overhead, l1BaseFee, scalar)
    19  	assert.Equal(t, expected, actual)
    20  }