reputation

package
v0.27.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

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) Get

func (c *Client) Get(args GetArgs) (*GetResult, error)

Get invokes the call of "get reputation value" method of reputation contract.

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.

func (Client) Morph added in v0.25.0

func (c Client) Morph() *client.Client

Morph returns raw morph client.

func (*Client) Put

func (c *Client) Put(args PutArgs) error

Put invokes direct call of "put reputation value" method of reputation contract.

type GetArgs

type GetArgs struct {
	// contains filtered or unexported fields
}

GetArgs groups the arguments of "get reputation value" test invocation.

func (*GetArgs) SetEpoch

func (g *GetArgs) SetEpoch(v uint64)

SetEpoch sets epoch of expected reputation value.

func (*GetArgs) SetPeerID

func (g *GetArgs) SetPeerID(v []byte)

SetPeerID sets peer id of expected reputation value.

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

func (g GetResult) Reputations() [][]byte

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

func WithGetByIDMethod(n string) Option

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

func WithGetMethod(n string) Option

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

func WithListByEpochDMethod(n string) Option

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

func WithPutMethod(n string) Option

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.

type PutArgs

type PutArgs struct {
	// contains filtered or unexported fields
}

PutArgs groups the arguments of "put reputation value" invocation call.

func (*PutArgs) SetEpoch

func (p *PutArgs) SetEpoch(v uint64)

SetEpoch sets epoch of reputation value.

func (*PutArgs) SetPeerID

func (p *PutArgs) SetPeerID(v []byte)

SetPeerID sets peer id of reputation value.

func (*PutArgs) SetValue

func (p *PutArgs) SetValue(v []byte)

SetValue sets marshaled reputation value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL