Documentation
¶
Index ¶
- func CreateTestUser(_ context.Context, ciData CiTestData, userID string) (*wallet.User, error)
- func EmitFiat(ctx context.Context, fiatOwner, u *wallet.User, amount uint64, ch, cc string) (string, error)
- func GetBalance(_ context.Context, user *wallet.User, channelName, chainCodeName string) (uint64, error)
- func GetCcOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)
- func GetFiatOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)
- func GetIndustrialOwner(_ context.Context, ciData CiTestData) (*wallet.User, error)
- func ParseBalance(balanceResponse []byte) (uint64, error)
- type CiTestData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestUser ¶
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 ¶
GetCcOwner returns ccOwner of user.
func GetFiatOwner ¶
GetFiatOwner returns fiatOwner of user.
func GetIndustrialOwner ¶
GetIndustrialOwner returns industrialOwner of user.
func ParseBalance ¶
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