[#50] Replace interface{} with any

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-11-07 15:18:48 +03:00
parent dacac0b53d
commit d890a7eba4
25 changed files with 103 additions and 103 deletions

View file

@ -66,7 +66,7 @@ var (
)
// _deploy function sets up initial list of inner ring public keys.
func _deploy(data interface{}, isUpdate bool) {
func _deploy(data any, isUpdate bool) {
ctx := storage.GetContext()
args := data.(struct {
@ -117,7 +117,7 @@ func _deploy(data interface{}, isUpdate bool) {
// Update method updates contract source code and manifest. It can be invoked
// only by committee.
func Update(script []byte, manifest []byte, data interface{}) {
func Update(script []byte, manifest []byte, data any) {
if !common.HasUpdateAccess() {
panic("only committee can update contract")
}
@ -426,7 +426,7 @@ func SnapshotByEpoch(epoch int) []Node {
// Config returns configuration value of FrostFS configuration. If key does
// not exists, returns nil.
func Config(key []byte) interface{} {
func Config(key []byte) any {
ctx := storage.GetReadOnlyContext()
return getConfig(ctx, key)
}
@ -538,14 +538,14 @@ func getSnapshot(ctx storage.Context, key string) []Node {
return []Node{}
}
func getConfig(ctx storage.Context, key interface{}) interface{} {
func getConfig(ctx storage.Context, key any) interface{} {
postfix := key.([]byte)
storageKey := append(configPrefix, postfix...)
return storage.Get(ctx, storageKey)
}
func setConfig(ctx storage.Context, key, val interface{}) {
func setConfig(ctx storage.Context, key, val any) {
postfix := key.([]byte)
storageKey := append(configPrefix, postfix...)