Skip to content

Commit

Permalink
config: add UnitTestNet configuration to embed configs
Browse files Browse the repository at this point in the history
Tests should use embed config too.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
  • Loading branch information
AliceInHunterland committed Nov 22, 2024
1 parent cdbc026 commit 8fe2ae8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/config_embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8fe2ae8

Please sign in to comment.