mock

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 14 Imported by: 0

README

Coverage Status Renovate enabled Build status Build status Go Report Card

What is this?

This is a helper library by entropy that hopes to imitate some of the functionality of polar for continuous integration. Right now this supports creating btcd and lnd nodes and funding them. Channel support is planned soon. You can check out an example in lnd_test. This also supports mocking bolt11 invoices

Note:

This library was open sourced as a dependency for another project. While this is functional, documentation may be lacking for a bit.

Documentation

Overview

utilities for mocking lightning interactions within docker

Index

Constants

View Source
const MiningAddressName = "MINING_ADDRESS"

Variables

View Source
var EnvArgs = []string{
	"RPCUSER",
	"RPCPASS",
	"NETWORK=simnet",
	"DEBUG",
}
View Source
var HostnameCmd = []string{"hostname", "-i"}
View Source
var Volumes = []string{"shared", "bitcoin", "lnd"}

Functions

func MockLndInvoiceMain

func MockLndInvoiceMain(t *testing.T) (encoded string, decoded *zpay32.Invoice)

create a mock lnd invoice on mainnet

Types

type LightningMocker

type LightningMocker struct {
	docker.Client
}

func NewLightningMocker

func NewLightningMocker() LightningMocker

func (LightningMocker) CreateBtcdContainer

func (c LightningMocker) CreateBtcdContainer() (id string, err error)

func (LightningMocker) CreateLndContainer

func (c LightningMocker) CreateLndContainer(name string) (id string, err error)

func (LightningMocker) CreateVolumes

func (c LightningMocker) CreateVolumes() error

idempotently create volumes

func (LightningMocker) RecreateBtcdContainerMining

func (c LightningMocker) RecreateBtcdContainerMining(containerId string, miningAddress string) (id string, err error)

recreate the btcd container with the correct mining address TODO reduce redundant code here

func (LightningMocker) Teardown

func (c LightningMocker) Teardown() error

Jump to

Keyboard shortcuts

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