From eac1eca178663fe83289cdefa927821c7d3ca515 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 17 Jan 2024 11:58:42 -0300 Subject: [PATCH] fix(cmd): nil pointer issue while creating genesis with runtime --- cmd/gossamer/commands/import_runtime.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/gossamer/commands/import_runtime.go b/cmd/gossamer/commands/import_runtime.go index 16d19577c7..262f38049d 100644 --- a/cmd/gossamer/commands/import_runtime.go +++ b/cmd/gossamer/commands/import_runtime.go @@ -69,6 +69,10 @@ func createGenesisWithRuntime(fp string, genesisSpecFilePath string) (string, er return "", err } + chainSpec.Genesis.Runtime = &genesis.Runtime{ + System: &genesis.System{}, + } + chainSpec.Genesis.Runtime.System.Code = fmt.Sprintf("0x%x", runtime) jsonSpec, err := json.MarshalIndent(chainSpec, "", "\t") if err != nil {