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 ¶
- func RandomSigner(tb testing.TB) neofscrypto.Signer
- func RandomSignerRFC6979(tb testing.TB) user.Signer
- func SignedDataComponent(tb testing.TB, signer neofscrypto.Signer, cmp SignedComponent)
- func SignedDataComponentUser(tb testing.TB, signer user.Signer, cmp SignedComponentUserSigner)
- type SignedComponent
- type SignedComponentUserSigner
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 ¶
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.