test_cases

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserByUserId

func AddUserByUserId(aclAPI *acl.API, userID string) (*base_token.KeyPair, error)

AddUserByUserId - add user by userID and generate publicKey

func AddUserByUserIdAndPublicKey

func AddUserByUserIdAndPublicKey(aclAPI *acl.API, userID string, publicKey ed25519.PublicKey) error

AddUserByUserIdAndPublicKey - add user by userID and publicKey

func GetAllowedBalance

func GetAllowedBalance(externalChannel basetoken.BaseTokenInterface, address string, token string) (uint64, error)

GetAllowedBalance - get allowed balance from external channel

func GetBalance

func GetBalance(tokenChannel basetoken.BaseTokenInterface, address string) (uint64, error)

GetBalance - get balance from token channel

func Retry

func Retry(
	ctx context.Context,
	what func() error,
	d time.Duration,
) error

Retry function for retrying some action

func Swap

func Swap(fromChaincodeAPI base_token.BaseTokenInterface, toChaincodeAPI base_token.BaseTokenInterface, keyPair *base_token.KeyPair, token string, swapAmount uint64) error

Swap user token from one cc to another cc fromChaincodeAPI - source chaincode api toChaincodeAPI - target chaincode api user - who will swap token - token owner token - title token swapAmount - amount of token

func UserAllowedBalanceShouldBe

func UserAllowedBalanceShouldBe(keyPair *basetoken.KeyPair, externalChannel basetoken.BaseTokenInterface, token string, expectedAllowedAmount uint64) error

UserAllowedBalanceShouldBe - check user allowed balance

func UserBalanceShouldBe

func UserBalanceShouldBe(keyPair *basetoken.KeyPair, tokenOwnChannel basetoken.BaseTokenInterface, expectedAmount uint64) error

UserBalanceShouldBe - check user balance

func WaitSwapInOtherChannel

func WaitSwapInOtherChannel(chaincodeAPI base_token.BaseTokenInterface, swapTransactionId string) (*channel.Response, error)

WaitSwapInOtherChannel wait swap in other channel

Types

This section is empty.

Jump to

Keyboard shortcuts

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