types

package
Version: v0.0.0-...-cfd398f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 43 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// OutgoingBatchTxCheckpointABIJSON checks the ETH ABI for compatability of the OutgoingBatchTx message
	OutgoingBatchTxCheckpointABIJSON = `` /* 839-byte string literal not displayed */

	// ValsetCheckpointABIJSON checks the ETH ABI for compatability of the Valset update message
	ValsetCheckpointABIJSON = `` /* 749-byte string literal not displayed */

	// OutgoingLogicCallABIJSON checks the ETH ABI for compatability of the logic call message
	OutgoingLogicCallABIJSON = `` /* 1153-byte string literal not displayed */

)
View Source
const (
	// GravityDenomPrefix indicates the prefix for all assests minted by this module
	GravityDenomPrefix = ModuleName

	// GravityDenomSeparator is the separator for gravity denoms
	GravityDenomSeparator = ""

	// ETHContractAddressLen is the length of contract address strings
	ETHContractAddressLen = 42

	// GravityDenomLen is the length of the denoms generated by the gravity module
	GravityDenomLen = len(GravityDenomPrefix) + len(GravityDenomSeparator) + ETHContractAddressLen

	// ZeroAddress is an EthAddress containing the zero ethereum address
	ZeroAddressString = "0x0000000000000000000000000000000000000000"
)
View Source
const (
	EventTypeObservation               = "observation"
	EventTypeOutgoingBatch             = "outgoing_batch"
	EventTypeMultisigUpdateRequest     = "multisig_update_request"
	EventTypeOutgoingBatchCanceled     = "outgoing_batch_canceled"
	EventTypeOutgoingLogicCallCanceled = "outgoing_logic_call_canceled"
	EventTypeBridgeWithdrawalReceived  = "withdrawal_received"
	EventTypeBridgeDepositReceived     = "deposit_received"
	EventTypeBridgeWithdrawCanceled    = "withdraw_canceled"

	AttributeKeyAttestationID          = "attestation_id"
	AttributeKeyBatchConfirmKey        = "batch_confirm_key"
	AttributeKeyValsetConfirmKey       = "valset_confirm_key"
	AttributeKeyMultisigID             = "multisig_id"
	AttributeKeyOutgoingBatchID        = "batch_id"
	AttributeKeyOutgoingTXID           = "outgoing_tx_id"
	AttributeKeyAttestationType        = "attestation_type"
	AttributeKeyContract               = "bridge_contract"
	AttributeKeyNonce                  = "nonce"
	AttributeKeyValsetNonce            = "valset_nonce"
	AttributeKeyBatchNonce             = "batch_nonce"
	AttributeKeyBridgeChainID          = "bridge_chain_id"
	AttributeKeySetOperatorAddr        = "set_operator_address"
	AttributeKeyInvalidationID         = "logic_call_invalidation_id"
	AttributeKeyInvalidationNonce      = "logic_call_invalidation_nonce"
	AttributeKeyBadEthSignature        = "bad_eth_signature"
	AttributeKeyBadEthSignatureSubject = "bad_eth_signature_subject"
)
View Source
const (
	// ModuleName is the name of the module
	ModuleName = "gravity"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey is the module name router key
	RouterKey = ModuleName

	// QuerierRoute to be used for querierer msgs
	QuerierRoute = ModuleName
)
View Source
const (
	// todo: implement oracle constants as params
	DefaultParamspace = ModuleName
)

DefaultParamspace defines the default auth module parameter subspace

View Source
const (
	TypeMsgBatchSendToEthClaim = "batch_send_to_eth_claim"
)
View Source
const (
	TypeMsgSendToCosmosClaim = "send_to_cosmos_claim"
)

Variables

