Documentation ¶
Index ¶
- Constants
- Variables
- func HexDecode(input string) ([]byte, error)
- func HexEncode(input []byte) string
- func IndexOf(strs []string, str string) int
- func NormalizeString(str string) string
- func RemoveDuplicatesFromUint64Slice(sliceList []uint64) []uint64
- func StrNotSet(value string) bool
- func ToNumeric(i *big.Int) decimal.Decimal
- func ValidateString(str string, forbidden ...string) error
- func ValidateStringAllowEmpty(str string, forbidden string) error
- type Nonce
- type Threshold
- func (*Threshold) Descriptor() ([]byte, []int)
- func (m Threshold) GT(t Threshold) bool
- func (m Threshold) GTE(t Threshold) bool
- func (m Threshold) IsMet(share sdk.Int, total sdk.Int) bool
- func (m Threshold) LT(t Threshold) bool
- func (m Threshold) LTE(t Threshold) bool
- func (m *Threshold) Marshal() (dAtA []byte, err error)
- func (m *Threshold) MarshalTo(dAtA []byte) (int, error)
- func (m *Threshold) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Threshold) ProtoMessage()
- func (m *Threshold) Reset()
- func (m *Threshold) Size() (n int)
- func (m Threshold) String() string
- func (m *Threshold) Unmarshal(dAtA []byte) error
- func (m Threshold) Validate() error
- func (m *Threshold) XXX_DiscardUnknown()
- func (m *Threshold) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Threshold) XXX_Merge(src proto.Message)
- func (m *Threshold) XXX_Size() int
- func (m *Threshold) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const DefaultDelimiter = "_"
Variables ¶
Functions ¶
func NormalizeString ¶
NormalizeString normalizes a string as NFKC
func ValidateString ¶
ValidateString checks if the given string is:
1. non-empty 2. entirely composed of utf8 runes 3. normalized as NFKC 4. does not contain any forbidden Unicode code points
func ValidateStringAllowEmpty ¶
ValidateStringAllowEmpty checks if the given string is:
1. entirely composed of utf8 runes 2. normalized as NFKC 3. does not contain any forbidden Unicode code points
Types ¶
type Threshold ¶
type Threshold struct { // split threshold into Numerator and denominator to avoid floating point // errors down the line Numerator int64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` Denominator int64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"` }
var OneThreshold Threshold = NewThreshold(1, 1)
OneThreshold is a threshold that equals to 1
var ZeroThreshold Threshold = NewThreshold(0, 1)
ZeroThreshold is a threshold that equals to 0
func NewThreshold ¶
NewThreshold is the constructor for Threshold
func (*Threshold) Descriptor ¶
func (Threshold) GTE ¶
GTE returns true if and only if threshold is greater than or equal to the given one
func (Threshold) LTE ¶
LTE returns true if and only if threshold is less than or equal to the given one
func (*Threshold) MarshalToSizedBuffer ¶
func (*Threshold) ProtoMessage ¶
func (*Threshold) ProtoMessage()
func (*Threshold) XXX_DiscardUnknown ¶
func (m *Threshold) XXX_DiscardUnknown()
func (*Threshold) XXX_Marshal ¶
func (*Threshold) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.