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 = "doctor"

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

	Rx_ACTIVE  = 1 //有效状态
	Rx_LOCKING = 2 //药店锁定
	Rx_USED    = 3 //完成购买
)
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 {
	// Prescribe is used for doctor to prescribe on blockchain.
	Prescribe(ctx sdk.Context, doctor string, patient string, encrypted string, memo string, token string) error
}

SupplyKeeper is required for mining coin

type MsgPrescribe

type MsgPrescribe struct {
	From      sdk.AccAddress `json:"from"`
	Doctor    string         `json:"doctor"`
	Patient   string         `json:"patient"`
	Encrypted string         `json:"encrypted"` // 处方上链前需加密
	Envelope  string         `json:"envelope"`
	Memo      string         `json:"memo"`
}

MsgCreateRx defines a create rx message

func NewMsgPrescribe

func NewMsgPrescribe(from sdk.AccAddress, doctor string, patient string, encrypted string, envelope string, memo string) MsgPrescribe

NewMsgRegisterDrugStore is a constructor function for MsgRegisterDrugStore

func (MsgPrescribe) GetSignBytes

func (msg MsgPrescribe) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgPrescribe) GetSigners

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

GetSigners defines whose signature is required

func (MsgPrescribe) Route

func (msg MsgPrescribe) Route() string

Route should return the name of the module

func (MsgPrescribe) Type

func (msg MsgPrescribe) Type() string

Type should return the action

func (MsgPrescribe) ValidateBasic

func (msg MsgPrescribe) 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