mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
Merge b8ff52c729 into 406a852ec8
This commit is contained in:
commit
8c5675ba55
2 changed files with 18 additions and 1 deletions
|
|
@ -109,7 +109,9 @@ func setDefaults(cfg *Config) {
|
|||
if cfg.BlobBaseFee == nil {
|
||||
cfg.BlobBaseFee = big.NewInt(params.BlobTxMinBlobGasprice)
|
||||
}
|
||||
cfg.Random = &(common.Hash{})
|
||||
if cfg.Random == nil {
|
||||
cfg.Random = new(common.Hash)
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the code using the input as call data during the execution.
|
||||
|
|
|
|||
|
|
@ -65,6 +65,21 @@ func TestDefaults(t *testing.T) {
|
|||
if cfg.BlockNumber == nil {
|
||||
t.Error("expected block number to be non nil")
|
||||
}
|
||||
if cfg.Random == nil {
|
||||
t.Error("expected Random to be non nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultsPreserveRandom(t *testing.T) {
|
||||
h := common.HexToHash("0x01")
|
||||
cfg := &Config{Random: &h}
|
||||
setDefaults(cfg)
|
||||
if cfg.Random == nil {
|
||||
t.Fatal("expected Random to remain non-nil")
|
||||
}
|
||||
if *cfg.Random != h {
|
||||
t.Fatalf("expected Random to be preserved, got %x, want %x", *cfg.Random, h)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEVM(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue