From 8fe2ae843727d52c3527b04e412582f14d50d072 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Fri, 22 Nov 2024 11:37:52 +0300 Subject: [PATCH] config: add UnitTestNet configuration to embed configs Tests should use embed config too. Signed-off-by: Ekaterina Pavlova --- config/config_embed.go | 5 +++++ pkg/config/config.go | 2 ++ 2 files changed, 7 insertions(+) diff --git a/config/config_embed.go b/config/config_embed.go index c1f66676f0..5e1a04874e 100644 --- a/config/config_embed.go +++ b/config/config_embed.go @@ -30,3 +30,8 @@ var MainNetNeoFS []byte // //go:embed protocol.testnet.neofs.yml var TestNetNeoFS []byte + +// UnitTestNet is the unit test network configuration. +// +//go:embed protocol.unit_testnet.yml +var UnitTestNet []byte diff --git a/pkg/config/config.go b/pkg/config/config.go index 0278614333..ac8bc5d7be 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -137,6 +137,8 @@ func getEmbeddedConfig(configPath string) ([]byte, error) { return config.MainNetNeoFS, nil case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.TestNetNeoFS): return config.TestNetNeoFS, nil + case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.UnitTestNet): + return config.UnitTestNet, nil default: return nil, fmt.Errorf("config '%s' doesn't exist and no matching embedded config was found", configPath) }