frostfs-contract/commonclient/invoker.go
Denis Kirillov b76f592095 [#48] Add commonclient package
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2023-11-08 15:44:01 +03:00

20 lines
790 B
Go

package commonclient
import (
"github.com/google/uuid"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
"github.com/nspcc-dev/neo-go/pkg/rpcclient/invoker"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
// Invoker is a subset of methods provided by struct invoker.Invoker. The subset contains only those
// methods that are used by ActorWrapper and clients of the contracts.
type Invoker interface {
Call(contract util.Uint160, method string, params ...any) (*result.Invoke, error)
TraverseIterator(sessionID uuid.UUID, iterator *result.Iterator, num int) ([]stackitem.Item, error)
TerminateSession(sessionID uuid.UUID) error
}
// Ensure the interface is compatible with the invoker.Invoker struct.
var _ Invoker = (*invoker.Invoker)(nil)