View Source
var (
	ErrInvalidLengthAttestation        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAttestation          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAttestation = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthBatch        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBatch          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBatch = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInternal                = sdkerrors.Register(ModuleName, 1, "internal")
	ErrDuplicate               = sdkerrors.Register(ModuleName, 2, "duplicate")
	ErrInvalid                 = sdkerrors.Register(ModuleName, 3, "invalid")
	ErrTimeout                 = sdkerrors.Register(ModuleName, 4, "timeout")
	ErrUnknown                 = sdkerrors.Register(ModuleName, 5, "unknown")
	ErrEmpty                   = sdkerrors.Register(ModuleName, 6, "empty")
	ErrOutdated                = sdkerrors.Register(ModuleName, 7, "outdated")
	ErrUnsupported             = sdkerrors.Register(ModuleName, 8, "unsupported")
	ErrNonContiguousEventNonce = sdkerrors.Register(ModuleName, 9, "non contiguous event nonce")
	ErrResetDelegateKeys       = sdkerrors.Register(ModuleName, 10, "can not set orchestrator addresses more than once")
	ErrMismatched              = sdkerrors.Register(ModuleName, 11, "mismatched")
)
View Source
var (
	// AttestationVotesPowerThreshold threshold of votes power to succeed
	AttestationVotesPowerThreshold = sdk.NewInt(66)

	// ParamsStoreKeyGravityID stores the gravity id
	ParamsStoreKeyGravityID = []byte("GravityID")

	// ParamsStoreKeyContractHash stores the contract hash
	ParamsStoreKeyContractHash = []byte("ContractHash")

	// ParamsStoreKeyBridgeContractAddress stores the contract address
	ParamsStoreKeyBridgeContractAddress = []byte("BridgeContractAddress")

	// ParamsStoreKeyBridgeContractChainID stores the bridge chain id
	ParamsStoreKeyBridgeContractChainID = []byte("BridgeChainID")

	// ParamsStoreKeySignedValsetsWindow stores the signed blocks window
	ParamsStoreKeySignedValsetsWindow = []byte("SignedValsetsWindow")

	// ParamsStoreKeySignedBatchesWindow stores the signed blocks window
	ParamsStoreKeySignedBatchesWindow = []byte("SignedBatchesWindow")

	// ParamsStoreKeySignedLogicCallsWindow stores the signed blocks window
	ParamsStoreKeySignedLogicCallsWindow = []byte("SignedLogicCallsWindow")

	// ParamsStoreKeySignedClaimsWindow stores the signed blocks window
	ParamsStoreKeyTargetBatchTimeout = []byte("TargetBatchTimeout")

	// ParamsStoreKeySignedClaimsWindow stores the signed blocks window
	ParamsStoreKeyAverageBlockTime = []byte("AverageBlockTime")

	// ParamsStoreKeySignedClaimsWindow stores the signed blocks window
	ParamsStoreKeyAverageEthereumBlockTime = []byte("AverageEthereumBlockTime")

	// ParamsStoreSlashFractionValset stores the slash fraction valset
	ParamsStoreSlashFractionValset = []byte("SlashFractionValset")

	// ParamsStoreSlashFractionBatch stores the slash fraction Batch
	ParamsStoreSlashFractionBatch = []byte("SlashFractionBatch")

	// ParamStoreUnbondSlashingValsetsWindow stores unbond slashing valset window
	ParamStoreUnbondSlashingValsetsWindow = []byte("UnbondSlashingValsetsWindow")

	// ParamStoreSlashFractionBadEthSignature stores the amount by which a validator making a fraudulent eth signature will be slashed
	ParamStoreSlashFractionBadEthSignature = []byte("SlashFractionBadEthSignature")

	// ValsetRewardAmount the amount of the coin, both denom and amount to issue
	// to a relayer when they relay a valset
	ParamStoreValsetRewardAmount = []byte("ValsetReward")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// EthAddressByValidatorKey indexes cosmos validator account addresses
	// i.e. cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn
	EthAddressByValidatorKey = []byte{0x1}

	// ValidatorByEthAddressKey indexes ethereum addresses
	// i.e. 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B
	ValidatorByEthAddressKey = []byte{0x2}

	// ValsetRequestKey indexes valset requests by nonce
	ValsetRequestKey = []byte{0x3}

	// ValsetConfirmKey indexes valset confirmations by nonce and the validator account address
	// i.e cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn
	ValsetConfirmKey = []byte{0x4}

	// OracleClaimKey Claim details by nonce and validator address
	// i.e. cosmosvaloper1ahx7f8wyertuus9r20284ej0asrs085case3kn
	// A claim is named more intuitively than an Attestation, it is literally
	// a validator making a claim to have seen something happen. Claims are
	// attached to attestations which can be thought of as 'the event' that
	// will eventually be executed.
	OracleClaimKey = []byte{0x5}

	// OracleAttestationKey attestation details by nonce and validator address
	// i.e. cosmosvaloper1ahx7f8wyertuus9r20284ej0asrs085case3kn
	// An attestation can be thought of as the 'event to be executed' while
	// the Claims are an individual validator saying that they saw an event
	// occur the Attestation is 'the event' that multiple claims vote on and
	// eventually executes
	OracleAttestationKey = []byte{0x6}

	// OutgoingTXPoolKey indexes the last nonce for the outgoing tx pool
	OutgoingTXPoolKey = []byte{0x7}

	// DenomiatorPrefix indexes token contract addresses from ETH on gravity
	DenomiatorPrefix = []byte{0x8}

	// OutgoingTXBatchKey indexes outgoing tx batches under a nonce and token address
	OutgoingTXBatchKey = []byte{0xa}

	// OutgoingTXBatchBlockKey indexes outgoing tx batches under a block height and token address
	OutgoingTXBatchBlockKey = []byte{0xb}

	// BatchConfirmKey indexes validator confirmations by token contract address
	BatchConfirmKey = []byte{0xc}

	// SecondIndexNonceByClaimKey indexes latest nonce for a given claim type
	SecondIndexNonceByClaimKey = []byte{0xd}

	// LastEventNonceByValidatorKey indexes lateset event nonce by validator
	LastEventNonceByValidatorKey = []byte{0xe}

	// LastObservedEventNonceKey indexes the latest event nonce
	LastObservedEventNonceKey = []byte{0xf}

	// SequenceKeyPrefix indexes different txids
	SequenceKeyPrefix = []byte{0x10}

	// KeyLastTXPoolID indexes the lastTxPoolID
	KeyLastTXPoolID = append(SequenceKeyPrefix, []byte("lastTxPoolId")...)

	// KeyLastOutgoingBatchID indexes the lastBatchID
	KeyLastOutgoingBatchID = append(SequenceKeyPrefix, []byte("lastBatchId")...)

	// KeyOrchestratorAddress indexes the validator keys for an orchestrator
	KeyOrchestratorAddress = []byte{0x11}

	// KeyOutgoingLogicCall indexes the outgoing logic calls
	KeyOutgoingLogicCall = []byte{0x12}

	// KeyOutgoingLogicConfirm indexes the outgoing logic confirms
	KeyOutgoingLogicConfirm = []byte{0x13}

	// LastObservedEthereumBlockHeightKey indexes the latest Ethereum block height
	LastObservedEthereumBlockHeightKey = []byte{0x14}

	// DenomToERC20Key prefixes the index of Cosmos originated asset denoms to ERC20s
	DenomToERC20Key = []byte{0x15}

	// ERC20ToDenomKey prefixes the index of Cosmos originated assets ERC20s to denoms
	ERC20ToDenomKey = []byte{0x16}

	// LastSlashedValsetNonce indexes the latest slashed valset nonce
	LastSlashedValsetNonce = []byte{0x17}

	// LatestValsetNonce indexes the latest valset nonce
	LatestValsetNonce = []byte{0x18}

	// LastSlashedBatchBlock indexes the latest slashed batch block height
	LastSlashedBatchBlock = []byte{0x19}

	// LastSlashedLogicCallBlock indexes the latest slashed logic call block height
	LastSlashedLogicCallBlock = []byte{0x20}

	// LastUnBondingBlockHeight indexes the last validator unbonding block height
	LastUnBondingBlockHeight = []byte{0xf8}

	// LastObservedValsetNonceKey indexes the latest observed valset nonce
	// HERE THERE BE DRAGONS, do not use this value as an up to date validator set
	// on Ethereum it will always lag significantly and may be totally wrong at some
	// times.
	LastObservedValsetKey = []byte{0xfa}

	// PastEthSignatureCheckpointKey indexes eth signature checkpoints that have existed
	PastEthSignatureCheckpointKey = []byte{0x1b}
)
View Source
var (
	ErrInvalidLengthMsgs        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsgs          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPool        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPool          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPool = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ClaimType_name = map[int32]string{
	0: "CLAIM_TYPE_UNSPECIFIED",
	1: "CLAIM_TYPE_SEND_TO_COSMOS",
	2: "CLAIM_TYPE_BATCH_SEND_TO_ETH",
	3: "CLAIM_TYPE_ERC20_DEPLOYED",
	4: "CLAIM_TYPE_LOGIC_CALL_EXECUTED",
	5: "CLAIM_TYPE_VALSET_UPDATED",
}
View Source
var ClaimType_value = map[string]int32{
	"CLAIM_TYPE_UNSPECIFIED":         0,
	"CLAIM_TYPE_SEND_TO_COSMOS":      1,
	"CLAIM_TYPE_BATCH_SEND_TO_ETH":   2,
	"CLAIM_TYPE_ERC20_DEPLOYED":      3,
	"CLAIM_TYPE_LOGIC_CALL_EXECUTED": 4,
	"CLAIM_TYPE_VALSET_UPDATED":      5,
}
View Source
var ModuleCdc = codec.NewLegacyAmino()

ModuleCdc is the codec for the module

View Source
var SignType_name = map[int32]string{
	0: "SIGN_TYPE_UNSPECIFIED",
	1: "SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE",
	2: "SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH",
}
View Source
var SignType_value = map[string]int32{
	"SIGN_TYPE_UNSPECIFIED":                          0,
	"SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE": 1,
	"SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH":   2,
}

Functions

func EthAddrLessThan

func EthAddrLessThan(e EthAddress, o EthAddress) bool

EthAddrLessThan migrates the Ethereum address less than function

func GetAttestationKey

func GetAttestationKey(eventNonce uint64, claimHash []byte) []byte

GetAttestationKey returns the following key format prefix nonce claim-details-hash [0x5][0 0 0 0 0 0 0 1][fd1af8cec6c67fcf156f1b61fdf91ebc04d05484d007436e75342fc05bbff35a] An attestation is an event multiple people are voting on, this function needs the claim details because each Attestation is aggregating all claims of a specific event, lets say validator X and validator y where making different claims about the same event nonce Note that the claim hash does NOT include the claimer address and only identifies an event

func GetBatchConfirmKey

func GetBatchConfirmKey(tokenContract EthAddress, batchNonce uint64, validator sdk.AccAddress) []byte

GetBatchConfirmKey returns the following key format prefix eth-contract-address BatchNonce Validator-address [0xe1][0xc783df8a850f42e7F7e57013759C285caa701eB6][0 0 0 0 0 0 0 1][cosmosvaloper1ahx7f8wyertuus9r20284ej0asrs085case3kn] TODO this should be a sdk.ValAddress

func GetClaimKey

func GetClaimKey(details EthereumClaim) []byte

GetClaimKey returns the following key format prefix type cosmos-validator-address nonce attestation-details-hash [0x0][0 0 0 1][cosmosvaloper1ahx7f8wyertuus9r20284ej0asrs085case3kn][0 0 0 0 0 0 0 1][fd1af8cec6c67fcf156f1b61fdf91ebc04d05484d007436e75342fc05bbff35a] The Claim hash identifies a unique event, for example it would have a event nonce, a sender and a receiver. Or an event nonce and a batch nonce. But the Claim is stored indexed with the claimer key to make sure that it is unique.

func GetDenomToERC20Key

func GetDenomToERC20Key(denom string) []byte

func GetERC20ToDenomKey

func GetERC20ToDenomKey(erc20 EthAddress) []byte

func GetEthAddressByValidatorKey

func GetEthAddressByValidatorKey(validator sdk.ValAddress) []byte

GetEthAddressByValidatorKey returns the following key format prefix cosmos-validator [0x0][cosmosvaloper1ahx7f8wyertuus9r20284ej0asrs085case3kn]

func GetLastEventNonceByValidatorKey

func GetLastEventNonceByValidatorKey(validator sdk.ValAddress) []byte

GetLastEventNonceByValidatorKey indexes lateset event nonce by validator GetLastEventNonceByValidatorKey returns the following key format prefix cosmos-validator [0x0][cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn]

func GetLogicConfirmKey

func GetLogicConfirmKey(invalidationId []byte, invalidationNonce uint64, validator sdk.AccAddress) []byte

func GetOrchestratorAddressKey

func GetOrchestratorAddressKey(orc sdk.AccAddress) []byte

GetOrchestratorAddressKey returns the following key format prefix [0xe8][cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn]

func GetOutgoingLogicCallKey

func GetOutgoingLogicCallKey(invalidationId []byte, invalidationNonce uint64) []byte

func GetOutgoingTxBatchBlockKey

func GetOutgoingTxBatchBlockKey(block uint64) []byte

GetOutgoingTxBatchBlockKey returns the following key format prefix blockheight [0xb][0 0 0 0 2 1 4 3]

func GetOutgoingTxBatchKey

func GetOutgoingTxBatchKey(tokenContract EthAddress, nonce uint64) []byte

GetOutgoingTxBatchKey returns the following key format prefix nonce eth-contract-address [0xa][0 0 0 0 0 0 0 1][0xc783df8a850f42e7F7e57013759C285caa701eB6]

func GetOutgoingTxPoolContractPrefix

func GetOutgoingTxPoolContractPrefix(contractAddress EthAddress) []byte

GetOutgoingTxPoolContractPrefix returns the following key format prefix feeContract [0x6][0xc783df8a850f42e7F7e57013759C285caa701eB6] This prefix is used for iterating over unbatched transactions for a given contract

func GetOutgoingTxPoolKey

func GetOutgoingTxPoolKey(fee InternalERC20Token, id uint64) []byte

GetOutgoingTxPoolKey returns the following key format prefix feeContract feeAmount id [0x6][0xc783df8a850f42e7F7e57013759C285caa701eB6][1000000000][0 0 0 0 0 0 0 1]

func GetPastEthSignatureCheckpointKey

func GetPastEthSignatureCheckpointKey(checkpoint []byte) []byte

GetPastEthSignatureCheckpointKey returns the following key format prefix checkpoint [0x0][ checkpoint bytes ]

func GetValidatorByEthAddressKey

func GetValidatorByEthAddressKey(ethAddress EthAddress) []byte

GetValidatorByEthAddressKey returns the following key format prefix cosmos-validator [0xf9][0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B]

func GetValsetConfirmKey

func GetValsetConfirmKey(nonce uint64, validator sdk.AccAddress) []byte

GetValsetConfirmKey returns the following key format prefix nonce validator-address [0x0][0 0 0 0 0 0 0 1][cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn] MARK finish-batches: this is where the key is created in the old (presumed working) code

func GetValsetKey

func GetValsetKey(nonce uint64) []byte

GetValsetKey returns the following key format prefix nonce [0x0][0 0 0 0 0 0 0 1]

func GravityDenom

func GravityDenom(tokenContract EthAddress) string

GravityDenom converts an EthAddress to a gravity cosmos denom

func NewEthereumSignature

func NewEthereumSignature(hash []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

NewEthereumSignature creates a new signuature over a given byte array

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for auth module

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

nolint: exhaustivestruct RegisterCodec registers concrete types on the Amino codec

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

nolint: exhaustivestruct RegisterInterfaces registers the interfaces for the proto stuff

func RegisterMsgHandler

func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

RegisterMsgHandlerClient registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MsgClient" to call the correct interceptors.

func RegisterMsgHandlerFromEndpoint

func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMsgHandlerServer

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func UInt64Bytes

func UInt64Bytes(n uint64) []byte

UInt64Bytes uses the SDK byte marshaling to encode a uint64

func UInt64FromBytes

func UInt64FromBytes(s []byte) uint64

UInt64FromBytes create uint from binary big endian representation

func UInt64FromString

func UInt64FromString(s string) (uint64, error)

UInt64FromString to parse out a uint64 for a nonce

func ValidateEthAddress

func ValidateEthAddress(address string) error

Validates the input string as an Ethereum Address Addresses must not be empty, have 42 character length, start with 0x and have 40 remaining characters in [0-9a-fA-F]

func ValidateEthereumSignature

func ValidateEthereumSignature(hash []byte, signature []byte, ethAddress EthAddress) error

ValidateEthereumSignature takes a message, an associated signature and public key and returns an error if the signature isn't valid

Types

type Attestation

type Attestation struct {
	Observed bool       `protobuf:"varint,1,opt,name=observed,proto3" json:"observed,omitempty"`
	Votes    []string   `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes,omitempty"`
	Height   uint64     `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
	Claim    *types.Any `protobuf:"bytes,4,opt,name=claim,proto3" json:"claim,omitempty"`
}

Attestation is an aggregate of `claims` that eventually becomes `observed` by all orchestrators EVENT_NONCE: EventNonce a nonce provided by the gravity contract that is unique per event fired These event nonces must be relayed in order. This is a correctness issue, if relaying out of order transaction replay attacks become possible OBSERVED: Observed indicates that >67% of validators have attested to the event, and that the event should be executed by the gravity state machine

The actual content of the claims is passed in with the transaction making the claim and then passed through the call stack alongside the attestation while it is processed the key in which the attestation is stored is keyed on the exact details of the claim but there is no reason to store those exact details becuause the next message sender will kindly provide you with them.

func (*Attestation) Descriptor

func (*Attestation) Descriptor() ([]byte, []int)

func (*Attestation) GetClaim

func (m *Attestation) GetClaim() *types.Any

func (*Attestation) GetHeight

func (m *Attestation) GetHeight() uint64

func (*Attestation) GetObserved

func (m *Attestation) GetObserved() bool

func (*Attestation) GetVotes

func (m *Attestation) GetVotes() []string

func (*Attestation) Marshal

func (m *Attestation) Marshal() (dAtA []byte, err error)

func (*Attestation) MarshalTo

func (m *Attestation) MarshalTo(dAtA []byte) (int, error)

func (*Attestation) MarshalToSizedBuffer

func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Attestation) ProtoMessage

func (*Attestation) ProtoMessage()

func (*Attestation) Reset

func (m *Attestation) Reset()

func (*Attestation) Size

func (m *Attestation) Size() (n int)

func (*Attestation) String

func (m *Attestation) String() string

func (*Attestation) Unmarshal

func (m *Attestation) Unmarshal(dAtA []byte) error

func (*Attestation) XXX_DiscardUnknown

func (m *Attestation) XXX_DiscardUnknown()

func (*Attestation) XXX_Marshal

func (m *Attestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Attestation) XXX_Merge

func (m *Attestation) XXX_Merge(src proto.Message)

func (*Attestation) XXX_Size

func (m *Attestation) XXX_Size() int

func (*Attestation) XXX_Unmarshal

func (m *Attestation) XXX_Unmarshal(b []byte) error

type BankKeeper

type BankKeeper interface {
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetDenomMetaData(ctx sdk.Context, denom string) bank.Metadata
}

BankKeeper defines the expected bank keeper methods

type BatchFees

type BatchFees struct {
	Token     string                                 `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	TotalFees github_com_cosmos_cosmos_sdk_types.Int `` /* 128-byte string literal not displayed */
}

func (*BatchFees) Descriptor

func (*BatchFees) Descriptor() ([]byte, []int)

func (*BatchFees) GetToken

func (m *BatchFees) GetToken() string

func (*BatchFees) Marshal

func (m *BatchFees) Marshal() (dAtA []byte, err error)

func (*BatchFees) MarshalTo

func (m *BatchFees) MarshalTo(dAtA []byte) (int, error)

func (*BatchFees) MarshalToSizedBuffer

func (m *BatchFees) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BatchFees) ProtoMessage

func (*BatchFees) ProtoMessage()

func (*BatchFees) Reset

func (m *BatchFees) Reset()

func (*BatchFees) Size

func (m *BatchFees) Size() (n int)

func (*BatchFees) String

func (m *BatchFees) String() string

func (*BatchFees) Unmarshal

func (m *BatchFees) Unmarshal(dAtA []byte) error

func (*BatchFees) XXX_DiscardUnknown

func (m *BatchFees) XXX_DiscardUnknown()

func (*BatchFees) XXX_Marshal

func (m *BatchFees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BatchFees) XXX_Merge

func (m *BatchFees) XXX_Merge(src proto.Message)

func (*BatchFees) XXX_Size

func (m *BatchFees) XXX_Size() int

func (*BatchFees) XXX_Unmarshal

func (m *BatchFees) XXX_Unmarshal(b []byte) error

type BridgeValidator

type BridgeValidator struct {
	Power           uint64 `protobuf:"varint,1,opt,name=power,proto3" json:"power,omitempty"`
	EthereumAddress string `protobuf:"bytes,2,opt,name=ethereum_address,json=ethereumAddress,proto3" json:"ethereum_address,omitempty"`
}

BridgeValidator represents a validator's ETH address and its power

func (*BridgeValidator) Descriptor

func (*BridgeValidator) Descriptor() ([]byte, []int)

func (*BridgeValidator) GetEthereumAddress

func (m *BridgeValidator) GetEthereumAddress() string

func (*BridgeValidator) GetPower

func (m *BridgeValidator) GetPower() uint64

func (*BridgeValidator) Marshal

func (m *BridgeValidator) Marshal() (dAtA []byte, err error)

func (*BridgeValidator) MarshalTo

func (m *BridgeValidator) MarshalTo(dAtA []byte) (int, error)

func (*BridgeValidator) MarshalToSizedBuffer

func (m *BridgeValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BridgeValidator) ProtoMessage

func (*BridgeValidator) ProtoMessage()

func (*BridgeValidator) Reset

func (m *BridgeValidator) Reset()

func (*BridgeValidator) Size

func (m *BridgeValidator) Size() (n int)

func (*BridgeValidator) String

func (m *BridgeValidator) String() string

func (BridgeValidator) ToInternal

func (b BridgeValidator) ToInternal() (*InternalBridgeValidator, error)

ToInternal transforms a BridgeValidator into its fully validated internal type

func (*BridgeValidator) Unmarshal

func (m *BridgeValidator) Unmarshal(dAtA []byte) error

func (*BridgeValidator) XXX_DiscardUnknown

func (m *BridgeValidator) XXX_DiscardUnknown()

func (*BridgeValidator) XXX_Marshal

func (m *BridgeValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BridgeValidator) XXX_Merge

func (m *BridgeValidator) XXX_Merge(src proto.Message)

func (*BridgeValidator) XXX_Size

func (m *BridgeValidator) XXX_Size() int

func (*BridgeValidator) XXX_Unmarshal

func (m *BridgeValidator) XXX_Unmarshal(b []byte) error

type BridgeValidators

type BridgeValidators []*BridgeValidator

BridgeValidators is the sorted set of validator data for Ethereum bridge MultiSig set

func (BridgeValidators) ToInternal

func (b BridgeValidators) ToInternal() (*InternalBridgeValidators, error)

type ClaimType

type ClaimType int32
const (
	CLAIM_TYPE_UNSPECIFIED         ClaimType = 0
	CLAIM_TYPE_SEND_TO_COSMOS      ClaimType = 1
	CLAIM_TYPE_BATCH_SEND_TO_ETH   ClaimType = 2
	CLAIM_TYPE_ERC20_DEPLOYED      ClaimType = 3
	CLAIM_TYPE_LOGIC_CALL_EXECUTED ClaimType = 4
	CLAIM_TYPE_VALSET_UPDATED      ClaimType = 5
)

func (ClaimType) EnumDescriptor

func (ClaimType) EnumDescriptor() ([]byte, []int)

func (ClaimType) String

func (x ClaimType) String() string

type ERC20ToDenom

type ERC20ToDenom struct {
	Erc20 string `protobuf:"bytes,1,opt,name=erc20,proto3" json:"erc20,omitempty"`
	Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"`
}

This records the relationship between an ERC20 token and the denom of the corresponding Cosmos originated asset

func (*ERC20ToDenom) Descriptor

func (*ERC20ToDenom) Descriptor() ([]byte, []int)

func (*ERC20ToDenom) GetDenom

func (m *ERC20ToDenom) GetDenom() string

func (*ERC20ToDenom) GetErc20

func (m *ERC20ToDenom) GetErc20() string

func (*ERC20ToDenom) Marshal

func (m *ERC20ToDenom) Marshal() (dAtA []byte, err error)

func (*ERC20ToDenom) MarshalTo

func (m *ERC20ToDenom) MarshalTo(dAtA []byte) (int, error)

func (*ERC20ToDenom) MarshalToSizedBuffer

func (m *ERC20ToDenom) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ERC20ToDenom) ProtoMessage

