mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
* update rollup/rcfg/config.go * update consensus/misc/curie.go * update rollup/fees/rollup_fee_test.go * update rollup/fees/rollup_fee.go * update rollup/tracing/tracing.go * update tests/state_test_util.go * update light/txpool.go * fix some * update eth/tracers/internal/tracetest/prestate_test.go * update eth/tracers/api.go * update core/chain_makers.go * update core/state_processor.go * update cmd/evm/internal/t8ntool/execution.go * update txpool * update ethclient/ethclient_test.go * update ethclient/gethclient/gethclient_test.go * update core/blockchain_test.go * update miner/worker.go * update txpool 2
33 lines
889 B
Go
33 lines
889 B
Go
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)
|
|
}
|