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: 4 Imported by: 0

Documentation

Index

Constants

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

	// 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.")
	ErrRxDoesNotExists     = sdkerrors.Register(ModuleName, 9, "Rx does not exists.")
)
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 {
	Authorize(ctx sdk.Context, patient string, id string, recipient string, envelope string) error
	GetRxs(ctx sdk.Context, pubkey string) (exported.CaseHistory, error)
	GetRx(ctx sdk.Context, pubkey string, id string) (exported.Rx, error)
	GetRxPermission(ctx sdk.Context, rxid string) (exported.RxPermission, error)
}

StakingKeeper is required for getting Denom

type MsgAuthorizeRx

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

MsgAuthorizeRx defines a message to authorize dragstore accessing rx

func NewMsgAuthorizeRx

func NewMsgAuthorizeRx(from sdk.AccAddress, patient string, drugstore string, id string, envelope string) MsgAuthorizeRx

NewMsgAuthorizeRx is a constructor function for MsgAuthorizeRx

func (MsgAuthorizeRx) GetSignBytes

func (msg MsgAuthorizeRx) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgAuthorizeRx) GetSigners

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

GetSigners defines whose signature is required

func (MsgAuthorizeRx) Route

func (msg MsgAuthorizeRx) Route() string

Route should return the name of the module

func (MsgAuthorizeRx) Type

func (msg MsgAuthorizeRx) Type() string

Type should return the action

func (MsgAuthorizeRx) ValidateBasic

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