Documentation ¶
Index ¶
- Constants
- Variables
- func GetMessageFormat(code isc.VMErrorCode, callView ViewCaller) (string, error)
- func NewStateErrorCollectionReader(partition kv.KVStoreReader, hname isc.Hname) coreerrors.ErrorCollection
- func NewStateErrorCollectionWriter(partition kv.KVStore, hname isc.Hname) coreerrors.ErrorCollection
- func Resolve(e *isc.UnresolvedVMError, callView ViewCaller) (*isc.VMError, error)
- func ResolveFromState(state kv.KVStoreReader, e *isc.UnresolvedVMError) (*isc.VMError, error)
- func SetInitialState(state kv.KVStore)
- type StateErrorCollectionReader
- type StateErrorCollectionWriter
- type ViewCaller
Constants ¶
View Source
const ( ParamErrorCode = "c" ParamErrorMessageFormat = "m" )
request parameters
Variables ¶
View Source
var ( FuncRegisterError = coreutil.Func("registerError") ViewGetErrorMessageFormat = coreutil.ViewFunc("getErrorMessageFormat") )
View Source
var Contract = coreutil.NewContract(coreutil.CoreContractErrors)
View Source
var Processor = Contract.Processor(nil, FuncRegisterError.WithHandler(funcRegisterError), ViewGetErrorMessageFormat.WithHandler(funcGetErrorMessageFormat), )
Functions ¶
func GetMessageFormat ¶
func GetMessageFormat(code isc.VMErrorCode, callView ViewCaller) (string, error)
func NewStateErrorCollectionReader ¶
func NewStateErrorCollectionReader(partition kv.KVStoreReader, hname isc.Hname) coreerrors.ErrorCollection
func NewStateErrorCollectionWriter ¶
func NewStateErrorCollectionWriter(partition kv.KVStore, hname isc.Hname) coreerrors.ErrorCollection
func Resolve ¶
func Resolve(e *isc.UnresolvedVMError, callView ViewCaller) (*isc.VMError, error)
func ResolveFromState ¶
func ResolveFromState(state kv.KVStoreReader, e *isc.UnresolvedVMError) (*isc.VMError, error)
func SetInitialState ¶ added in v1.0.3
Types ¶
type StateErrorCollectionReader ¶
type StateErrorCollectionReader struct {
// contains filtered or unexported fields
}
StateErrorCollectionReader implements ErrorCollection partially. Is used for contract internal error readings only. It requires a reference to a KVStoreReader such as the vmctx and the hname of the caller.
func (*StateErrorCollectionReader) Get ¶
func (e *StateErrorCollectionReader) Get(errorID uint16) (*isc.VMErrorTemplate, bool)
func (*StateErrorCollectionReader) Register ¶
func (e *StateErrorCollectionReader) Register(messageFormat string) (*isc.VMErrorTemplate, error)
type StateErrorCollectionWriter ¶
type StateErrorCollectionWriter struct {
// contains filtered or unexported fields
}
StateErrorCollectionWriter implements ErrorCollection. Is used for contract internal errors. It requires a reference to a KVStore such as the vmctx and the hname of the caller.
func (*StateErrorCollectionWriter) Get ¶
func (e *StateErrorCollectionWriter) Get(errorID uint16) (*isc.VMErrorTemplate, bool)
func (*StateErrorCollectionWriter) Register ¶
func (e *StateErrorCollectionWriter) Register(messageFormat string) (*isc.VMErrorTemplate, error)
Click to show internal directories.
Click to hide internal directories.