func (*ERC20ToDenom) ProtoMessage()

func (*ERC20ToDenom) Reset

func (m *ERC20ToDenom) Reset()

func (*ERC20ToDenom) Size

func (m *ERC20ToDenom) Size() (n int)

func (*ERC20ToDenom) String

func (m *ERC20ToDenom) String() string

func (*ERC20ToDenom) Unmarshal

func (m *ERC20ToDenom) Unmarshal(dAtA []byte) error

func (*ERC20ToDenom) XXX_DiscardUnknown

func (m *ERC20ToDenom) XXX_DiscardUnknown()

func (*ERC20ToDenom) XXX_Marshal

func (m *ERC20ToDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ERC20ToDenom) XXX_Merge

func (m *ERC20ToDenom) XXX_Merge(src proto.Message)

func (*ERC20ToDenom) XXX_Size

func (m *ERC20ToDenom) XXX_Size() int

func (*ERC20ToDenom) XXX_Unmarshal

func (m *ERC20ToDenom) XXX_Unmarshal(b []byte) error

type ERC20Token

type ERC20Token struct {
	Contract string                                 `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	Amount   github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

ERC20Token unique identifier for an Ethereum ERC20 token. CONTRACT: The contract address on ETH of the token, this could be a Cosmos originated token, if so it will be the ERC20 address of the representation (note: developers should look up the token symbol using the address on ETH to display for UI)

func NewERC20Token

func NewERC20Token(amount uint64, contract string) *ERC20Token

NewERC20Token returns a new instance of an ERC20

func NewSDKIntERC20Token

func NewSDKIntERC20Token(amount sdk.Int, contract string) *ERC20Token

NewSDKIntERC20Token returns a new instance of an ERC20, accepting a sdk.Int

func (*ERC20Token) Descriptor

func (*ERC20Token) Descriptor() ([]byte, []int)

func (*ERC20Token) GetContract

func (m *ERC20Token) GetContract() string

func (*ERC20Token) Marshal

func (m *ERC20Token) Marshal() (dAtA []byte, err error)

func (*ERC20Token) MarshalTo

func (m *ERC20Token) MarshalTo(dAtA []byte) (int, error)

func (*ERC20Token) MarshalToSizedBuffer

func (m *ERC20Token) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ERC20Token) ProtoMessage

func (*ERC20Token) ProtoMessage()

func (*ERC20Token) Reset

func (m *ERC20Token) Reset()

func (*ERC20Token) Size

func (m *ERC20Token) Size() (n int)

func (*ERC20Token) String

func (m *ERC20Token) String() string

func (ERC20Token) ToInternal

func (e ERC20Token) ToInternal() (*InternalERC20Token, error)

ToInternal converts an ERC20Token to the internal type InternalERC20Token

func (*ERC20Token) Unmarshal

func (m *ERC20Token) Unmarshal(dAtA []byte) error

func (*ERC20Token) ValidateBasic

func (e *ERC20Token) ValidateBasic() error

ValidateBasic permforms stateless validation

func (*ERC20Token) XXX_DiscardUnknown

func (m *ERC20Token) XXX_DiscardUnknown()

func (*ERC20Token) XXX_Marshal

func (m *ERC20Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ERC20Token) XXX_Merge

func (m *ERC20Token) XXX_Merge(src proto.Message)

func (*ERC20Token) XXX_Size

func (m *ERC20Token) XXX_Size() int

func (*ERC20Token) XXX_Unmarshal

func (m *ERC20Token) XXX_Unmarshal(b []byte) error

type EthAddress

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

Regular EthAddress

func EthAddressFromSignature

func EthAddressFromSignature(hash []byte, signature []byte) (*EthAddress, error)

func GravityDenomToERC20

func GravityDenomToERC20(denom string) (*EthAddress, error)

GravityDenomToERC20 converts a gravity cosmos denom to an EthAddress

func NewEthAddress

func NewEthAddress(address string) (*EthAddress, error)

Creates a new EthAddress from a string, performing validation and returning any validation errors

func ZeroAddress

func ZeroAddress() *EthAddress

Returns a new EthAddress with 0x0000000000000000000000000000000000000000 as the wrapped address

func (EthAddress) GetAddress

func (ea EthAddress) GetAddress() string

Returns the contained address as a string

func (EthAddress) SetAddress

func (ea EthAddress) SetAddress(address string) error

Sets the contained address, performing validation before updating the value

func (EthAddress) ValidateBasic

func (ea EthAddress) ValidateBasic() error

Performs validation on the wrapped string

type EthereumClaim

type EthereumClaim interface {
	// All Ethereum claims that we relay from the Gravity contract and into the module
	// have a nonce that is monotonically increasing and unique, since this nonce is
	// issued by the Ethereum contract it is immutable and must be agreed on by all validators
	// any disagreement on what claim goes to what nonce means someone is lying.
	GetEventNonce() uint64
	// The block height that the claimed event occurred on. This EventNonce provides sufficient
	// ordering for the execution of all claims. The block height is used only for batchTimeouts + logicTimeouts
	// when we go to create a new batch we set the timeout some number of batches out from the last
	// known height plus projected block progress since then.
	GetBlockHeight() uint64
	// the delegate address of the claimer, for MsgDepositClaim and MsgWithdrawClaim
	// this is sent in as the sdk.AccAddress of the delegated key. it is up to the user
	// to disambiguate this into a sdk.ValAddress
	GetClaimer() sdk.AccAddress
	// Which type of claim this is
	GetType() ClaimType
	ValidateBasic() error
	// The claim hash of this claim. This is used to store these claims and also used to check if two different
	// validators claims agree. Therefore it's extremely important that this include all elements of the claim
	// with the exception of the orchestrator who sent it in, which will be used as a different part of the index
	ClaimHash() ([]byte, error)
}

EthereumClaim represents a claim on ethereum state

type EthereumSigned

type EthereumSigned interface {
	GetCheckpoint(gravityIDstring string) []byte
}

This interface is implemented by all the types that are used to create transactions on Ethereum that are signed by validators. The naming here could be improved.

type GenesisState

type GenesisState struct {
	Params             *Params                      `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
	LastObservedNonce  uint64                       `protobuf:"varint,2,opt,name=last_observed_nonce,json=lastObservedNonce,proto3" json:"last_observed_nonce,omitempty"`
	Valsets            []*Valset                    `protobuf:"bytes,3,rep,name=valsets,proto3" json:"valsets,omitempty"`
	ValsetConfirms     []*MsgValsetConfirm          `protobuf:"bytes,4,rep,name=valset_confirms,json=valsetConfirms,proto3" json:"valset_confirms,omitempty"`
	Batches            []*OutgoingTxBatch           `protobuf:"bytes,5,rep,name=batches,proto3" json:"batches,omitempty"`
	BatchConfirms      []MsgConfirmBatch            `protobuf:"bytes,6,rep,name=batch_confirms,json=batchConfirms,proto3" json:"batch_confirms"`
	LogicCalls         []*OutgoingLogicCall         `protobuf:"bytes,7,rep,name=logic_calls,json=logicCalls,proto3" json:"logic_calls,omitempty"`
	LogicCallConfirms  []MsgConfirmLogicCall        `protobuf:"bytes,8,rep,name=logic_call_confirms,json=logicCallConfirms,proto3" json:"logic_call_confirms"`
	Attestations       []Attestation                `protobuf:"bytes,9,rep,name=attestations,proto3" json:"attestations"`
	DelegateKeys       []*MsgSetOrchestratorAddress `protobuf:"bytes,10,rep,name=delegate_keys,json=delegateKeys,proto3" json:"delegate_keys,omitempty"`
	Erc20ToDenoms      []*ERC20ToDenom              `protobuf:"bytes,11,rep,name=erc20_to_denoms,json=erc20ToDenoms,proto3" json:"erc20_to_denoms,omitempty"`
	UnbatchedTransfers []*OutgoingTransferTx        `protobuf:"bytes,12,rep,name=unbatched_transfers,json=unbatchedTransfers,proto3" json:"unbatched_transfers,omitempty"`
}

