local

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomSigningGroup added in v1.5.0

func RandomSigningGroup(size int) []common.Address

Types

type Chain

type Chain interface {
	eth.Handle

	OpenKeep(keepAddress common.Address, members []common.Address)
	CloseKeep(keepAddress common.Address) error
	TerminateKeep(keepAddress common.Address) error
	AuthorizeOperator(operatorAddress common.Address)
}

Chain is an extention of eth.Handle interface which exposes additional functions useful for testing.

func Connect

func Connect(ctx context.Context) Chain

Connect performs initialization for communication with Ethereum blockchain based on provided config.

type Signature added in v1.5.0

type Signature struct {
	V uint8
	R [32]uint8
	S [32]uint8
}

type TBTCLocalChain added in v1.5.0

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

func NewTBTCLocalChain added in v1.5.0

func NewTBTCLocalChain(ctx context.Context) *TBTCLocalChain

func (TBTCLocalChain) Address added in v1.5.0

func (lc TBTCLocalChain) Address() common.Address

func (TBTCLocalChain) AuthorizeOperator added in v1.5.0

func (lc TBTCLocalChain) AuthorizeOperator(operator common.Address)

func (TBTCLocalChain) BalanceMonitor added in v1.5.0

func (lc TBTCLocalChain) BalanceMonitor() (chain.BalanceMonitor, error)

func (TBTCLocalChain) BlockCounter added in v1.5.0

func (lc TBTCLocalChain) BlockCounter() chain.BlockCounter

func (TBTCLocalChain) BlockTimestamp added in v1.5.0

func (lc TBTCLocalChain) BlockTimestamp(blockNumber *big.Int) (uint64, error)

func (TBTCLocalChain) CloseKeep added in v1.5.0

func (lc TBTCLocalChain) CloseKeep(keepAddress common.Address) error

func (*TBTCLocalChain) CreateDeposit added in v1.5.0

func (tlc *TBTCLocalChain) CreateDeposit(
	depositAddress string,
	signers []common.Address,
)

func (*TBTCLocalChain) CurrentState added in v1.5.0

func (tlc *TBTCLocalChain) CurrentState(
	depositAddress string,
) (chain.DepositState, error)

func (*TBTCLocalChain) DepositPubkey added in v1.5.0

func (tlc *TBTCLocalChain) DepositPubkey(
	depositAddress string,
) ([]byte, error)

func (*TBTCLocalChain) DepositRedemptionFee added in v1.5.0

func (tlc *TBTCLocalChain) DepositRedemptionFee(
	depositAddress string,
) (*big.Int, error)

func (*TBTCLocalChain) DepositRedemptionProof added in v1.5.0

func (tlc *TBTCLocalChain) DepositRedemptionProof(
	depositAddress string,
) (*TxProof, error)

func (*TBTCLocalChain) DepositRedemptionSignature added in v1.5.0

func (tlc *TBTCLocalChain) DepositRedemptionSignature(
	depositAddress string,
) (*Signature, error)

func (TBTCLocalChain) GetHonestThreshold added in v1.5.0

func (lc TBTCLocalChain) GetHonestThreshold(
	keepAddress common.Address,
) (uint64, error)

func (TBTCLocalChain) GetKeepAtIndex added in v1.5.0

func (lc TBTCLocalChain) GetKeepAtIndex(
	keepIndex *big.Int,
) (common.Address, error)

func (TBTCLocalChain) GetKeepCount added in v1.5.0

func (lc TBTCLocalChain) GetKeepCount() (*big.Int, error)

func (TBTCLocalChain) GetMembers added in v1.5.0

func (lc TBTCLocalChain) GetMembers(
	keepAddress common.Address,
) ([]common.Address, error)

func (TBTCLocalChain) GetOpenedTimestamp added in v1.5.0

func (lc TBTCLocalChain) GetOpenedTimestamp(keepAddress common.Address) (time.Time, error)

func (TBTCLocalChain) GetPublicKey added in v1.5.0

func (lc TBTCLocalChain) GetPublicKey(keepAddress common.Address) ([]uint8, error)

func (*TBTCLocalChain) IncreaseRedemptionFee added in v1.5.0

func (tlc *TBTCLocalChain) IncreaseRedemptionFee(
	depositAddress string,
	previousOutputValueBytes [8]uint8,
	newOutputValueBytes [8]uint8,
) error

