2021-04-18 08:51:49 +00:00
|
|
|
package local
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2021-04-21 04:56:38 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/reputation/common"
|
2021-04-18 08:51:49 +00:00
|
|
|
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
|
|
|
|
)
|
|
|
|
|
|
|
|
type EpochContext struct {
|
|
|
|
context.Context
|
|
|
|
E uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ctx *EpochContext) Epoch() uint64 {
|
|
|
|
return ctx.E
|
|
|
|
}
|
|
|
|
|
|
|
|
type NopReputationWriter struct{}
|
|
|
|
|
2021-04-21 04:56:38 +00:00
|
|
|
func (NopReputationWriter) Write(common.Context, reputation.Trust) error {
|
2021-04-18 08:51:49 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NopReputationWriter) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type OnlyKeyRemoteServerInfo struct {
|
|
|
|
Key []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *OnlyKeyRemoteServerInfo) PublicKey() []byte {
|
|
|
|
return i.Key
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*OnlyKeyRemoteServerInfo) Address() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
const invalidPrmValFmt = "invalid parameter %s (%T):%v"
|
|
|
|
|
|
|
|
func panicOnPrmValue(n string, v interface{}) {
|
|
|
|
panic(fmt.Sprintf(invalidPrmValFmt, n, v, v))
|
|
|
|
}
|