GenesisState struct

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns empty genesis state TODO: set some better defaults here

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAttestations

func (m *GenesisState) GetAttestations() []Attestation

func (*GenesisState) GetBatchConfirms

func (m *GenesisState) GetBatchConfirms() []MsgConfirmBatch

func (*GenesisState) GetBatches

func (m *GenesisState) GetBatches() []*OutgoingTxBatch

func (*GenesisState) GetDelegateKeys

func (m *GenesisState) GetDelegateKeys() []*MsgSetOrchestratorAddress

func (*GenesisState) GetErc20ToDenoms

func (m *GenesisState) GetErc20ToDenoms() []*ERC20ToDenom

func (*GenesisState) GetLastObservedNonce

func (m *GenesisState) GetLastObservedNonce() uint64

func (*GenesisState) GetLogicCallConfirms

func (m *GenesisState) GetLogicCallConfirms() []MsgConfirmLogicCall

func (*GenesisState) GetLogicCalls

func (m *GenesisState) GetLogicCalls() []*OutgoingLogicCall

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() *Params

func (*GenesisState) GetUnbatchedTransfers

func (m *GenesisState) GetUnbatchedTransfers() []*OutgoingTransferTx

func (*GenesisState) GetValsetConfirms

func (m *GenesisState) GetValsetConfirms() []*MsgValsetConfirm

