mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-18 13:57:34 +00:00
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:
parent
cdbc026c27
commit
8fe2ae8437
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue