ntesting

package
v0.0.0-...-7107d2d Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestUser

func CreateTestUser(_ context.Context, ciData CiTestData, userID string) (*wallet.User, error)

CreateTestUser creates new user in ACL. It takes context, CiTestData and user ID. Returns new user and not nil err if user isn't created.

func EmitFiat

func EmitFiat(ctx context.Context, fiatOwner, u *wallet.User, amount uint64, ch, cc string) (string, error)

EmitFiat emits 'amount' fiats to the user 'u' using passed 'fiatOwner' in channel "ch" and chaincode "cc". Returns tx ID string and err (not nil) if emit operation failed. WARN calling this function several times during the formation of one block can lead to conflicts on some stands.

func GetBalance

func GetBalance(_ context.Context, user *wallet.User, channelName, chainCodeName string) (uint64, error)

GetBalance returns balance of user.

func GetCcOwner

func GetCcOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)

GetCcOwner returns ccOwner of user.

func GetFiatOwner

func GetFiatOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)

GetFiatOwner returns fiatOwner of user.

func GetIndustrialOwner

func GetIndustrialOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)

GetIndustrialOwner returns industrialOwner of user.

func ParseBalance

func ParseBalance(balanceResponse []byte) (uint64, error)

ParseBalance parses chaincode response for balance query.

Types

type CiTestData

type CiTestData struct {
	// RedisAddr is a redis address
	RedisAddr string
	// RedisPass is a redis password
	RedisPass string
	// HlfProfilePath is a path to hlf profile
	HlfProfilePath string
	// HlfFiatChannel is a fiat channel name
	HlfFiatChannel string
	// HlfCcChannel is a cc channel name
	HlfCcChannel string
	// HlfIndustrialChannel is a industrial channel name
	HlfIndustrialChannel string
	// HlfNoCcChannel is a no cc channel name
	HlfNoCcChannel string
	// HlfUserName is a hlf user name
	HlfUserName string
	// HlfCert is a hlf cert
	HlfCert string
	// HlfFiatOwnerKey is a fiat owner key
	HlfFiatOwnerKey string
	// HlfCcOwnerKey is a cc owner key
	HlfCcOwnerKey string
	// HlfIndustrialOwnerKey is a industrial owner key
	HlfIndustrialOwnerKey string
	// HlfUseSmartBFT is a flag for using smart bft
	HlfUseSmartBFT bool
	// HlfSk is a hlf sk
	HlfSk string
	// HlfIndustrialGroup1 is a industrial group 1
	HlfIndustrialGroup1 string
	// HlfIndustrialGroup2 is a industrial group 2
	HlfIndustrialGroup2 string
	// HlfDoSwapTests is a flag for doing swap tests
	HlfDoSwapTests bool
	// HlfDoMultiSwapTests is a flag for doing multi swap tests
	HlfDoMultiSwapTests bool
	// HlfProfile is a hlf profile
	HlfProfile *hlfprofile.HlfProfile
}

CiTestData is a struct with data for integration test

func CI

func CI(t *testing.T) CiTestData

CI returns data for integration test

Jump to

Keyboard shortcuts

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