package fees import ( "math/big" "testing" "github.com/stretchr/testify/assert" ) func TestL1DataFeeBeforeCurie(t *testing.T) { l1BaseFee := new(big.Int).SetUint64(15000000) overhead := new(big.Int).SetUint64(100) scalar := new(big.Int).SetUint64(10) data := []byte{0, 10, 1, 0} expected := new(big.Int).SetUint64(30) // 30.6 actual := calculateEncodedL1DataFee(data, overhead, l1BaseFee, scalar) assert.Equal(t, expected, actual) } func TestL1DataFeeAfterCurie(t *testing.T) { l1BaseFee := new(big.Int).SetUint64(1500000000) l1BlobBaseFee := new(big.Int).SetUint64(150000000) commitScalar := new(big.Int).SetUint64(10) blobScalar := new(big.Int).SetUint64(10) data := []byte{0, 10, 1, 0} expected := new(big.Int).SetUint64(21) actual := calculateEncodedL1DataFeeCurie(data, l1BaseFee, l1BlobBaseFee, commitScalar, blobScalar) assert.Equal(t, expected, actual) }