Documentation ¶
Index ¶
- Constants
- func AddAmountToWallet(ctx context.Context, url, ref string, amount uint) error
- func CreateSimpleWallet(ctx context.Context) (string, error)
- func GetPorts() []string
- func GetURL(path, host, port string) string
- func GetWalletBalance(ctx context.Context, url, ref string) (uint, error)
- func ResetHTTPClient()
- func SendAPIRequest(ctx context.Context, url string, body interface{}) ([]byte, error)
- func SetAPIPorts(ports []string)
- func SetAPIPortsByAddresses(apiAddresses []string)
- type WalletAddAmountRequestBody
- type WalletAddAmountResponse
- type WalletCreateResponse
- type WalletDeleteRequestBody
- type WalletDeleteResponse
- type WalletGetBalanceRequestBody
- type WalletGetBalanceResponse
- type WalletTransferRequestBody
- type WalletTransferResponse
Constants ¶
View Source
const ( WalletCreatePath = walletPath + "/create" WalletGetBalancePath = walletPath + "/get_balance" WalletAddAmountPath = walletPath + "/add_amount" WalletTransferPath = walletPath + "/transfer" WalletDeletePath = walletPath + "/delete" )
View Source
const StartBalance uint = 1000000000 // nolint:unused,deadcode,varcheck
Variables ¶
This section is empty.
Functions ¶
func AddAmountToWallet ¶
Adds amount to wallet.
func CreateSimpleWallet ¶
Creates wallet and returns it's reference.
func GetWalletBalance ¶
Returns wallet balance.
func ResetHTTPClient ¶
func ResetHTTPClient()
func SendAPIRequest ¶
func SetAPIPorts ¶
func SetAPIPorts(ports []string)
SetAPIPorts is not thread safe, it is supposed to be called before bench run, right after launchnet is configured
func SetAPIPortsByAddresses ¶
func SetAPIPortsByAddresses(apiAddresses []string)
SetAPIPortsByAddresses is not thread safe, it is supposed to be called before bench run, right after launchnet is configured
Types ¶
type WalletAddAmountRequestBody ¶
nolint:unused,deadcode
type WalletAddAmountResponse ¶
nolint:unused
func UnmarshalWalletAddAmountResponse ¶
func UnmarshalWalletAddAmountResponse(resp []byte) (WalletAddAmountResponse, error)
type WalletCreateResponse ¶
type WalletCreateResponse struct { Err string `json:"error"` Ref string `json:"reference"` TraceID string `json:"traceID"` }
nolint:unused
func UnmarshalWalletCreateResponse ¶
func UnmarshalWalletCreateResponse(resp []byte) (WalletCreateResponse, error)
type WalletDeleteRequestBody ¶
type WalletDeleteRequestBody struct {
Ref string `json:"walletRef"`
}
nolint:unused,deadcode
type WalletDeleteResponse ¶
nolint:unused,deadcode
func UnmarshalWalletDeleteResponse ¶
func UnmarshalWalletDeleteResponse(resp []byte) (WalletDeleteResponse, error)
type WalletGetBalanceRequestBody ¶
type WalletGetBalanceRequestBody struct {
Ref string `json:"walletRef"`
}
nolint:unused,deadcode
type WalletGetBalanceResponse ¶
type WalletGetBalanceResponse struct { Err string `json:"error"` Amount uint `json:"amount"` TraceID string `json:"traceID"` }
nolint:unused,deadcode
func UnmarshalWalletGetBalanceResponse ¶
func UnmarshalWalletGetBalanceResponse(resp []byte) (WalletGetBalanceResponse, error)
type WalletTransferRequestBody ¶
type WalletTransferRequestBody struct { To string `json:"to"` From string `json:"from"` Amount uint `json:"amount"` }
nolint:unused,deadcode
type WalletTransferResponse ¶
nolint:unused
func UnmarshalWalletTransferResponse ¶
func UnmarshalWalletTransferResponse(resp []byte) (WalletTransferResponse, error)
Click to show internal directories.
Click to hide internal directories.