utils

package
v0.0.0-...-4a639d8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LND_HOST             = "LND_GRPC_HOST"
	LND_TLS_CERT         = "LND_TLS_CERT"
	LND_MACAROON         = "LND_MACAROON"
	MINT_LNBITS_ENDPOINT = "MINT_LNBITS_ENDPOINT"
	MINT_LNBITS_KEY      = "MINT_LNBITS_KEY"

	CLN_HOST     = "CLN_GRPC_HOST"
	CLN_TLS_CERT = "CLN_TLS_CERT"
	CLN_MACAROON = "CLN_MACAROON"
)
View Source
const ConfigDirName string = "nutmix"
View Source
const ConfigFileName string = "config.toml"
View Source
const LogExtraInfo string = "extra-info"

Variables

View Source
var (
	DOCKER_ENV           = "DOCKER"
	MODE_ENV             = "MODE"
	MINT_PRIVATE_KEY_ENV = "MINT_PRIVATE_KEY"
)

Functions

func CreateDirectoryAndPath

func CreateDirectoryAndPath(dirPath string, filename string) error

func ExtractInternalFile

func ExtractInternalFile(ctx context.Context, container testcontainers.Container, path string) (string, error)

func GetAndCalculateProofsValues

func GetAndCalculateProofsValues(proofs *cashu.Proofs) (uint64, []string, error)

Sets some values being used by the mint like seen, secretY, seen, and pending state

func GetChangeOutput

func GetChangeOutput(overpaidFees uint64, outputs []cashu.BlindedMessage) []cashu.BlindedMessage

func GetLogsDirectory

func GetLogsDirectory() (string, error)

func ParseErrorToCashuErrorCode

func ParseErrorToCashuErrorCode(proofError error) (cashu.ErrorCode, *string)

func ReadDataFromReader

func ReadDataFromReader(reader io.Reader) (string, error)

func SetUpLightingNetworkTestEnviroment

func SetUpLightingNetworkTestEnviroment(ctx context.Context, names string) (testcontainers.Container, testcontainers.Container, testcontainers.Container, testcontainers.Container, error)

This is used for testing purpose returns alice, bob, btcNode, aliceLnBits, error

Types

type SlogRecordJSON

type SlogRecordJSON struct {
	Time      time.Time
	Msg       string
	Level     slog.Level
	ExtraInfo string `json:"extra-info"`
}

func ParseLogFileByLevelAndTime

func ParseLogFileByLevelAndTime(file *os.File, wantedLevel []slog.Level, limitTime time.Time) []SlogRecordJSON

Jump to

Keyboard shortcuts

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