types

package
v0.0.0-...-34ce4e4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the ethereum bridge module
	ModuleName = "ethbridge"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the ethereum bridge module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the ethereum bridge module
	RouterKey = ModuleName
)
View Source
const (
	TestAddress            = "cosmos1gn8409qq9hnrxde37kuxwx5hrxpfpv8426szuv"
	TestValidator          = "cosmos1xdp5tvt7lxh8rf9xx07wy2xlagzhq24ha48xtq"
	TestNonce              = 0
	TestEthereumAddress    = "0x7B95B6EC7EbD73572298cEf32Bb54FA408207359"
	AltTestEthereumAddress = "0x7B95B6EC7EbD73572298cEf32Bb54FA408207344"
	TestCoins              = "10ethereum"
	AltTestCoins           = "12ethereum"
)

Variables

This section is empty.

Functions

func CreateOracleClaimFromEthClaim

func CreateOracleClaimFromEthClaim(cdc *codec.Codec, ethClaim EthBridgeClaim) (string, sdk.ValAddress, string)

func ErrInvalidEthAddress

func ErrInvalidEthAddress(codespace sdk.CodespaceType) sdk.Error

func ErrInvalidEthNonce

func ErrInvalidEthNonce(codespace sdk.CodespaceType) sdk.Error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type CodeType

type CodeType = sdk.CodeType

Local code type

const (
	DefaultCodespace sdk.CodespaceType = "ethbridge"

	CodeInvalidEthNonce   CodeType = 1
	CodeInvalidEthAddress CodeType = 2
)

Exported code type numbers

type EthBridgeClaim

type EthBridgeClaim struct {
	Nonce          int            `json:"nonce"`
	EthereumSender string         `json:"ethereum_sender"`
	CosmosReceiver sdk.AccAddress `json:"cosmos_receiver"`
	Validator      sdk.AccAddress `json:"validator"`
	Amount         sdk.Coins      `json:"amount"`
}

func CreateEthClaimFromOracleString

func CreateEthClaimFromOracleString(nonce int, ethereumSender string, validator sdk.ValAddress, oracleClaimString string) (EthBridgeClaim, sdk.Error)

func CreateTestEthClaim

func CreateTestEthClaim(t *testing.T, validatorAddress sdk.AccAddress, testEthereumAddress string, coins string) EthBridgeClaim

func NewEthBridgeClaim

func NewEthBridgeClaim(nonce int, ethereumSender string, cosmosReceiver sdk.AccAddress, validator sdk.AccAddress, amount sdk.Coins) EthBridgeClaim

NewEthBridgeClaim is a constructor function for NewEthBridgeClaim

type MsgMakeEthBridgeClaim

type MsgMakeEthBridgeClaim struct {
	EthBridgeClaim `json:"eth_bridge_claim"`
}

MsgMakeEthBridgeClaim defines a message for creating claims on the ethereum bridge

func CreateTestEthMsg

func CreateTestEthMsg(t *testing.T, validatorAddress sdk.AccAddress) MsgMakeEthBridgeClaim

Ethereum-bridge specific stuff

func NewMsgMakeEthBridgeClaim

func NewMsgMakeEthBridgeClaim(ethBridgeClaim EthBridgeClaim) MsgMakeEthBridgeClaim

NewMsgMakeEthBridgeClaim is a constructor function for MsgMakeBridgeClaim

func (MsgMakeEthBridgeClaim) GetSignBytes

func (msg MsgMakeEthBridgeClaim) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgMakeEthBridgeClaim) GetSigners

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

GetSigners defines whose signature is required

func (MsgMakeEthBridgeClaim) Route

func (msg MsgMakeEthBridgeClaim) Route() string

Route should return the name of the module

func (MsgMakeEthBridgeClaim) Type

func (msg MsgMakeEthBridgeClaim) Type() string

Type should return the action

func (MsgMakeEthBridgeClaim) ValidateBasic

func (msg MsgMakeEthBridgeClaim) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type OracleClaim

type OracleClaim struct {
	CosmosReceiver sdk.AccAddress `json:"cosmos_receiver"`
	Amount         sdk.Coins      `json:"amount"`
}

OracleClaim is the details of how the claim for each validator will be stored in the oracle

func CreateOracleClaimFromOracleString

func CreateOracleClaimFromOracleString(oracleClaimString string) (OracleClaim, sdk.Error)

func NewOracleClaim

func NewOracleClaim(cosmosReceiver sdk.AccAddress, amount sdk.Coins) OracleClaim

NewOracleClaim is a constructor function for OracleClaim

type QueryEthProphecyParams

type QueryEthProphecyParams struct {
	Nonce          int
	EthereumSender string
}

defines the params for the following queries: - 'custom/ethbridge/prophecies/'

func NewQueryEthProphecyParams

func NewQueryEthProphecyParams(nonce int, ethereumSender string) QueryEthProphecyParams

type QueryEthProphecyResponse

type QueryEthProphecyResponse struct {
	ID              string           `json:"id"`
	Status          oracle.Status    `json:"status"`
	EthBridgeClaims []EthBridgeClaim `json:"claims"`
}

Query Result Payload for an eth prophecy query

func CreateTestQueryEthProphecyResponse

func CreateTestQueryEthProphecyResponse(cdc *codec.Codec, t *testing.T, validatorAddress sdk.AccAddress) QueryEthProphecyResponse

func NewQueryEthProphecyResponse

func NewQueryEthProphecyResponse(id string, status oracle.Status, claims []EthBridgeClaim) QueryEthProphecyResponse

func (QueryEthProphecyResponse) String

func (response QueryEthProphecyResponse) String() string

Jump to

Keyboard shortcuts

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