peggy

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValsetConfirmABIJSON = `` /* 680-byte string literal not displayed */

	OutgoingBatchTxConfirmABIJSON = `` /* 878-byte string literal not displayed */

)

Variables

View Source
var ErrInsufficientVotingPowerToPass = errors.New("insufficient voting power")

Functions

func EncodeTxBatchConfirm

func EncodeTxBatchConfirm(peggyID common.Hash, batch *types.OutgoingTxBatch) common.Hash

EncodeTxBatchConfirm takes the required input data and produces the required signature to confirm a transaction batch on the Peggy Ethereum contract. This value will then be signed before being submitted to Cosmos, verified, and then relayed to Ethereum

func EncodeValsetConfirm

func EncodeValsetConfirm(peggyID common.Hash, valset *types.Valset) common.Hash

/ EncodeValsetConfirm takes the required input data and produces the required signature to confirm a validator / set update on the Peggy Ethereum contract. This value will then be signed before being / submitted to Cosmos, verified, and then relayed to Ethereum

Types

type PeggyContract

type PeggyContract interface {
	committer.EVMCommitter

	Address() common.Address

	SendToCosmos(
		ctx context.Context,
		erc20 common.Address,
		amount *big.Int,
		cosmosAccAddress sdk.AccAddress,
		senderAddress common.Address,
	) (*common.Hash, error)

	SendTransactionBatch(
		ctx context.Context,
		currentValset *types.Valset,
		batch *types.OutgoingTxBatch,
		confirms []*types.MsgConfirmBatch,
	) (*common.Hash, error)

	SendEthValsetUpdate(
		ctx context.Context,
		oldValset *types.Valset,
		newValset *types.Valset,
		confirms []*types.MsgValsetConfirm,
	) (*common.Hash, error)

	GetTxBatchNonce(
		ctx context.Context,
		erc20ContractAddress common.Address,
		callerAddress common.Address,
	) (*big.Int, error)

	GetValsetNonce(
		ctx context.Context,
		callerAddress common.Address,
	) (*big.Int, error)

	GetPeggyID(
		ctx context.Context,
		callerAddress common.Address,
	) (common.Hash, error)

	GetERC20Symbol(
		ctx context.Context,
		erc20ContractAddress common.Address,
		callerAddress common.Address,
	) (symbol string, err error)
}

func NewPeggyContract

func NewPeggyContract(
	ethCommitter committer.EVMCommitter,
	peggyAddress common.Address,
) (PeggyContract, error)

Jump to

Keyboard shortcuts

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