sidechain

package
v0.0.0-...-8e94ecf Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Connect

func Connect(protoAddr string) (net.Conn, error)

Connect dials the given address and returns a net.Conn. The protoAddr argument should be prefixed with the protocol, eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock"

func DialerFunc

func DialerFunc(ctx context.Context, addr string) (net.Conn, error)

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

ProtocolAndAddress splits an address into the protocol and address components. For instance, "tcp://127.0.0.1:8080" will be split into "tcp" and "127.0.0.1:8080". If the address has no protocol prefix, the default is "tcp".

Types

type PeggyBroadcastClient

type PeggyBroadcastClient interface {
	FromAddress() sdk.AccAddress

	// UpdatePeggyEthAddress broadcasts a transaction updating the ETH address for the sending
	// Cosmos address. The sending Cosmos address should be a validator.
	UpdatePeggyEthAddress(
		ctx context.Context,
		ethPrivateKey *ecdsa.PrivateKey,
	) error

	// SendValsetRequest broadcasts a transaction requesting that a valset be formed for a given block
	// height.
	SendValsetRequest(
		ctx context.Context,
	) error

	// SendValsetConfirm broadcasts in a confirmation for a specific validator set for a specific block height.
	SendValsetConfirm(
		ctx context.Context,
		ethPrivateKey *ecdsa.PrivateKey,
		peggyID common.Hash,
		valset *types.Valset,
	) error

	// SendBatchConfirm broadcasts in a confirmation for a specific transaction batch set for a specific block height
	// since transaction batches also include validator sets this has all the arguments
	SendBatchConfirm(
		ctx context.Context,
		ethPrivateKey *ecdsa.PrivateKey,
		peggyID common.Hash,
		batch *types.OutgoingTxBatch,
	) error

	SendEthereumClaims(
		ctx context.Context,
		deposits []*wrappers.PeggySendToCosmosEvent,
		withdraws []*wrappers.PeggyTransactionBatchExecutedEvent,
	) error

	// SendToEth broadcasts a Tx that tokens from Cosmos to Ethereum.
	// These tokens will not be sent immediately. Instead, they will require
	// some time to be included in a batch.
	SendToEth(
		ctx context.Context,
		destination common.Address,
		amount, fee sdk.Coin,
	) error

	SendRequestBatch(
		ctx context.Context,
		denom string,
	) error
}

func NewPeggyBroadcastClient

func NewPeggyBroadcastClient(
	queryClient types.QueryClient,
	broadcastClient chainclient.CosmosClient,
) PeggyBroadcastClient

type PeggyQueryClient

type PeggyQueryClient interface {
	ValsetAt(ctx context.Context, nonce uint64) (*types.Valset, error)
	CurrentValset(ctx context.Context) (*types.Valset, error)
	OldestUnsignedValset(ctx context.Context, address sdk.AccAddress) (*types.Valset, error)
	LatestValsets(ctx context.Context) ([]*types.Valset, error)
	AllValsetConfirms(ctx context.Context, nonce uint64) ([]*types.MsgValsetConfirm, error)
	OldestUnsignedTransactionBatch(ctx context.Context, address sdk.AccAddress) (*types.OutgoingTxBatch, error)
	LatestTransactionBatches(ctx context.Context) ([]*types.OutgoingTxBatch, error)
	LatestUnbatchOutgoingTx(ctx context.Context, contractAddr string) ([]*types.OutgoingTx, error)
	TransactionBatchSignatures(ctx context.Context, nonce uint64, tokenContract common.Address) ([]*types.MsgConfirmBatch, error)
	LastEventNonce(ctx context.Context, address sdk.AccAddress) (uint64, error)
}

func NewPeggyQueryClient

func NewPeggyQueryClient(client types.QueryClient) PeggyQueryClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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