reputation

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 6 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 NewFromMorph added in v0.28.0

func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Client, error)

NewFromMorph returns the wrapper instance from the raw morph client.

func (Client) ContractAddress added in v0.28.0

func (c Client) ContractAddress() util.Uint160

ContractAddress returns the address of the associated contract.

func (*Client) Get

func (c *Client) Get(p GetPrm) ([]reputation.GlobalTrust, error)

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

func (*Client) GetByID

func (c *Client) GetByID(p GetByIDPrm) ([]reputation.GlobalTrust, error)

GetByID invokes the call of "get reputation value by reputation id" method of reputation contract.

func (*Client) ListByEpoch

func (c *Client) ListByEpoch(p ListByEpochArgs) ([]ID, 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(p PutPrm) error

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

type GetByIDPrm added in v0.28.0

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

GetByIDPrm groups the arguments of "get reputation value by reputation id" test invocation.

func (*GetByIDPrm) SetID added in v0.28.0

func (g *GetByIDPrm) SetID(v ID)

SetID sets id of expected reputation value in reputation contract.

type GetPrm added in v0.28.0

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

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

func (*GetPrm) SetEpoch added in v0.28.0

func (g *GetPrm) SetEpoch(v uint64)

SetEpoch sets epoch of expected reputation value.

func (*GetPrm) SetPeerID added in v0.28.0

func (g *GetPrm) SetPeerID(v reputation.PeerID)

SetPeerID sets peer id of expected reputation value.

type ID added in v0.28.0

type ID []byte

ID is an ID of the reputation record in reputation contract.

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 Option

type Option func(*opts)

Option allows to set an optional parameter of ClientWrapper.

func AsAlphabet added in v0.28.0

func AsAlphabet() Option

AsAlphabet returns option to sign main TX of notary requests with client's private key.

Considered to be used by IR nodes only.

type PutPrm added in v0.28.0

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

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

func (*PutPrm) SetEpoch added in v0.28.0

func (p *PutPrm) SetEpoch(v uint64)

SetEpoch sets epoch of reputation value.

func (*PutPrm) SetPeerID added in v0.28.0

func (p *PutPrm) SetPeerID(v reputation.PeerID)

SetPeerID sets peer id of reputation value.

func (*PutPrm) SetValue added in v0.28.0

func (p *PutPrm) SetValue(v reputation.GlobalTrust)

SetValue sets reputation value.

Jump to

Keyboard shortcuts

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