common

package
v2.0.1-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIERR_OK                  = 0
	CLIERR_HTTP_METHOD_INVALID = 1001
	CLIERR_INVALID_REQUEST     = 1002
	CLIERR_INVALID_PARAMS      = 1003
	CLIERR_UNSUPPORT_METHOD    = 1004
	CLIERR_ACCOUNT_UNLOCK      = 1005
	CLIERR_INVALID_TX          = 1006
	CLIERR_ABI_NOT_FOUND       = 1007
	CLIERR_ABI_UNMATCH         = 1008
	CLIERR_DUPLICATE_SIG       = 1009
	CLIERR_INTERNAL_ERR        = 900
)

Variables

View Source
var DefExecutorStore *store.ExecutorStore
View Source
var RPCErrorDesc = map[int]string{
	CLIERR_OK:                  "",
	CLIERR_HTTP_METHOD_INVALID: "invalid http method",
	CLIERR_INVALID_REQUEST:     "invalid request",
	CLIERR_INVALID_PARAMS:      "invalid params",
	CLIERR_UNSUPPORT_METHOD:    "unsupport method",
	CLIERR_INVALID_TX:          "invalid tx",
	CLIERR_ABI_NOT_FOUND:       "abi not found",
	CLIERR_ABI_UNMATCH:         "abi unmatch",
	CLIERR_DUPLICATE_SIG:       "Duplicate sig",
	CLIERR_INTERNAL_ERR:        "internal error",
}

Functions

func GetCLIErrorDesc

func GetCLIErrorDesc(errorCode int) string

Types

type CliRpcRequest

type CliRpcRequest struct {
	Qid     string          `json:"qid"`
	Params  json.RawMessage `json:"params"`
	Account string          `json:"account"`
	Pwd     string          `json:"pwd"`
	Method  string          `json:"method"`
}

func (*CliRpcRequest) GetAccount

func (this *CliRpcRequest) GetAccount() (*account.Account, error)

type CliRpcResponse

type CliRpcResponse struct {
	Qid       string      `json:"qid"`
	Method    string      `json:"method"`
	Result    interface{} `json:"result"`
	ErrorCode int         `json:"error_code"`
	ErrorInfo string      `json:"error_info"`
}

Jump to

Keyboard shortcuts

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