Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper over StaticClient which makes calls with the names and arguments of the NeoFS reputation contract.
Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.
func New ¶
func New(c *client.StaticClient, opts ...Option) (*Client, error)
New creates, initializes and returns the Client instance.
If StaticClient is nil, client.ErrNilStaticClient is returned.
Other values are set according to provided options, or by default.
If desired option satisfies the default value, it can be omitted. If multiple options of the same config value are supplied, the option with the highest index in the arguments will be used.
func (*Client) GetByID ¶
func (c *Client) GetByID(args GetByIDArgs) (*GetResult, error)
GetByID invokes the call of "get reputation value by reputation id" method of reputation contract.
func (*Client) ListByEpoch ¶
func (c *Client) ListByEpoch(args ListByEpochArgs) (*ListByEpochResult, error)
ListByEpoch invokes the call of "list reputation ids by epoch" method of reputation contract.
type GetArgs ¶
type GetArgs struct {
// contains filtered or unexported fields
}
GetArgs groups the arguments of "get reputation value" test invocation.
type GetByIDArgs ¶
type GetByIDArgs struct {
// contains filtered or unexported fields
}
GetByIDArgs groups the arguments of "get reputation value by reputation id" test invocation.
func (*GetByIDArgs) SetID ¶
func (g *GetByIDArgs) SetID(v []byte)
SetID sets id of expected reputation value in reputation contract.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult groups the stack parameters returned by "get" and "get by id" test invocations.
func (GetResult) Reputations ¶
Reputations returns slice of marshalled reputation values.
type ListByEpochArgs ¶
type ListByEpochArgs struct {
// contains filtered or unexported fields
}
ListByEpochArgs groups the arguments of "list reputation ids by epoch" test invoke call.
func (*ListByEpochArgs) SetEpoch ¶
func (l *ListByEpochArgs) SetEpoch(v uint64)
SetEpoch sets epoch of expected reputation ids.
type ListByEpochResult ¶
type ListByEpochResult struct {
// contains filtered or unexported fields
}
ListByEpochResult groups the stack parameters returned by "list reputation ids by epoch" test invoke.
func (ListByEpochResult) IDs ¶
func (l ListByEpochResult) IDs() [][]byte
IDs returns slice of reputation id values.
type Option ¶
type Option func(*cfg)
Option is a client configuration change function.
func WithGetByIDMethod ¶
WithGetByIDMethod returns a client constructor option that specifies the method name to get reputation value by it's ID in the contract.
Ignores empty value.
If option not provided, "getByID" is used.
func WithGetMethod ¶
WithGetMethod returns a client constructor option that specifies the method name to get reputation value.
Ignores empty value.
If option not provided, "get" is used.
func WithListByEpochDMethod ¶
WithListByEpochMethod returns a client constructor option that specifies the method name to list reputation value IDs for certain epoch.
Ignores empty value.
If option not provided, "listByEpoch" is used.
func WithPutMethod ¶
WithPutMethod returns a client constructor option that specifies the method name to put reputation value.
Ignores empty value.
If option not provided, "put" is used.