utils

package
v0.0.0-...-fa6a194 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package utils provides some utility functions.

Copyright Nobuyuki Matsui<nobuyuki.matsui>.

SPDX-License-Identifier: Apache-2.0

Package utils provides some utility functions.

Copyright Nobuyuki Matsui<nobuyuki.matsui>.

SPDX-License-Identifier: Apache-2.0

Package utils provides some utility functions.

Copyright Nobuyuki Matsui<nobuyuki.matsui>.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccount

func GetAccount(APIstub shim.ChaincodeStubInterface, no string) (*models.Account, error)

GetAccount : get an account from state db using account no.

func GetAccountNo

func GetAccountNo(APIstub shim.ChaincodeStubInterface) (string, error)

GetAccountNo : return a unique Account No.

func GetAmount

func GetAmount(amountStr string) (int, error)

GetAmount : convert amount to int and validate it

func GetEventNo

func GetEventNo(APIstub shim.ChaincodeStubInterface) (string, error)

GetEventNo : return a unique Event No.

Types

type WarningResult

type WarningResult struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
}

WarningResult : a struct implements Error Interface.

use this type when chaincode was invoked successfully but the expected result did not obtained

func (*WarningResult) Error

func (e *WarningResult) Error() string

Error : error interface

func (*WarningResult) JSONBytes

func (e *WarningResult) JSONBytes() []byte

JSONBytes : return error json bytes

Jump to

Keyboard shortcuts

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