ntesting

package
v0.0.0-...-e4bbcfe Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 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)

func GetFiatOwner

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

func GetIndustrialOwner

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

func ParseBalance

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

ParseBalance parses chaincode response for balance query.

Types

type CiTestData

type CiTestData struct {
	RedisAddr             string
	RedisPass             string
	HlfProfilePath        string
	HlfFiatChannel        string
	HlfCcChannel          string
	HlfIndustrialChannel  string
	HlfNoCcChannel        string
	HlfUserName           string
	HlfCert               string
	HlfFiatOwnerKey       string
	HlfCcOwnerKey         string
	HlfIndustrialOwnerKey string
	HlfSk                 string
	HlfIndustrialGroup1   string
	HlfIndustrialGroup2   string
	HlfDoSwapTests        bool
	HlfDoMultiSwapTests   bool

	HlfProfile *hlfprofile.HlfProfile
}

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