types

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETHEREUM_SALT = "\x19Ethereum Signed Message:\n32"
	B32           = "bytes32"
	U256          = "uint256"
	U256Ary       = "uint256[]"
	Addr          = "address"
	AddrAry       = "address[]"
)

Variables

This section is empty.

Functions

func BytesCombine

func BytesCombine(pBytes ...[]byte) []byte

func EncodeTxBatchConfirm

func EncodeTxBatchConfirm(gravityId string, batch TransactionBatch) []byte

func EncodeTxBatchConfirmHashed

func EncodeTxBatchConfirmHashed(gravityId string, batch TransactionBatch) []byte

func EncodeValsetConfirm

func EncodeValsetConfirm(gravityId string, valset ValSet) []byte

func EncodeValsetConfirmHashed

func EncodeValsetConfirmHashed(gravityId string, valset ValSet) []byte

func GetEthereumMsgHash

func GetEthereumMsgHash(msg []byte) []byte

Types

type BatchConfirmResponse

type BatchConfirmResponse struct {
	Nonce          uint64
	Orchestrator   common.Address
	TokenContract  common.Address
	EthereumSigner common.Address
	EthSignature   EthSignature
}

func (BatchConfirmResponse) GetEthAddress

func (bcr BatchConfirmResponse) GetEthAddress() common.Address

func (BatchConfirmResponse) GetSignature

func (bcr BatchConfirmResponse) GetSignature() EthSignature

type BatchTransaction

type BatchTransaction struct {
	Id          uint64
	Sender      common.Address
	Destination common.Address
	Erc20Token  Erc20Token
	Erc20Fee    Erc20Token
}

type Confirm

type Confirm interface {
	GetEthAddress() common.Address
	GetSignature() EthSignature
}

type Erc20DeployedEvent

type Erc20DeployedEvent struct {
	CosmosDenom string
	Erc20       common.Address
	Name        string
	Symbol      string
	Decimals    uint8
	EventNonce  uint64
	BlockHeight uint64
}

func Erc20DeployedEventFilterByEventNonce

func Erc20DeployedEventFilterByEventNonce(lastEventNonce uint64, erc20Deploys []Erc20DeployedEvent) []Erc20DeployedEvent

func Erc20DeployedEventFromLog

func Erc20DeployedEventFromLog(log *web3.Log) (Erc20DeployedEvent, error)

func Erc20DeployedEventFromLogs

func Erc20DeployedEventFromLogs(log []*web3.Log) ([]Erc20DeployedEvent, error)

type Erc20Token

type Erc20Token struct {
	Amount               sdk.Int
	TokenContractAddress common.Address
}

type EthSignature

type EthSignature struct {
	V *big.Int
	R *big.Int
	S *big.Int
}

func FromBytesToEthSignature

func FromBytesToEthSignature(bz []byte) (EthSignature, error)

func (EthSignature) Ecreover

func (es EthSignature) Ecreover(hash []byte) (common.Address, error)

type GravitySignature

type GravitySignature struct {
	Power      uint64
	EthAddress common.Address
	V          *big.Int
	R          *big.Int
	S          *big.Int
}

type GravitySignatureArrays

type GravitySignatureArrays struct {
	Addresses []common.Address
	Powers    []uint64
	V         []uint8
	R         [][]byte
	S         [][]byte
}

func ToArrays

func ToArrays(signatures []GravitySignature) GravitySignatureArrays

type LogicCall

type LogicCall struct {
	Transfers            []Erc20Token
	Fees                 []Erc20Token
	LogicContractAddress common.Address
	PayLoad              []byte
	Timeout              uint64
	InvalidationId       []byte
	InvalidationNonce    uint64
}

type LogicCallConfirmResponse

type LogicCallConfirmResponse struct {
	InvalidationId    []byte
	InvalidationNonce uint64
	EthereumSigner    common.Address
	Orchestrator      common.Address
	EthSignature      EthSignature
}

func (LogicCallConfirmResponse) GetEthAddress

func (lcc LogicCallConfirmResponse) GetEthAddress() common.Address

func (LogicCallConfirmResponse) GetSignature

func (lcc LogicCallConfirmResponse) GetSignature() EthSignature

type LogicCallExecutedEvent

type LogicCallExecutedEvent struct {
	InvalidationId    []byte
	InvalidationNonce uint64
	ReturnData        []byte
	EventNonce        uint64
	BlockHeight       uint64
}

