Documentation ¶
Index ¶
- func Return(err error) protogo.Response
- func ReturnAccount(acc common.Account, err error) protogo.Response
- func ReturnBool(b bool, err error) protogo.Response
- func ReturnJson(obj interface{}, err error) protogo.Response
- func ReturnString(str string, err error) protogo.Response
- func ReturnUint256(num *common.SafeUint256, err error) protogo.Response
- func ReturnUint8(num uint8, err error) protogo.Response
- type Address
- type SdkAdapter
- func (s SdkAdapter) CallContract(account common.Account, method string, args []common.KeyValue) common.Response
- func (s SdkAdapter) CreateCompositeKey(prefix string, data ...string) (string, error)
- func (s SdkAdapter) DelState(key string) error
- func (s SdkAdapter) EmitEvent(topic string, data ...string) error
- func (s SdkAdapter) GetState(key string) (value []byte, err error)
- func (s SdkAdapter) GetTxSender() (common.Account, error)
- func (s SdkAdapter) IsContract(account common.Account) bool
- func (s SdkAdapter) NewAccountFromBytes(b []byte) (common.Account, error)
- func (s SdkAdapter) NewAccountFromString(str string) (common.Account, error)
- func (s SdkAdapter) NewZeroAccount() common.Account
- func (s SdkAdapter) PutState(key string, value []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnBool ¶
ReturnBool 封装返回Bool类型为Response,如果有error则忽略bool,封装error @param b @param err @return Response
func ReturnJson ¶
ReturnJson 封装返回对象类型为json格式到Response,如果有error则忽略对象,封装error @param obj @param err @return Response
func ReturnString ¶
ReturnString 封装返回string类型为Response,如果有error则忽略str,封装error @param str @param err @return Response
func ReturnUint256 ¶
func ReturnUint256(num *common.SafeUint256, err error) protogo.Response
ReturnUint256 封装返回SafeUint256类型为Response,如果有error则忽略num,封装error @param num @param err @return Response
Types ¶
type SdkAdapter ¶
type SdkAdapter struct {
// contains filtered or unexported fields
}
func NewSdkAdapter ¶
func NewSdkAdapter(cmsdk sdk.SDKInterface) *SdkAdapter
func (SdkAdapter) CallContract ¶
func (SdkAdapter) CreateCompositeKey ¶
func (s SdkAdapter) CreateCompositeKey(prefix string, data ...string) (string, error)
func (SdkAdapter) DelState ¶
func (s SdkAdapter) DelState(key string) error
func (SdkAdapter) GetTxSender ¶
func (s SdkAdapter) GetTxSender() (common.Account, error)
func (SdkAdapter) IsContract ¶
func (s SdkAdapter) IsContract(account common.Account) bool
func (SdkAdapter) NewAccountFromBytes ¶
func (s SdkAdapter) NewAccountFromBytes(b []byte) (common.Account, error)
func (SdkAdapter) NewAccountFromString ¶
func (s SdkAdapter) NewAccountFromString(str string) (common.Account, error)
func (SdkAdapter) NewZeroAccount ¶
func (s SdkAdapter) NewZeroAccount() common.Account
Click to show internal directories.
Click to hide internal directories.