helpers

package
v0.0.0-...-dda0961 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MinSignaturesRequired = 1

MinSignaturesRequired defines the minimum number of signatures required for a multisignature transaction.

Variables

This section is empty.

Functions

func CheckDuplicates

func CheckDuplicates(arr []string) error

CheckDuplicates checks a string array for duplicates. It returns an error if duplicates are found, indicating the first duplicated item encountered.

func CheckKeysArr

func CheckKeysArr(keysArr []string) error

CheckKeysArr checks keys if not empty or having duplicates

func CheckPublicKey

func CheckPublicKey(address string) error

CheckPublicKey verifies public key in the address variable

func DecodeAndSort

func DecodeAndSort(item string) ([][]byte, error)

DecodeAndSort returns decoded and sorted collection

func DecodeBase58PublicKey

func DecodeBase58PublicKey(encodedBase58PublicKey string) ([]byte, error)

DecodeBase58PublicKey decode public key from base58 to ed25519 byte array

func IsValidator

func IsValidator(authorities []string, pk string) bool

IsValidator checks whether a public key belongs to authorized entities and returns true or false

func KeyStringToSortedHashedHex

func KeyStringToSortedHashedHex(keys []string) (string, error)

KeyStringToSortedHashedHex returns keys encoded to sorted hashed hex

func ParseCCName

func ParseCCName(stub shim.ChaincodeStubInterface) (string, error)

ParseCCName returns chaincode name from proposal

func ToLowerFirstLetter

func ToLowerFirstLetter(in string) string

ToLowerFirstLetter returns string with first letter in lower case

func ValidateMinSignatures

func ValidateMinSignatures(n int) error

ValidateMinSignatures checks that the number of required signatures is greater than the minimum allowed value. It returns an error if the number of required signatures is less than or equal to the minimum allowed value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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