[#42] netmap: move package from neofs-api-go

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-27 13:00:35 +03:00 committed by Alex Vanin
parent 1bd89bf797
commit 369bd382b3
24 changed files with 3881 additions and 0 deletions

37
netmap/test/generate.go Normal file
View file

@ -0,0 +1,37 @@
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
}