test

package
v1.0.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tests provides special help functions for testing NeoFS API and its environment.

All functions accepting `t *testing.T` that emphasize there are only for tests purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomSigner

func RandomSigner(tb testing.TB) neofscrypto.Signer

RandomSigner return neofscrypto.Signer ONLY for TESTs purposes. It may be used like helper to get new neofscrypto.Signer if you need it in yours tests.

func RandomSignerRFC6979

func RandomSignerRFC6979(tb testing.TB) user.Signer

RandomSignerRFC6979 return user.Signer ONLY for TESTs purposes. It may be used like helper to get new user.Signer if you need it in yours tests.

func SignedDataComponent

func SignedDataComponent(tb testing.TB, signer neofscrypto.Signer, cmp SignedComponent)

SignedDataComponent tests SignedComponent for valid data generation by SignedData function.

func SignedDataComponentUser

func SignedDataComponentUser(tb testing.TB, signer user.Signer, cmp SignedComponentUserSigner)

SignedDataComponentUser tests SignedComponentUserSigner for valid data generation by SignedData function.

Types

type SignedComponent

type SignedComponent interface {
	SignedData() []byte
	Sign(neofscrypto.Signer) error
	VerifySignature() bool
}

SignedComponent describes component which can signed and the signature may be verified.

type SignedComponentUserSigner

type SignedComponentUserSigner interface {
	SignedData() []byte
	Sign(user.Signer) error
	VerifySignature() bool
}

SignedComponentUserSigner is the same as SignedComponent but uses user.Signer instead of neofscrypto.Signer. It helps to cover all cases.

Jump to

Keyboard shortcuts

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