func (*GenesisState) GetValsets

func (m *GenesisState) GetValsets() []*Valset

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) ValidateBasic

func (s GenesisState) ValidateBasic() error

ValidateBasic validates genesis state by looping through the params and calling their validation functions

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type IDSet

type IDSet struct {
	Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
}

IDSet represents a set of IDs

func (*IDSet) Descriptor

func (*IDSet) Descriptor() ([]byte, []int)

func (*IDSet) GetIds

func (m *IDSet) GetIds() []uint64

func (*IDSet) Marshal

func (m *IDSet) Marshal() (dAtA []byte, err error)

func (*IDSet) MarshalTo

func (m *IDSet) MarshalTo(dAtA []byte) (int, error)

func (*IDSet) MarshalToSizedBuffer

func (m *IDSet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IDSet) ProtoMessage

func (*IDSet) ProtoMessage()

func (*IDSet) Reset

func (m *IDSet) Reset()

func (*IDSet) Size

func (m *IDSet) Size() (n int)

func (*IDSet) String

func (m *IDSet) String() string

func (*IDSet) Unmarshal

func (m *IDSet) Unmarshal(dAtA []byte) error

func (*IDSet) XXX_DiscardUnknown

func (m *IDSet) XXX_DiscardUnknown()

func (*IDSet) XXX_Marshal

