Documentation
¶
Index ¶
- Constants
- Variables
- func SwapKey(hash EthereumHash) []byte
- type EthereumHash
- func (e EthereumHash) Bytes() []byte
- func (e EthereumHash) Hex() string
- func (e EthereumHash) Marshal() ([]byte, error)
- func (e EthereumHash) MarshalJSON() ([]byte, error)
- func (e *EthereumHash) SetBytes(b []byte)
- func (e EthereumHash) String() string
- func (e *EthereumHash) Unmarshal(data []byte) error
- func (e *EthereumHash) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( ModuleName = "swap" StoreKey = ModuleName )
View Source
const (
EthereumHashLength int = 32
)
Variables ¶
View Source
var ( ErrorInvalidField = sdkerrors.Register(ModuleName, 101, "invalid field") ErrorInvalidFrom = sdkerrors.Register(ModuleName, 102, "invalid from") ErrorInvalidReceiver = sdkerrors.Register(ModuleName, 103, "invalid receiver") ErrorInvalidTxHash = sdkerrors.Register(ModuleName, 104, "invalid tx_hash") ErrorInvalidAmount = sdkerrors.Register(ModuleName, 105, "invalid amount") )
View Source
var ( ErrorSwapIsDisabled = sdkerrors.Register(ModuleName, 201, "swap is disabled") ErrorDuplicateSwap = sdkerrors.Register(ModuleName, 203, "duplicate swap") )
View Source
var (
PrecisionLoss = sdkmath.NewInt(100)
)
View Source
var (
SwapKeyPrefix = []byte{0x10}
)
Functions ¶
func SwapKey ¶
func SwapKey(hash EthereumHash) []byte
Types ¶
type EthereumHash ¶
type EthereumHash [EthereumHashLength]byte
func BytesToHash ¶
func BytesToHash(b []byte) EthereumHash
func (EthereumHash) Bytes ¶
func (e EthereumHash) Bytes() []byte
func (EthereumHash) Hex ¶
func (e EthereumHash) Hex() string
func (EthereumHash) Marshal ¶
func (e EthereumHash) Marshal() ([]byte, error)
func (EthereumHash) MarshalJSON ¶
func (e EthereumHash) MarshalJSON() ([]byte, error)
func (*EthereumHash) SetBytes ¶
func (e *EthereumHash) SetBytes(b []byte)
func (EthereumHash) String ¶
func (e EthereumHash) String() string
func (*EthereumHash) Unmarshal ¶
func (e *EthereumHash) Unmarshal(data []byte) error
func (*EthereumHash) UnmarshalJSON ¶
func (e *EthereumHash) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.