frostfs-sdk-go/netmap/test/generate.go
Evgenii Stratonikov 369bd382b3 [#42] netmap: move package from neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-28 14:50:33 +03:00

37 lines
729 B
Go

package test
import "github.com/nspcc-dev/neofs-sdk-go/netmap"
// NetworkParameter returns random netmap.NetworkParameter.
func NetworkParameter() *netmap.NetworkParameter {
x := netmap.NewNetworkParameter()
x.SetKey([]byte("key"))
x.SetValue([]byte("value"))
return x
}
// NetworkConfig returns random netmap.NetworkConfig.
func NetworkConfig() *netmap.NetworkConfig {
x := netmap.NewNetworkConfig()
x.SetParameters(
NetworkParameter(),
NetworkParameter(),
)
return x
}
// NetworkInfo returns random netmap.NetworkInfo.
func NetworkInfo() *netmap.NetworkInfo {
x := netmap.NewNetworkInfo()
x.SetCurrentEpoch(21)
x.SetMagicNumber(32)
x.SetMsPerBlock(43)
x.SetNetworkConfig(NetworkConfig())
return x
}