func (m *IDSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IDSet) XXX_Merge

func (m *IDSet) XXX_Merge(src proto.Message)

func (*IDSet) XXX_Size

func (m *IDSet) XXX_Size() int

func (*IDSet) XXX_Unmarshal

func (m *IDSet) XXX_Unmarshal(b []byte) error

type InternalBridgeValidator

type InternalBridgeValidator struct {
	Power           uint64
	EthereumAddress EthAddress
}

Bridge Validator but with validated EthereumAddress

func NewInternalBridgeValidator

func NewInternalBridgeValidator(bridgeValidator BridgeValidator) (*InternalBridgeValidator, error)

func (InternalBridgeValidator) ToExternal

func (i InternalBridgeValidator) ToExternal() *BridgeValidator

func (InternalBridgeValidator) ValidateBasic

func (i InternalBridgeValidator) ValidateBasic() error

type InternalBridgeValidators

type InternalBridgeValidators []*InternalBridgeValidator

InternalBridgeValidators is the sorted set of validator data for Ethereum bridge MultiSig set

func (InternalBridgeValidators) GetPowers

func (b InternalBridgeValidators) GetPowers() []uint64

GetPowers returns only the power values for all members

func (InternalBridgeValidators) HasDuplicates

func (b InternalBridgeValidators) HasDuplicates() bool

HasDuplicates returns true if there are duplicates in the set

func (InternalBridgeValidators) PowerDiff

PowerDiff returns the difference in power between two bridge validator sets note this is Gravity bridge power *not* Cosmos voting power. Cosmos voting power is based on the absolute number of tokens in the staking pool at any given time Gravity bridge power is normalized using the equation.

validators cosmos voting power / total cosmos voting power in this block = gravity bridge power / u32_max

As an example if someone has 52% of the Cosmos voting power when a validator set is created their Gravity bridge voting power is u32_max * .52

Normalized voting power dramatically reduces how often we have to produce new validator set updates. For example if the total on chain voting power increases by 1% due to inflation, we shouldn't have to generate a new validator set, after all the validators retained their relative percentages during inflation and normalized Gravity bridge power shows no difference.

func (InternalBridgeValidators) Sort

func (b InternalBridgeValidators) Sort()

Sort sorts the validators by power

func (InternalBridgeValidators) ToExternal

func (InternalBridgeValidators) TotalPower

func (b InternalBridgeValidators) TotalPower() (out uint64)

TotalPower returns the total power in the bridge validator set

func (InternalBridgeValidators) ValidateBasic

func (b InternalBridgeValidators) ValidateBasic() error

ValidateBasic performs stateless checks

type InternalERC20Token

type InternalERC20Token struct {
	Amount   sdk.Int
	Contract EthAddress
}

InternalERC20Token contains validated fields, used for all internal computation

func NewInternalERC20Token

func NewInternalERC20Token(amount sdk.Int, contract string) (*InternalERC20Token, error)

NewInternalERC20Token creates an InternalERC20Token, performing validation and returning any errors

func (*InternalERC20Token) Add

Add adds one ERC20 to another TODO: make this return errors instead

func (*InternalERC20Token) GravityCoin

func (i *InternalERC20Token) GravityCoin() sdk.Coin

GravityCoin returns the gravity representation of the ERC20

func (*InternalERC20Token) ToExternal

func (i *InternalERC20Token) ToExternal() *ERC20Token

ToExternal converts an InternalERC20Token to the external type ERC20Token

func (*InternalERC20Token) ValidateBasic

func (i *InternalERC20Token) ValidateBasic() error

ValidateBasic performs validation on all fields of an InternalERC20Token

type InternalOutgoingTransferTx

type InternalOutgoingTransferTx struct {
	Id          uint64
	Sender      sdk.AccAddress
	DestAddress *EthAddress
	Erc20Token  *InternalERC20Token
	Erc20Fee    *InternalERC20Token
}

InternalOutgoingTransferTx is an internal duplicate of OutgoingTransferTx with validation

func NewInternalOutgoingTransferTx

func NewInternalOutgoingTransferTx(
	id uint64,
	sender string,
	destAddress string,
	erc20Token ERC20Token,
	erc20Fee ERC20Token,
) (*InternalOutgoingTransferTx, error)

func (InternalOutgoingTransferTx) ToExternal

func (InternalOutgoingTransferTx) ValidateBasic

func (i InternalOutgoingTransferTx) ValidateBasic() error

type InternalOutgoingTxBatch

type InternalOutgoingTxBatch struct {
	BatchNonce    uint64
	BatchTimeout  uint64
	Transactions  []*InternalOutgoingTransferTx
	TokenContract EthAddress
	Block         uint64
}

InternalOutgoingTxBatch is an internal duplicate of OutgoingTxBatch with validation

func NewInternalOutgingTxBatch

func NewInternalOutgingTxBatch(
	nonce uint64,
	timeout uint64,
	transactions []*InternalOutgoingTransferTx,
	contract EthAddress,
	block uint64) (*InternalOutgoingTxBatch, error)

func NewInternalOutgingTxBatchFromExternalBatch

