rpc: add trigger parameter to getapplicationlog
This commit is contained in:
parent
7ca93e76ac
commit
0b15ca8bd0
5 changed files with 67 additions and 12 deletions
|
@ -527,11 +527,19 @@ func (s *Server) getApplicationLog(reqParams request.Params) (interface{}, *resp
|
|||
return nil, response.ErrInvalidParams
|
||||
}
|
||||
|
||||
trig := trigger.All
|
||||
if len(reqParams) > 1 {
|
||||
trig, err = trigger.FromString(reqParams.ValueWithType(1, request.StringT).String())
|
||||
if err != nil {
|
||||
return nil, response.ErrInvalidParams
|
||||
}
|
||||
}
|
||||
|
||||
appExecResults, err := s.chain.GetAppExecResults(hash, trigger.All)
|
||||
if err != nil {
|
||||
return nil, response.NewRPCError("Unknown transaction or block", "", err)
|
||||
}
|
||||
return result.NewApplicationLog(hash, appExecResults), nil
|
||||
return result.NewApplicationLog(hash, appExecResults, trig), nil
|
||||
}
|
||||
|
||||
func (s *Server) getNEP5Balances(ps request.Params) (interface{}, *response.Error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue