From b8ff52c729be10a31abfdd7fcfd70daf6af8eb69 Mon Sep 17 00:00:00 2001 From: phrwlk Date: Thu, 1 Jan 2026 22:31:40 +0200 Subject: [PATCH] core/vm/runtime: add test --- core/vm/runtime/runtime_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index a001d81623..40fb770454 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -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) {