Merge pull request #1531 from nspcc-dev/core/applicationlog_with_multiple_triggers

core, rpc: store multiple execution results for single hash
This commit is contained in:
Roman Khimov 2020-11-12 19:05:22 +03:00 committed by GitHub
commit 0f827ee6ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 441 additions and 199 deletions

View file

@ -18,6 +18,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result"
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/wallet"
)
@ -25,11 +26,14 @@ import (
var errNetworkNotInitialized = errors.New("RPC client network is not initialized")
// GetApplicationLog returns the contract log based on the specified txid.
func (c *Client) GetApplicationLog(hash util.Uint256) (*state.AppExecResult, error) {
func (c *Client) GetApplicationLog(hash util.Uint256, trig *trigger.Type) (*result.ApplicationLog, error) {
var (
params = request.NewRawParams(hash.StringLE())
resp = new(state.AppExecResult)
resp = new(result.ApplicationLog)
)
if trig != nil {
params.Values = append(params.Values, trig.String())
}
if err := c.performRequest("getapplicationlog", params, resp); err != nil {
return nil, err
}