MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetSmartContractEvent

Function GetSmartContractEvent

cmd/utils/gas.go:461–476  ·  view source on GitHub ↗

GetSmartContractEvent return smart contract event execute by invoke transaction by hex string code

(txHash string)

Source from the content-addressed store, hash-verified

459
460//GetSmartContractEvent return smart contract event execute by invoke transaction by hex string code
461func GetSmartContractEvent(txHash string) (*rpccommon.ExecuteNotify, error) {
462 data, ontErr := sendRpcRequest("getsmartcodeevent", []interface{}{txHash})
463 if ontErr != nil {
464 switch ontErr.ErrorCode {
465 case ERROR_INVALID_PARAMS:
466 return nil, fmt.Errorf("invalid TxHash:%s", txHash)
467 }
468 return nil, ontErr.Error
469 }
470 notifies := &rpccommon.ExecuteNotify{}
471 err := json.Unmarshal(data, &notifies)
472 if err != nil {
473 return nil, fmt.Errorf("json.Unmarshal SmartContactEvent:%s error:%s", data, err)
474 }
475 return notifies, nil
476}
477
478func GetSmartContractEventInfo(txHash string) ([]byte, error) {
479 data, ontErr := sendRpcRequest("getsmartcodeevent", []interface{}{txHash})

Callers

nothing calls this directly

Calls 2

sendRpcRequestFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected