types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

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

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

RouterKey is the module name router key

Variables

View Source
var (
	// ErrWithdrawTooOften withdraw too often
	ErrInputInvalid        = sdkerrors.Register(ModuleName, 1, "Your input is not valid")
	ErrPatientExisted      = sdkerrors.Register(ModuleName, 2, "Patient already exists")
	ErrDoctorExisted       = sdkerrors.Register(ModuleName, 3, "Doctor already exists")
	ErrDrugStoreExisted    = sdkerrors.Register(ModuleName, 4, "Drugstore already exists")
	ErrDontHaveRx          = sdkerrors.Register(ModuleName, 5, "Don't have any rx in this address")
	ErrDrugstoreNotExisted = sdkerrors.Register(ModuleName, 6, "Drugstore does not existed")
	ErrIllegalAccess       = sdkerrors.Register(ModuleName, 7, "Illegal Rx Access")
	ErrDuplicatedUse       = sdkerrors.Register(ModuleName, 8, "Rx can be used only once.")
)
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 AdminKeeper

type AdminKeeper interface {
	// SaleDrugs is used for drugstore to sale drugs on blockchain.
	SaleDrugs(ctx sdk.Context, patient string, id string, drugstore string) error
}

SupplyKeeper is required for mining coin

type MsgSaleDrugs

type MsgSaleDrugs struct {
	From      sdk.AccAddress `json:"from"`
	Patient   string         `json:"patient"`
	DrugStore string         `json:"drugstore"`
	ID        string         `json:"id"` // 处方ID
}

MsgAuthorizeRx defines a message to authorize dragstore accessing rx

func NewMsgSaleDrugs

func NewMsgSaleDrugs(from sdk.AccAddress, patient string, drugstore string, id string) MsgSaleDrugs

NewMsgSaleDrugs is a constructor function for MsgSaleDrugs

func (MsgSaleDrugs) GetSignBytes

func (msg MsgSaleDrugs) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSaleDrugs) GetSigners

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

GetSigners defines whose signature is required

func (MsgSaleDrugs) Route

func (msg MsgSaleDrugs) Route() string

Route should return the name of the module

func (MsgSaleDrugs) Type

func (msg MsgSaleDrugs) Type() string

Type should return the action

func (MsgSaleDrugs) ValidateBasic

func (msg MsgSaleDrugs) ValidateBasic() error

ValidateBasic runs stateless checks on the message

Jump to

Keyboard shortcuts

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