mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-22 19:19:09 +00:00
Merge pull request #3539 from nspcc-dev/netmode
netmode: add constant MainNetNeoFS and TestNetNeoFS
This commit is contained in:
commit
6651b683a0
3 changed files with 12 additions and 2 deletions
|
@ -129,9 +129,9 @@ func getEmbeddedConfig(configPath string) ([]byte, error) {
|
|||
return config.TestNet, nil
|
||||
case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.PrivNet):
|
||||
return config.PrivNet, nil
|
||||
case fmt.Sprintf("%s/protocol.mainnet.neofs.yml", DefaultConfigPath):
|
||||
case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.MainNetNeoFS):
|
||||
return config.MainNetNeoFS, nil
|
||||
case fmt.Sprintf("%s/protocol.testnet.neofs.yml", DefaultConfigPath):
|
||||
case fmt.Sprintf("%s/protocol.%s.yml", DefaultConfigPath, netmode.TestNetNeoFS):
|
||||
return config.TestNetNeoFS, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("config '%s' doesn't exist and no matching embedded config was found", configPath)
|
||||
|
|
|
@ -11,6 +11,10 @@ const (
|
|||
PrivNet Magic = 56753 // docker privnet
|
||||
// UnitTestNet is a stub magic code used for testing purposes.
|
||||
UnitTestNet Magic = 42
|
||||
//MainNetNeoFS contains magic code used in the NeoFS main network.
|
||||
MainNetNeoFS Magic = 0x572dfa5 // NeoFS mainnet
|
||||
//TestNetNeoFS contains magic code used in the NeoFS test network.
|
||||
TestNetNeoFS Magic = 0x2bdb2b5f // NeoFS testnet
|
||||
)
|
||||
|
||||
// Magic describes the network the blockchain will operate on.
|
||||
|
@ -27,6 +31,10 @@ func (n Magic) String() string {
|
|||
return "mainnet"
|
||||
case UnitTestNet:
|
||||
return "unit_testnet"
|
||||
case MainNetNeoFS:
|
||||
return "mainnet.neofs"
|
||||
case TestNetNeoFS:
|
||||
return "testnet.neofs"
|
||||
default:
|
||||
return "net 0x" + strconv.FormatUint(uint64(n), 16)
|
||||
}
|
||||
|
|
|
@ -1197,6 +1197,8 @@ func TestConfig_LoadDefaultConfigs(t *testing.T) {
|
|||
netmode.PrivNet,
|
||||
netmode.TestNet,
|
||||
netmode.UnitTestNet,
|
||||
netmode.MainNetNeoFS,
|
||||
netmode.TestNetNeoFS,
|
||||
"privnet.docker.one",
|
||||
"privnet.docker.two",
|
||||
"privnet.docker.three",
|
||||
|
|
Loading…
Reference in a new issue