package derive
import (
"math/big"
"math/rand"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-service/testutils"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
)
func RandomSingularBatch(rng *rand.Rand, txCount int, chainID *big.Int) *SingularBatch {
signer := types.NewLondonSigner(chainID)
baseFee := big.NewInt(rng.Int63n(300_000_000_000))
txsEncoded := make([]hexutil.Bytes, 0, txCount)
// force each tx to have equal chainID
for i := 0; i < txCount; i++ {
tx := testutils.RandomTx(rng, baseFee, signer)
txEncoded, err := tx.MarshalBinary()
if err != nil {
panic("tx Marshal binary" + err.Error())
}
txsEncoded = append(txsEncoded, txEncoded)
}
return &SingularBatch{
ParentHash: testutils.RandomHash(rng),
EpochNum: rollup.Epoch(1 + rng.Int63n(100_000_000)),
EpochHash: testutils.RandomHash(rng),
Timestamp: uint64(rng.Int63n(2_000_000_000)),
Transactions: txsEncoded,
}
}
-
Michael de Hoog authored
* chore: update to support geth v1.14.7 * Update geth * Fix "private key curve is not secp256k1" error * Temporarily quiet noisy logs * signature test * Add comments about S256 curve override fix * Update geth * go.mod: update to op-geth v1.101407.0-rc.1 * op-e2e: fix L1/L2 miner settings * Also update devnet L1 base image * ci: bump ci-builder in circleci --------- Co-authored-by:
Danyal Prout <me@dany.al> Co-authored-by:
protolambda <proto@protolambda.com> Co-authored-by:
Sebastian Stammler <seb@oplabs.co>
ca85dc42