types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "booking"

	// 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 (
	TypeBookMsg         = "booking"
	TypeBookCompleteMsg = "book_complete"
)

Variables

View Source
var (
	ErrAssetDoesNotExist      = sdkerrors.New(ModuleName, 1, "asset does not exist")
	ErrIllegalAssetRate       = sdkerrors.New(ModuleName, 2, "asset is negative")
	ErrAssetAlreadyBooked     = sdkerrors.New(ModuleName, 3, "asset is already booked")
	ErrUnableToGenerateBookID = sdkerrors.New(ModuleName, 4, "unable to generate bookID")
	ErrInvalidBooking         = sdkerrors.New(ModuleName, 5, "booking field values are invalid")
	ErrNotBookerOfAsset       = sdkerrors.New(ModuleName, 6, "Signer didn't booking this booking")
	ErrAssetNotBooked         = sdkerrors.New(ModuleName, 7, "Asset is not booked")
	ErrBookingIsCompleted     = sdkerrors.New(ModuleName, 8, "Booking is completed")
	ErrUUIDMismatch           = sdkerrors.New(ModuleName, 9, "uuid of booking and asset not matched")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type Booking

type Booking struct {
	BookID      string         `json:"bookingId"`
	Booker      sdk.AccAddress `json:"renter"`
	UUID        string         `json:"uuid"`
	Duration    int64          `json:"duration"`
	IsCompleted bool           `json:"isCompleted`
}

func NewBooking

func NewBooking() Booking

func NewBookingFromMsgBook

func NewBookingFromMsgBook(msg MsgBook) Booking

func (Booking) GetString

func (b Booking) GetString() (string, error)

type MsgBook

type MsgBook struct {
	Booker   sdk.AccAddress `json:"booker"`
	UUID     string         `json:"uuid"`
	Duration int64          `json:"duration"`
}

func NewMsgBook

func NewMsgBook(booker sdk.AccAddress, uuid string, duration int64) MsgBook

func (MsgBook) GetSignBytes

func (msg MsgBook) GetSignBytes() []byte

func (MsgBook) GetSigners

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

func (MsgBook) Route

func (msg MsgBook) Route() string

func (MsgBook) String

func (msg MsgBook) String() string

func (MsgBook) Type

func (msg MsgBook) Type() string

func (MsgBook) ValidateBasic

func (msg MsgBook) ValidateBasic() error

type MsgComplete

type MsgComplete struct {
	Booker sdk.AccAddress `json:"booker"`
	BookID string         `json:"uuid"`
}

func NewMsgComplete

func NewMsgComplete(booker sdk.AccAddress, bookid string) MsgComplete

func (MsgComplete) GetSignBytes

func (msg MsgComplete) GetSignBytes() []byte

func (MsgComplete) GetSigners

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

func (MsgComplete) Route

func (msg MsgComplete) Route() string

func (MsgComplete) String

func (msg MsgComplete) String() string

func (MsgComplete) Type

func (msg MsgComplete) Type() string

func (MsgComplete) ValidateBasic

func (msg MsgComplete) ValidateBasic() error

type QueryResNames

type QueryResNames []string

QueryResNames Queries Result Payload for a names query

func (QueryResNames) String

func (n QueryResNames) String() string

implement fmt.Stringer

type QueryResResolve

type QueryResResolve struct {
	Value string `json:"value"`
}

QueryResResolve Queries Result Payload for a resolve query

func (QueryResResolve) String

func (r QueryResResolve) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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