2021-10-26 11:28:14 +00:00
|
|
|
package tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-11-17 15:30:21 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/interop/storage"
|
2021-10-26 11:28:14 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/neotest"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
|
2022-11-17 15:30:21 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
2021-10-26 11:28:14 +00:00
|
|
|
)
|
|
|
|
|
2022-11-17 15:30:21 +00:00
|
|
|
func iteratorToArray(iter *storage.Iterator) []stackitem.Item {
|
|
|
|
stackItems := make([]stackitem.Item, 0)
|
|
|
|
for iter.Next() {
|
|
|
|
stackItems = append(stackItems, iter.Value())
|
|
|
|
}
|
|
|
|
return stackItems
|
|
|
|
}
|
|
|
|
|
2021-10-26 11:28:14 +00:00
|
|
|
func newExecutor(t *testing.T) *neotest.Executor {
|
|
|
|
bc, acc := chain.NewSingle(t)
|
|
|
|
return neotest.NewExecutor(t, bc, acc, acc)
|
|
|
|
}
|