func LogicCallExecutedEventFilterByEventNonce

func LogicCallExecutedEventFilterByEventNonce(lastEventNonce uint64, logicCalls []LogicCallExecutedEvent) []LogicCallExecutedEvent

func LogicCallExecutedEventFromLog

func LogicCallExecutedEventFromLog(log *web3.Log) (LogicCallExecutedEvent, error)

unimplemented!

func LogicCallExecutedEventFromLogs

func LogicCallExecutedEventFromLogs(log []*web3.Log) ([]LogicCallExecutedEvent, error)

type SendToCosmosEvent

type SendToCosmosEvent struct {
	Erc20  common.Address
	Sender common.Address
	// cosmos-address
	Destination common.Address
	Amount      *big.Int
	EventNonce  uint64
	BlockHeight uint64
}

func SendToCosmosEventFilterByEventNonce

func SendToCosmosEventFilterByEventNonce(lastEventNonce uint64, deposits []SendToCosmosEvent) []SendToCosmosEvent

func SendToCosmosEventFromLog

func SendToCosmosEventFromLog(log *web3.Log) (SendToCosmosEvent, error)

func SendToCosmosEventFromLogs

func SendToCosmosEventFromLogs(log []*web3.Log) ([]SendToCosmosEvent, error)

type SignatureStatus

type SignatureStatus struct {
	OrderedSignatures          []GravitySignature
	PowerOfGoodSigs            uint64
	PowerOfUnsetKeys           uint64
	NumberOfUnsetKeyValidators uint64
	PowerOfNonvoters           uint64
	NumberOfNonvoters          uint64
	PowerOfInvalidSigners      uint64
	NumberOfInvalidSigners     uint64
	NumValidators              uint64
}

type TransactionBatch

type TransactionBatch struct {
	Nonce         uint64
	BatchTimeout  uint64
	Transactions  []BatchTransaction
	TotalFee      Erc20Token
	TokenContract common.Address
}

func (TransactionBatch) GetCheckPointValues

func (tb TransactionBatch) GetCheckPointValues() ([]*big.Int, []*big.Int, []string)

type TransactionBatchExecutedEvent

type TransactionBatchExecutedEvent struct {
	BatchNonce  uint64
	BlockHeight uint64
	Erc20       common.Address
	EventNonce  uint64
}

func TransactionBatchExecutedEventFilterByEventNonce

func TransactionBatchExecutedEventFilterByEventNonce(lastEventNonce uint64, withdraws []TransactionBatchExecutedEvent) []TransactionBatchExecutedEvent

func TransactionBatchExecutedEventFromLog

func TransactionBatchExecutedEventFromLog(log *web3.Log) (TransactionBatchExecutedEvent, error)

todo

func TransactionBatchExecutedEventFromLogs

func TransactionBatchExecutedEventFromLogs(log []*web3.Log) ([]TransactionBatchExecutedEvent, error)

type ValSet

type ValSet struct {
	Nonce   uint64
	Members []ValSetMember
}

func (ValSet) FilterEmptyAddress

func (v ValSet) FilterEmptyAddress() ([]string, []uint64)

func (ValSet) OrderSigs

func (v ValSet) OrderSigs(signedMsg []byte, sigs []Confirm) ([]GravitySignature, error)

type ValSetMember

type ValSetMember struct {
	Power      uint64
	EthAddress *common.Address
}

type ValSetUpdatedEvent

type ValSetUpdatedEvent struct {
	Nonce   uint64
	Members []ValSetMember
}

func ValSetUpdatedEventFromLog

func ValSetUpdatedEventFromLog(log *web3.Log) (ValSetUpdatedEvent, error)

func ValSetUpdatedEventFromLogs

func ValSetUpdatedEventFromLogs(log []*web3.Log) ([]ValSetUpdatedEvent, error)

type ValsetConfirmResponse

type ValsetConfirmResponse struct {
	Nonce        uint64
	Orchestrator common.Address
	EthAddress   common.Address
	Signature    EthSignature
}

func (ValsetConfirmResponse) GetEthAddress

func (vcr ValsetConfirmResponse) GetEthAddress() common.Address

func (ValsetConfirmResponse) GetSignature

func (vcr ValsetConfirmResponse) GetSignature() EthSignature

Jump to

Keyboard shortcuts

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