func (TBTCLocalChain) IsActive added in v1.5.0

func (lc TBTCLocalChain) IsActive(keepAddress common.Address) (bool, error)

IsActive checks for current state of a keep on-chain.

func (TBTCLocalChain) IsAwaitingSignature added in v1.5.0

func (lc TBTCLocalChain) IsAwaitingSignature(
	keepAddress common.Address,
	digest [32]byte,
) (bool, error)

IsAwaitingSignature checks if the keep is waiting for a signature to be calculated for the given digest.

func (TBTCLocalChain) IsEligibleForApplication added in v1.5.0

func (lc TBTCLocalChain) IsEligibleForApplication(application common.Address) (bool, error)

func (TBTCLocalChain) IsOperatorAuthorized added in v1.5.0

func (lc TBTCLocalChain) IsOperatorAuthorized(operator common.Address) (bool, error)

func (TBTCLocalChain) IsRegisteredForApplication added in v1.5.0

func (lc TBTCLocalChain) IsRegisteredForApplication(application common.Address) (bool, error)

func (TBTCLocalChain) IsStatusUpToDateForApplication added in v1.5.0

func (lc TBTCLocalChain) IsStatusUpToDateForApplication(application common.Address) (bool, error)

func (*TBTCLocalChain) KeepAddress added in v1.5.0

func (tlc *TBTCLocalChain) KeepAddress(depositAddress string) (string, error)

func (TBTCLocalChain) LatestDigest added in v1.5.0

func (lc TBTCLocalChain) LatestDigest(keepAddress common.Address) ([32]byte, error)

func (*TBTCLocalChain) Logger added in v1.5.0

func (tlc *TBTCLocalChain) Logger() *localChainLogger

func (TBTCLocalChain) OnBondedECDSAKeepCreated added in v1.5.0

func (lc TBTCLocalChain) OnBondedECDSAKeepCreated(
	handler func(event *eth.BondedECDSAKeepCreatedEvent),
) subscription.EventSubscription

OnBondedECDSAKeepCreated is a callback that is invoked when an on-chain notification of a new ECDSA keep creation is seen.

func (TBTCLocalChain) OnConflictingPublicKeySubmitted added in v1.5.0

func (lc TBTCLocalChain) OnConflictingPublicKeySubmitted(
	keepAddress common.Address,
	handler func(event *eth.ConflictingPublicKeySubmittedEvent),
) (subscription.EventSubscription, error)

func (*TBTCLocalChain) OnDepositCreated added in v1.5.0

func (tlc *TBTCLocalChain) OnDepositCreated(
	handler func(depositAddress string),
) (subscription.EventSubscription, error)

func (*TBTCLocalChain) OnDepositGotRedemptionSignature added in v1.5.0

func (tlc *TBTCLocalChain) OnDepositGotRedemptionSignature(
	handler func(depositAddress string),
) (subscription.EventSubscription, error)

func (*TBTCLocalChain) OnDepositRedeemed added in v1.5.0

func (tlc *TBTCLocalChain) OnDepositRedeemed(
	handler func(depositAddress string),
) (subscription.EventSubscription, error)

func (*TBTCLocalChain) OnDepositRedemptionRequested added in v1.5.0

func (tlc *TBTCLocalChain) OnDepositRedemptionRequested(
	handler func(depositAddress string),
) (subscription.EventSubscription, error)

func (*TBTCLocalChain) OnDepositRegisteredPubkey added in v1.5.0

func (tlc *TBTCLocalChain) OnDepositRegisteredPubkey(
	handler func(depositAddress string),
) (subscription.EventSubscription, error)

func (TBTCLocalChain) OnKeepClosed added in v1.5.0

func (lc TBTCLocalChain) OnKeepClosed(
	keepAddress common.Address,
	handler func(event *eth.KeepClosedEvent),
) (subscription.EventSubscription, error)

func (TBTCLocalChain) OnKeepTerminated added in v1.5.0

func (lc TBTCLocalChain) OnKeepTerminated(
	keepAddress common.Address,
	handler func(event *eth.KeepTerminatedEvent),
) (subscription.EventSubscription, error)

func (TBTCLocalChain) OnPublicKeyPublished added in v1.5.0