func NewInternalOutgingTxBatchFromExternalBatch(batch OutgoingTxBatch) (*InternalOutgoingTxBatch, error)

func (InternalOutgoingTxBatch) GetCheckpoint

func (i InternalOutgoingTxBatch) GetCheckpoint(gravityIDstring string) []byte

GetCheckpoint gets the checkpoint signature from the given outgoing tx batch

func (*InternalOutgoingTxBatch) ToExternal

func (i *InternalOutgoingTxBatch) ToExternal() *OutgoingTxBatch

func (*InternalOutgoingTxBatch) ValidateBasic

func (i *InternalOutgoingTxBatch) ValidateBasic() error

type LastObservedEthereumBlockHeight

type LastObservedEthereumBlockHeight struct {
	CosmosBlockHeight   uint64 `protobuf:"varint,1,opt,name=cosmos_block_height,json=cosmosBlockHeight,proto3" json:"cosmos_block_height,omitempty"`
	EthereumBlockHeight uint64 `protobuf:"varint,2,opt,name=ethereum_block_height,json=ethereumBlockHeight,proto3" json:"ethereum_block_height,omitempty"`
}

LastObservedEthereumBlockHeight stores the last observed Ethereum block height along with the Cosmos block height that it was observed at. These two numbers can be used to project outward and always produce batches with timeouts in the future even if no Ethereum block height has been relayed for a long time

func (*LastObservedEthereumBlockHeight) Descriptor

func (*LastObservedEthereumBlockHeight) Descriptor() ([]byte, []int)

func (*LastObservedEthereumBlockHeight) GetCosmosBlockHeight

func (m *LastObservedEthereumBlockHeight) GetCosmosBlockHeight() uint64

func (*LastObservedEthereumBlockHeight) GetEthereumBlockHeight

func (m *LastObservedEthereumBlockHeight) GetEthereumBlockHeight() uint64

func (*LastObservedEthereumBlockHeight) Marshal

func (m *LastObservedEthereumBlockHeight) Marshal() (dAtA []byte, err error)

func (*LastObservedEthereumBlockHeight) MarshalTo

func (m *LastObservedEthereumBlockHeight) MarshalTo(dAtA []byte) (int, error)

func (*LastObservedEthereumBlockHeight) MarshalToSizedBuffer

func (m *LastObservedEthereumBlockHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LastObservedEthereumBlockHeight) ProtoMessage

func (*LastObservedEthereumBlockHeight) ProtoMessage()

func (*LastObservedEthereumBlockHeight) Reset

func (*LastObservedEthereumBlockHeight) Size

func (m *LastObservedEthereumBlockHeight) Size() (n int)

func (*LastObservedEthereumBlockHeight) String

func (*LastObservedEthereumBlockHeight) Unmarshal

func (m *LastObservedEthereumBlockHeight) Unmarshal(dAtA []byte) error

func (*LastObservedEthereumBlockHeight) XXX_DiscardUnknown

func (m *LastObservedEthereumBlockHeight) XXX_DiscardUnknown()

func (*LastObservedEthereumBlockHeight) XXX_Marshal

func (m *LastObservedEthereumBlockHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LastObservedEthereumBlockHeight) XXX_Merge

func (m *LastObservedEthereumBlockHeight) XXX_Merge(src proto.Message)

func (*LastObservedEthereumBlockHeight) XXX_Size

func (m *LastObservedEthereumBlockHeight) XXX_Size() int

func (*LastObservedEthereumBlockHeight) XXX_Unmarshal

func (m *LastObservedEthereumBlockHeight) XXX_Unmarshal(b []byte) error

type MsgBatchSendToEthClaim

type MsgBatchSendToEthClaim struct {
	EventNonce    uint64 `protobuf:"varint,1,opt,name=event_nonce,json=eventNonce,proto3" json:"event_nonce,omitempty"`
	BlockHeight   uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	BatchNonce    uint64 `protobuf:"varint,3,opt,name=batch_nonce,json=batchNonce,proto3" json:"batch_nonce,omitempty"`
	TokenContract string `protobuf:"bytes,4,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"`
	Orchestrator  string `protobuf:"bytes,5,opt,name=orchestrator,proto3" json:"orchestrator,omitempty"`
}

BatchSendToEthClaim claims that a batch of send to eth operations on the bridge contract was executed.

func (*MsgBatchSendToEthClaim) ClaimHash

func (msg *MsgBatchSendToEthClaim) ClaimHash() ([]byte, error)

Hash implements WithdrawBatch.Hash

func (*MsgBatchSendToEthClaim) Descriptor

func (*MsgBatchSendToEthClaim) Descriptor() ([]byte, []int)

func (*MsgBatchSendToEthClaim) GetBatchNonce

func (m *MsgBatchSendToEthClaim) GetBatchNonce() uint64

func (*MsgBatchSendToEthClaim) GetBlockHeight

func (m *MsgBatchSendToEthClaim) GetBlockHeight() uint64

func (MsgBatchSendToEthClaim) GetClaimer

func (msg MsgBatchSendToEthClaim) GetClaimer() sdk.AccAddress

func (*MsgBatchSendToEthClaim) GetEventNonce

func (m *MsgBatchSendToEthClaim) GetEventNonce() uint64

func (*MsgBatchSendToEthClaim) GetOrchestrator

func (m *MsgBatchSendToEthClaim) GetOrchestrator() string

func (MsgBatchSendToEthClaim) GetSignBytes

func (msg MsgBatchSendToEthClaim) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgBatchSendToEthClaim) GetSigners

func (msg MsgBatchSendToEthClaim) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgBatchSendToEthClaim) GetTokenContract

func (m *MsgBatchSendToEthClaim) GetTokenContract() string

func (*MsgBatchSendToEthClaim) GetType

func (msg *MsgBatchSendToEthClaim) GetType() ClaimType

GetType returns the claim type

func (*MsgBatchSendToEthClaim) Marshal

func (m *MsgBatchSendToEthClaim) Marshal() (dAtA []byte, err error)

func (*MsgBatchSendToEthClaim) MarshalTo

func (m *MsgBatchSendToEthClaim) MarshalTo(dAtA []byte) (int, error)

func (*MsgBatchSendToEthClaim) MarshalToSizedBuffer

func (m *MsgBatchSendToEthClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgBatchSendToEthClaim) ProtoMessage

func (*MsgBatchSendToEthClaim) ProtoMessage()

func (*MsgBatchSendToEthClaim) Reset

func (m *MsgBatchSendToEthClaim) Reset()

func (MsgBatchSendToEthClaim) Route

func (msg MsgBatchSendToEthClaim) Route() string

Route should return the name of the module

func (*MsgBatchSendToEthClaim) Size

func (m *MsgBatchSendToEthClaim) Size() (n int)

func (*MsgBatchSendToEthClaim) String

func (m *MsgBatchSendToEthClaim) String() string

func (MsgBatchSendToEthClaim) Type

func (msg MsgBatchSendToEthClaim) Type() string

Type should return the action

func (*MsgBatchSendToEthClaim) Unmarshal

func (m *MsgBatchSendToEthClaim) Unmarshal(dAtA []byte) error

func (*MsgBatchSendToEthClaim) ValidateBasic

func (e *MsgBatchSendToEthClaim) ValidateBasic() error

ValidateBasic performs stateless checks

func (*MsgBatchSendToEthClaim) XXX_DiscardUnknown

func (m *MsgBatchSendToEthClaim) XXX_DiscardUnknown()

