utils

package
v0.0.38 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const HardFailPrefix = "hard fail error occurred"

Variables

View Source
var Big0 = big.NewInt(0)
View Source
var Big1 = big.NewInt(1)
View Source
var Big2 = big.NewInt(2)
View Source
var Big27 = big.NewInt(27)
View Source
var Big35 = big.NewInt(35)
View Source
var Big8 = big.NewInt(8)
View Source
var BigMaxI64 = big.NewInt(math.MaxInt64)
View Source
var BigMaxU64 = new(big.Int).SetUint64(math.MaxUint64)
View Source
var Sdk0 = sdk.NewInt(0)

Functions

func DecorateHardFailError

func DecorateHardFailError(err error) error

func Filter

func Filter[T any](slice []T, lambda func(t T) bool) []T

func FilterUInt64Slice

func FilterUInt64Slice(slice []uint64, item uint64) []uint64

func LogPanicCallback

func LogPanicCallback(ctx sdk.Context, r any) func(any)

LogPanicCallback returns a callback function, given a context and a recovered error value, that logs the error and a stack trace.

func Map

func Map[I any, O any](input []I, lambda func(i I) O) []O

func MetricsPanicCallback

func MetricsPanicCallback(err any, ctx sdk.Context, key string)

func PanicHandler

func PanicHandler(recoverCallback func(any)) func()

func Reduce

func Reduce[I, O any](input []I, reducer func(I, O) O, initial O) O

func SliceCopy

func SliceCopy[T any](slice []T) []T

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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