core, rpc: allow to store several AppExecResult for a single hash

It is required for we have several executions per block.
This commit is contained in:
Anna Shaleva 2020-11-11 18:43:28 +03:00
parent e700fb2c96
commit 7ca93e76ac
18 changed files with 384 additions and 178 deletions

View file

@ -19,6 +19,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neo-go/pkg/network"
"github.com/nspcc-dev/neo-go/pkg/rpc/server"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm"
"github.com/stretchr/testify/require"
@ -197,9 +198,10 @@ func (e *executor) checkTxPersisted(t *testing.T, prefix ...string) (*transactio
require.NoError(t, err, "can't decode tx hash: %s", line)
tx, height := e.GetTransaction(t, h)
aer, err := e.Chain.GetAppExecResult(tx.Hash())
aer, err := e.Chain.GetAppExecResults(tx.Hash(), trigger.Application)
require.NoError(t, err)
require.Equal(t, vm.HaltState, aer.VMState)
require.Equal(t, 1, len(aer))
require.Equal(t, vm.HaltState, aer[0].VMState)
return tx, height
}