func (lc TBTCLocalChain) OnPublicKeyPublished(
	keepAddress common.Address,
	handler func(event *eth.PublicKeyPublishedEvent),
) (subscription.EventSubscription, error)

func (TBTCLocalChain) OnSignatureRequested added in v1.5.0

func (lc TBTCLocalChain) OnSignatureRequested(
	keepAddress common.Address,
	handler func(event *eth.SignatureRequestedEvent),
) (subscription.EventSubscription, error)

OnSignatureRequested is a callback that is invoked on-chain when a keep's signature is requested.

func (TBTCLocalChain) OpenKeep added in v1.5.0

func (lc TBTCLocalChain) OpenKeep(keepAddress common.Address, members []common.Address)

func (*TBTCLocalChain) PastDepositRedemptionRequestedEvents added in v1.5.0

func (tlc *TBTCLocalChain) PastDepositRedemptionRequestedEvents(
	startBlock uint64,
	depositAddress string,
) ([]*chain.DepositRedemptionRequestedEvent, error)

func (TBTCLocalChain) PastSignatureSubmittedEvents added in v1.5.0

func (lc TBTCLocalChain) PastSignatureSubmittedEvents(
	keepAddress string,
	startBlock uint64,
) ([]*eth.SignatureSubmittedEvent, error)

func (*TBTCLocalChain) ProvideRedemptionProof added in v1.5.0

func (tlc *TBTCLocalChain) ProvideRedemptionProof(
	depositAddress string,
	txVersion [4]uint8,
	txInputVector []uint8,
	txOutputVector []uint8,
	txLocktime [4]uint8,
	merkleProof []uint8,
	txIndexInBlock *big.Int,
	bitcoinHeaders []uint8,
) error

func (*TBTCLocalChain) ProvideRedemptionSignature added in v1.5.0

func (tlc *TBTCLocalChain) ProvideRedemptionSignature(
	depositAddress string,
	v uint8,
	r [32]uint8,
	s [32]uint8,
) error

func (*TBTCLocalChain) RedeemDeposit added in v1.5.0

func (tlc *TBTCLocalChain) RedeemDeposit(depositAddress string) error

func (TBTCLocalChain) RegisterAsMemberCandidate added in v1.5.0

func (lc TBTCLocalChain) RegisterAsMemberCandidate(application common.Address) error

RegisterAsMemberCandidate registers client as a candidate to be selected to a keep.

func (*TBTCLocalChain) RetrieveSignerPubkey added in v1.5.0

func (tlc *TBTCLocalChain) RetrieveSignerPubkey(depositAddress string) error

func (*TBTCLocalChain) SetAlwaysFailingTransactions added in v1.5.0

func (tlc *TBTCLocalChain) SetAlwaysFailingTransactions(transactions ...string)

func (TBTCLocalChain) SignatureRequestedBlock added in v1.5.0

func (lc TBTCLocalChain) SignatureRequestedBlock(
	keepAddress common.Address,
	digest [32]byte,
) (uint64, error)

func (TBTCLocalChain) Signing added in v1.6.0

func (lc TBTCLocalChain) Signing() chain.Signing

func (TBTCLocalChain) StakeMonitor added in v1.5.0

func (lc TBTCLocalChain) StakeMonitor() (chain.StakeMonitor, error)

func (TBTCLocalChain) SubmitKeepPublicKey added in v1.5.0

func (lc TBTCLocalChain) SubmitKeepPublicKey(
	keepAddress common.Address,
	publicKey [64]byte,
) error

SubmitKeepPublicKey checks if public key has been already submitted for given keep address, if not it stores the key in a map.

func (TBTCLocalChain) SubmitSignature added in v1.5.0

func (lc TBTCLocalChain) SubmitSignature(
	keepAddress common.Address,
	signature *ecdsa.Signature,
) error

SubmitSignature submits a signature to a keep contract deployed under a given address.

func (TBTCLocalChain) TerminateKeep added in v1.5.0

func (lc TBTCLocalChain) TerminateKeep(keepAddress common.Address) error

func (TBTCLocalChain) UpdateStatusForApplication added in v1.5.0

func (lc TBTCLocalChain) UpdateStatusForApplication(application common.Address) error

type TxProof added in v1.5.0

type TxProof struct{}

Jump to

Keyboard shortcuts

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