mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
netmode: add constant MainNetNeoFS and TestNetNeoFS
Extend netmode package with NeoFS chains IDs. Close #3503 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
d8e3e57f88
commit
ef20ba3701
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