wrapper

package
v0.27.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientWrapper

type ClientWrapper struct {
	internal.StaticClient
	// contains filtered or unexported fields
}

ClientWrapper is a wrapper over reputation contract client which implements storage of reputation values.

func NewFromMorph added in v0.21.0

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

NewFromMorph returns the wrapper instance from the raw morph client.

func (*ClientWrapper) Get

func (w *ClientWrapper) Get(v GetArgs) (*GetResult, error)

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

func (*ClientWrapper) GetByID

func (w *ClientWrapper) GetByID(v GetByIDArgs) (*GetResult, error)

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

func (*ClientWrapper) ListByEpoch

func (w *ClientWrapper) ListByEpoch(v ListByEpochArgs) (*ListByEpochResult, error)

ListByEpoch invokes the call of "list reputation ids by epoch" method of reputation contract.

func (ClientWrapper) Morph added in v0.25.0

func (w ClientWrapper) Morph() *client.Client

Morph returns raw morph client.

func (*ClientWrapper) Put

func (w *ClientWrapper) Put(v PutArgs) error

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

If TryNotary is provided, calls notary 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 reputation.PeerID)

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

SetID sets id of expected reputation value in reputation contract.

type GetResult

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

GetResult groups the result of "get reputation value" and "get reputation value by reputation id" test invocations.

func (GetResult) Reputations

func (g GetResult) Reputations() []reputation.GlobalTrust

Reputations returns slice of 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 result of "list reputation ids by epoch" test invoke.

func (ListByEpochResult) IDs

func (l ListByEpochResult) IDs() []ReputationID

IDs returns slice of reputation id values.

type Option added in v0.21.0

type Option func(*opts)

Option allows to set an optional parameter of ClientWrapper.

func AsAlphabet added in v0.25.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.

func TryNotary added in v0.21.0

func TryNotary() Option

TryNotary returns option to enable notary invocation tries.

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 reputation.PeerID)

SetPeerID sets peer id of reputation value.

func (*PutArgs) SetValue

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

SetValue sets reputation value.

type ReputationID

type ReputationID []byte

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

Jump to

Keyboard shortcuts

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