func (*MsgBatchSendToEthClaim) XXX_Marshal

func (m *MsgBatchSendToEthClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgBatchSendToEthClaim) XXX_Merge

func (m *MsgBatchSendToEthClaim) XXX_Merge(src proto.Message)

func (*MsgBatchSendToEthClaim) XXX_Size

func (m *MsgBatchSendToEthClaim) XXX_Size() int

func (*MsgBatchSendToEthClaim) XXX_Unmarshal

func (m *MsgBatchSendToEthClaim) XXX_Unmarshal(b []byte) error

type MsgBatchSendToEthClaimResponse

type MsgBatchSendToEthClaimResponse struct {
}

func (*MsgBatchSendToEthClaimResponse) Descriptor

func (*MsgBatchSendToEthClaimResponse) Descriptor() ([]byte, []int)

func (*MsgBatchSendToEthClaimResponse) Marshal

func (m *MsgBatchSendToEthClaimResponse) Marshal() (dAtA []byte, err error)

func (*MsgBatchSendToEthClaimResponse) MarshalTo

func (m *MsgBatchSendToEthClaimResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgBatchSendToEthClaimResponse) MarshalToSizedBuffer

func (m *MsgBatchSendToEthClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgBatchSendToEthClaimResponse) ProtoMessage

func (*MsgBatchSendToEthClaimResponse) ProtoMessage()

func (*MsgBatchSendToEthClaimResponse) Reset

func (m *MsgBatchSendToEthClaimResponse) Reset()

func (*MsgBatchSendToEthClaimResponse) Size

func (m *MsgBatchSendToEthClaimResponse) Size() (n int)

func (*MsgBatchSendToEthClaimResponse) String

func (*MsgBatchSendToEthClaimResponse) Unmarshal

func (m *MsgBatchSendToEthClaimResponse) Unmarshal(dAtA []byte) error

func (*MsgBatchSendToEthClaimResponse) XXX_DiscardUnknown

func (m *MsgBatchSendToEthClaimResponse) XXX_DiscardUnknown()

func (*MsgBatchSendToEthClaimResponse) XXX_Marshal

func (m *MsgBatchSendToEthClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgBatchSendToEthClaimResponse) XXX_Merge

func (m *MsgBatchSendToEthClaimResponse) XXX_Merge(src proto.Message)

func (*MsgBatchSendToEthClaimResponse) XXX_Size

func (m *MsgBatchSendToEthClaimResponse) XXX_Size() int

func (*MsgBatchSendToEthClaimResponse) XXX_Unmarshal

func (m *MsgBatchSendToEthClaimResponse) XXX_Unmarshal(b []byte) error

type MsgCancelSendToEth

type MsgCancelSendToEth struct {
	TransactionId uint64 `protobuf:"varint,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	Sender        string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
}

This call allows the sender (and only the sender) to cancel a given MsgSendToEth and recieve a refund of the tokens

func NewMsgCancelSendToEth

func NewMsgCancelSendToEth(user sdk.AccAddress, id uint64) *MsgCancelSendToEth

NewMsgCancelSendToEth returns a new msgSetOrchestratorAddress

func (*MsgCancelSendToEth) Descriptor

func (*MsgCancelSendToEth) Descriptor() ([]byte, []int)

func (*MsgCancelSendToEth) GetSender

func (m *MsgCancelSendToEth) GetSender() string

func (*MsgCancelSendToEth) GetSignBytes

func (msg *MsgCancelSendToEth) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (*MsgCancelSendToEth) GetSigners

func (msg *MsgCancelSendToEth) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgCancelSendToEth) GetTransactionId

func (m *MsgCancelSendToEth) GetTransactionId() uint64

func (*MsgCancelSendToEth) Marshal

func (m *MsgCancelSendToEth) Marshal() (dAtA []byte, err error)

func (*MsgCancelSendToEth) MarshalTo

func (m *MsgCancelSendToEth) MarshalTo(dAtA []byte) (int, error)

func (*MsgCancelSendToEth) MarshalToSizedBuffer

func (m *MsgCancelSendToEth) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCancelSendToEth) ProtoMessage

func (*MsgCancelSendToEth) ProtoMessage()

func (*MsgCancelSendToEth) Reset

func (m *MsgCancelSendToEth) Reset()

func (*MsgCancelSendToEth) Route

func (msg *MsgCancelSendToEth) Route() string

Route should return the name of the module

func (*MsgCancelSendToEth) Size

func (m *MsgCancelSendToEth) Size() (n int)

func (*MsgCancelSendToEth) String

func (m *MsgCancelSendToEth) String() string

func (*MsgCancelSendToEth) Type

func (msg *MsgCancelSendToEth) Type() string

Type should return the action

func (*MsgCancelSendToEth) Unmarshal

func (m *MsgCancelSendToEth) Unmarshal(dAtA []byte) error

func (*MsgCancelSendToEth) ValidateBasic

func (msg *MsgCancelSendToEth) ValidateBasic() (err error)

ValidateBasic performs stateless checks

func (*MsgCancelSendToEth) XXX_DiscardUnknown

func (m *MsgCancelSendToEth) XXX_DiscardUnknown()

func (*MsgCancelSendToEth) XXX_Marshal

func (m *MsgCancelSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCancelSendToEth) XXX_Merge

func (m *MsgCancelSendToEth) XXX_Merge(src proto.Message)

func (*MsgCancelSendToEth) XXX_Size

func (m *MsgCancelSendToEth) XXX_Size() int

func (*MsgCancelSendToEth) XXX_Unmarshal

func (m *MsgCancelSendToEth) XXX_Unmarshal(b []byte) error

type MsgCancelSendToEthResponse

type MsgCancelSendToEthResponse struct {
}

func (*MsgCancelSendToEthResponse) Descriptor

func (*MsgCancelSendToEthResponse) Descriptor() ([]byte, []int)

func (*MsgCancelSendToEthResponse) Marshal

func (m *MsgCancelSendToEthResponse) Marshal() (dAtA []byte, err error)

func (*MsgCancelSendToEthResponse) MarshalTo

func (m *MsgCancelSendToEthResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgCancelSendToEthResponse) MarshalToSizedBuffer

func (m *MsgCancelSendToEthResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCancelSendToEthResponse) ProtoMessage

func (*MsgCancelSendToEthResponse) ProtoMessage()

func (*MsgCancelSendToEthResponse) Reset

func (m *MsgCancelSendToEthResponse) Reset()

func (*MsgCancelSendToEthResponse) Size

func (m *MsgCancelSendToEthResponse) Size() (n int)

func (*MsgCancelSendToEthResponse) String

func (m *MsgCancelSendToEthResponse) String() string

func (*MsgCancelSendToEthResponse) Unmarshal

func (m *MsgCancelSendToEthResponse) Unmarshal(dAtA []byte) error

func (*MsgCancelSendToEthResponse) XXX_DiscardUnknown

func (m *MsgCancelSendToEthResponse) XXX_DiscardUnknown()

func (*MsgCancelSendToEthResponse) XXX_Marshal

func (m *MsgCancelSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCancelSendToEthResponse) XXX_Merge

func (m *MsgCancelSendToEthResponse) XXX_Merge(src proto.Message)

func (*MsgCancelSendToEthResponse) XXX_Size

func (m *MsgCancelSendToEthResponse) XXX_Size() int

func (*MsgCancelSendToEthResponse) XXX_Unmarshal

func (m *MsgCancelSendToEthResponse) XXX_Unmarshal(b []byte) error