Documentation ¶
Index ¶
- func Add(a *big.Int, b *big.Int) *big.Int
- func BufferToBigInt(buffer []byte) *big.Int
- func CheckApproved(approved *big.Int, key string) error
- func CheckArgsLength(args []string, expectedLength int) error
- func CheckBalance(balance *big.Int, mspID string) error
- func CheckCallerIsOwner(caller string, owner string) error
- func CheckGreaterThanZero(value string) error
- func CheckTotalSupply(amount *big.Int) error
- func DefaultToZeroIfEmpty(value []byte) []byte
- func GetCallerID(stub shim.ChaincodeStubInterface) (string, error)
- func IsSmallerOrEqual(a *big.Int, b *big.Int) error
- func JSONToMap(str string) map[string]interface{}
- func MalshalJSON(payload interface{}) []byte
- func Mul(a *big.Int, b *big.Int) *big.Int
- func Pow(a int64, b int64) *big.Int
- func StringToBigInt(str string) *big.Int
- func StringToInt(str string) int64
- func Sub(a *big.Int, b *big.Int) *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferToBigInt ¶
BufferToBigInt convert array of bytes to big.Int
func CheckApproved ¶
CheckApproved checks if approved amount is > 0
func CheckArgsLength ¶
CheckArgsLength compares length of string with `expectedLength`
func CheckBalance ¶
CheckBalance checks if sender's balance is > 0
func CheckCallerIsOwner ¶
CheckCallerIsOwner compares two strings
func CheckGreaterThanZero ¶
CheckGreaterThanZero parses a string value to number and check if it's >= 0
func CheckTotalSupply ¶
CheckTotalSupply checks if totalSupplyAmount is valid
func DefaultToZeroIfEmpty ¶
DefaultToZeroIfEmpty return empty array of bytes (0) if the input is empty
func GetCallerID ¶
func GetCallerID(stub shim.ChaincodeStubInterface) (string, error)
GetCallerID returns the unique ID (inside ledger) of chaicode caller.
The ID is a key of: `[mspID],[SubjectCN],[IssuerCN]`; this ID is used as "key" in the world-state database to identity a token owner.
- `mspID`: the MspID of the calling org
- `IssuerCN`: the common name from the calling identity's certificate CA provider
- `SubjectCN`: the common name from the calling identity's x509 certificate
func IsSmallerOrEqual ¶
IsSmallerOrEqual returns `nil` if a is <= b
func MalshalJSON ¶
func MalshalJSON(payload interface{}) []byte
MalshalJSON returns the JSON encoding of `payload`
func StringToBigInt ¶
StringToBigInt converts type string to type big.Int
func StringToInt ¶
StringToInt converts type string to type int64
Types ¶
This section is empty.