config: add UnitTestNet configuration to embed configs

Tests should use embed config too.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-11-22 11:37:52 +03:00
parent cdbc026c27
commit 8fe2ae8437
2 changed files with 7 additions and 0 deletions

View file

@ -30,3 +30,8 @@ var MainNetNeoFS []byte
// //
//go:embed protocol.testnet.neofs.yml //go:embed protocol.testnet.neofs.yml
var TestNetNeoFS []byte var TestNetNeoFS []byte
// UnitTestNet is the unit test network configuration.
//
//go:embed protocol.unit_testnet.yml
var UnitTestNet []byte

View file

@ -137,6 +137,8 @@ func getEmbeddedConfig(configPath string) ([]byte, error) {
return config.MainNetNeoFS, nil return config.MainNetNeoFS, nil
case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.TestNetNeoFS): case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.TestNetNeoFS):
return config.TestNetNeoFS, nil return config.TestNetNeoFS, nil
case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.UnitTestNet):
return config.UnitTestNet, nil
default: default:
return nil, fmt.Errorf("config '%s' doesn't exist and no matching embedded config was found", configPath) return nil, fmt.Errorf("config '%s' doesn't exist and no matching embedded config was found", configPath)
} }