util

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigMainDenom = "uaxm"
)

Variables

View Source
var (
	ErrInvalidLengthEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvents          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
)

Functions

func AddStringOntoEnd

func AddStringOntoEnd(arr *[]string, item string) bool

func AddStringSorted

func AddStringSorted(arr *[]string, item string) bool

func ContainsString

func ContainsString(arr []string, item string) bool

func EmitEvent

func EmitEvent(ctx sdk.Context, tev proto.Message)

EmitEvent emits a typed event like the sdk.EventManager.EmitTypedEvent method does, but it unquotes string attribute values so Tendermint could search txs by them.

See https://github.com/tendermint/tendermint/issues/6809

func EmitEvents

func EmitEvents(ctx sdk.Context, tevs ...proto.Message)

EmitEvents emits typed events like the sdk.EventManager.EmitTypedEvents method does, but it unquotes string attribute values so Tendermint could search txs by them.

See https://github.com/tendermint/tendermint/issues/6809

func MergeStringsSorted

func MergeStringsSorted(arr1 []string, arr2 []string) []string

func RemoveStringFast

func RemoveStringFast(arr *[]string, item string) bool

func RemoveStringPreserveOrder

func RemoveStringPreserveOrder(arr *[]string, item string) bool

func TagTx

func TagTx(ctx sdk.Context, module string, tx proto.Message)

TagTx adds a `message` event with `module` and `action` attributes to the context EventManager.

Types

type EventMessage

type EventMessage struct {
	Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"`
	Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
}

func (*EventMessage) Descriptor

func (*EventMessage) Descriptor() ([]byte, []int)

func (*EventMessage) GetAction

func (m *EventMessage) GetAction() string

func (*EventMessage) GetModule

func (m *EventMessage) GetModule() string

func (*EventMessage) Marshal

func (m *EventMessage) Marshal() (dAtA []byte, err error)

func (*EventMessage) MarshalTo

func (m *EventMessage) MarshalTo(dAtA []byte) (int, error)

func (*EventMessage) MarshalToSizedBuffer

func (m *EventMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventMessage) ProtoMessage

func (*EventMessage) ProtoMessage()

func (*EventMessage) Reset

func (m *EventMessage) Reset()

func (*EventMessage) Size

func (m *EventMessage) Size() (n int)

func (*EventMessage) String

func (m *EventMessage) String() string

func (*EventMessage) Unmarshal

func (m *EventMessage) Unmarshal(dAtA []byte) error

func (*EventMessage) XXX_DiscardUnknown

func (m *EventMessage) XXX_DiscardUnknown()

func (*EventMessage) XXX_Marshal

func (m *EventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventMessage) XXX_Merge

func (m *EventMessage) XXX_Merge(src proto.Message)

func (EventMessage) XXX_MessageName

func (EventMessage) XXX_MessageName() string

func (*EventMessage) XXX_Size

func (m *EventMessage) XXX_Size() int

func (*EventMessage) XXX_Unmarshal

func (m *EventMessage) XXX_Unmarshal(b []byte) error

type Fraction

type Fraction struct {
	// contains filtered or unexported fields
}

func FractionInt

func FractionInt(x int64) Fraction

func FractionZero

func FractionZero() Fraction

func NewFraction

func NewFraction(num int64, denom int64) Fraction

func ParseFraction

func ParseFraction(s string) (Fraction, error)

func Percent

func Percent(x int64) Fraction

func Permille

func Permille(x int64) Fraction

func (Fraction) Add

func (x Fraction) Add(y Fraction) Fraction

func (Fraction) BigInt

func (x Fraction) BigInt() *big.Int

func (Fraction) Clone

func (x Fraction) Clone() Fraction

func (Fraction) Div

func (x Fraction) Div(y Fraction) Fraction

func (Fraction) DivInt64

func (x Fraction) DivInt64(y int64) Fraction

func (Fraction) Equal

func (x Fraction) Equal(y Fraction) bool

func (Fraction) GT

func (x Fraction) GT(y Fraction) bool

func (Fraction) GTE

func (x Fraction) GTE(y Fraction) bool

func (Fraction) Int64

func (x Fraction) Int64() int64

func (Fraction) IsNegative

func (x Fraction) IsNegative() bool

func (Fraction) IsNullValue

func (x Fraction) IsNullValue() bool

func (Fraction) IsPositive

func (x Fraction) IsPositive() bool

func (Fraction) IsZero

func (x Fraction) IsZero() bool

func (Fraction) LT

func (x Fraction) LT(y Fraction) bool

func (Fraction) LTE

func (x Fraction) LTE(y Fraction) bool

func (Fraction) MarshalAmino

func (x Fraction) MarshalAmino() (string, error)

func (Fraction) MarshalJSON

func (x Fraction) MarshalJSON() ([]byte, error)

func (Fraction) MarshalTo

func (x Fraction) MarshalTo(dest []byte) (int, error)

func (Fraction) MarshalYAML

func (x Fraction) MarshalYAML() (interface{}, error)

func (Fraction) Mul

func (x Fraction) Mul(y Fraction) Fraction

func (Fraction) MulInt64

func (x Fraction) MulInt64(y int64) Fraction

func (Fraction) Neg

func (x Fraction) Neg() Fraction

func (Fraction) Reduce

func (x Fraction) Reduce() Fraction

func (Fraction) Size

func (x Fraction) Size() int

func (Fraction) String

func (x Fraction) String() string

func (Fraction) Sub

func (x Fraction) Sub(y Fraction) Fraction

func (*Fraction) Unmarshal

func (x *Fraction) Unmarshal(bz []byte) error

func (*Fraction) UnmarshalAmino

func (x *Fraction) UnmarshalAmino(s string) error

func (*Fraction) UnmarshalJSON

func (x *Fraction) UnmarshalJSON(bz []byte) error

func (*Fraction) UnmarshalYAML

func (x *Fraction) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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