reputation

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 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 FrostFS 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

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

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

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.

If TryNotary is provided, calls notary contract.

type GetByIDPrm

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

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

func (*GetByIDPrm) SetID

func (g *GetByIDPrm) SetID(v ID)

SetID sets id of expected reputation value in reputation contract.

type GetPrm

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

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

func (*GetPrm) SetEpoch

func (g *GetPrm) SetEpoch(v uint64)

SetEpoch sets epoch of expected reputation value.

func (*GetPrm) SetPeerID

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

SetPeerID sets peer id of expected reputation value.

type ID

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

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.

func TryNotary

func TryNotary() Option

TryNotary returns option to enable notary invocation tries.

type PutPrm

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

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

func (*PutPrm) SetEpoch

func (p *PutPrm) SetEpoch(v uint64)

SetEpoch sets epoch of reputation value.

func (*PutPrm) SetPeerID

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

SetPeerID sets peer id of reputation value.

func (*PutPrm) SetValue

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