* fix(wallet)_: fix provider down event happening too often - handle context cancelled error - do not count expected errors when calling tokenURI as providers errors - use archival not for optimism (was silently added by Grove makeing the old URL non-archival) Closes #5555 * test(wallet)_: add test for collectibles manager to verify that main circuit is not tripped calling by tokenURI method Co-authored-by: IvanBelyakoff <ivan.belyakov.job@gmail.com>
This commit is contained in:
parent
e16d820ecd
commit
a57055f43b
3
Makefile
3
Makefile
|
@ -354,6 +354,9 @@ mock: ##@other Regenerate mocks
|
||||||
mockgen -package=mock_balance_persistence -destination=services/wallet/token/mock/balance_persistence/balance_persistence.go -source=services/wallet/token/balance_persistence.go
|
mockgen -package=mock_balance_persistence -destination=services/wallet/token/mock/balance_persistence/balance_persistence.go -source=services/wallet/token/balance_persistence.go
|
||||||
mockgen -package=mock_network -destination=rpc/network/mock/network.go -source=rpc/network/network.go
|
mockgen -package=mock_network -destination=rpc/network/mock/network.go -source=rpc/network/network.go
|
||||||
mockgen -package=mock_rpcclient -destination=rpc/mock/client/client.go -source=rpc/client.go
|
mockgen -package=mock_rpcclient -destination=rpc/mock/client/client.go -source=rpc/client.go
|
||||||
|
mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collection_data_db.go -source=services/wallet/collectibles/collection_data_db.go
|
||||||
|
mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collectible_data_db.go -source=services/wallet/collectibles/collectible_data_db.go
|
||||||
|
mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/collectible_types.go -source=services/wallet/thirdparty/collectible_types.go
|
||||||
|
|
||||||
docker-test: ##@tests Run tests in a docker container with golang.
|
docker-test: ##@tests Run tests in a docker container with golang.
|
||||||
docker run --privileged --rm -it -v "$(PWD):$(DOCKER_TEST_WORKDIR)" -w "$(DOCKER_TEST_WORKDIR)" $(DOCKER_TEST_IMAGE) go test ${ARGS}
|
docker run --privileged --rm -it -v "$(PWD):$(DOCKER_TEST_WORKDIR)" -w "$(DOCKER_TEST_WORKDIR)" $(DOCKER_TEST_IMAGE) go test ${ARGS}
|
||||||
|
|
|
@ -56,7 +56,8 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CircuitBreaker struct {
|
type CircuitBreaker struct {
|
||||||
config Config
|
config Config
|
||||||
|
circuitNameHandler func(string) string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCircuitBreaker(config Config) *CircuitBreaker {
|
func NewCircuitBreaker(config Config) *CircuitBreaker {
|
||||||
|
@ -96,8 +97,13 @@ func (cb *CircuitBreaker) Execute(cmd *Command) CommandResult {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if hystrix.GetCircuitSettings()[f.circuitName] == nil {
|
circuitName := f.circuitName
|
||||||
hystrix.ConfigureCommand(f.circuitName, hystrix.CommandConfig{
|
if cb.circuitNameHandler != nil {
|
||||||
|
circuitName = cb.circuitNameHandler(circuitName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if hystrix.GetCircuitSettings()[circuitName] == nil {
|
||||||
|
hystrix.ConfigureCommand(circuitName, hystrix.CommandConfig{
|
||||||
Timeout: cb.config.Timeout,
|
Timeout: cb.config.Timeout,
|
||||||
MaxConcurrentRequests: cb.config.MaxConcurrentRequests,
|
MaxConcurrentRequests: cb.config.MaxConcurrentRequests,
|
||||||
RequestVolumeThreshold: cb.config.RequestVolumeThreshold,
|
RequestVolumeThreshold: cb.config.RequestVolumeThreshold,
|
||||||
|
@ -106,7 +112,7 @@ func (cb *CircuitBreaker) Execute(cmd *Command) CommandResult {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
err := hystrix.DoC(ctx, f.circuitName, func(ctx context.Context) error {
|
err := hystrix.DoC(ctx, circuitName, func(ctx context.Context) error {
|
||||||
res, err := f.exec()
|
res, err := f.exec()
|
||||||
// Write to result only if success
|
// Write to result only if success
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -131,3 +137,19 @@ func (cb *CircuitBreaker) Execute(cmd *Command) CommandResult {
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *CircuitBreaker) SetOverrideCircuitNameHandler(f func(string) string) {
|
||||||
|
c.circuitNameHandler = f
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expects a circuit to exist because a new circuit is always closed.
|
||||||
|
// Call CircuitExists to check if a circuit exists.
|
||||||
|
func IsCircuitOpen(circuitName string) bool {
|
||||||
|
circuit, wasCreated, _ := hystrix.GetCircuit(circuitName)
|
||||||
|
return !wasCreated && circuit.IsOpen()
|
||||||
|
}
|
||||||
|
|
||||||
|
func CircuitExists(circuitName string) bool {
|
||||||
|
_, wasCreated, _ := hystrix.GetCircuit(circuitName)
|
||||||
|
return !wasCreated
|
||||||
|
}
|
||||||
|
|
|
@ -45,20 +45,20 @@ func TestCircuitBreaker_ExecuteMultipleFallbacksFail(t *testing.T) {
|
||||||
ErrorPercentThreshold: 10,
|
ErrorPercentThreshold: 10,
|
||||||
})
|
})
|
||||||
|
|
||||||
circuitName := ""
|
circuitName := fmt.Sprintf("ExecuteMultipleFallbacksFail_%d", time.Now().Nanosecond()) // unique name to avoid conflicts with go tests `-count` option
|
||||||
errSecProvFailed := errors.New("provider 2 failed")
|
errSecProvFailed := errors.New("provider 2 failed")
|
||||||
errThirdProvFailed := errors.New("provider 3 failed")
|
errThirdProvFailed := errors.New("provider 3 failed")
|
||||||
cmd := NewCommand(context.TODO(), []*Functor{
|
cmd := NewCommand(context.TODO(), []*Functor{
|
||||||
NewFunctor(func() ([]interface{}, error) {
|
NewFunctor(func() ([]interface{}, error) {
|
||||||
time.Sleep(100 * time.Millisecond) // will cause hystrix: timeout
|
time.Sleep(100 * time.Millisecond) // will cause hystrix: timeout
|
||||||
return []any{success}, nil
|
return []any{success}, nil
|
||||||
}, circuitName),
|
}, circuitName+"1"),
|
||||||
NewFunctor(func() ([]interface{}, error) {
|
NewFunctor(func() ([]interface{}, error) {
|
||||||
return nil, errSecProvFailed
|
return nil, errSecProvFailed
|
||||||
}, circuitName),
|
}, circuitName+"2"),
|
||||||
NewFunctor(func() ([]interface{}, error) {
|
NewFunctor(func() ([]interface{}, error) {
|
||||||
return nil, errThirdProvFailed
|
return nil, errThirdProvFailed
|
||||||
}, circuitName),
|
}, circuitName+"3"),
|
||||||
})
|
})
|
||||||
|
|
||||||
result := cb.Execute(cmd)
|
result := cb.Execute(cmd)
|
||||||
|
@ -173,6 +173,8 @@ func TestCircuitBreaker_ExecuteHealthCheckOnWindowTimeout(t *testing.T) {
|
||||||
|
|
||||||
assert.Less(t, prov1Called, 3) // most of the time only 1 call is made, but occasionally 2 can happen
|
assert.Less(t, prov1Called, 3) // most of the time only 1 call is made, but occasionally 2 can happen
|
||||||
assert.Equal(t, 10, prov2Called)
|
assert.Equal(t, 10, prov2Called)
|
||||||
|
assert.True(t, CircuitExists(circuitName+"1"))
|
||||||
|
assert.True(t, IsCircuitOpen(circuitName+"1"))
|
||||||
|
|
||||||
// Wait for the sleep window to expire
|
// Wait for the sleep window to expire
|
||||||
time.Sleep(time.Duration(sleepWindow+1) * time.Millisecond)
|
time.Sleep(time.Duration(sleepWindow+1) * time.Millisecond)
|
||||||
|
@ -230,3 +232,19 @@ func TestCircuitBreaker_EmptyOrNilCommand(t *testing.T) {
|
||||||
result = cb.Execute(nil)
|
result = cb.Execute(nil)
|
||||||
require.Error(t, result.Error())
|
require.Error(t, result.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCircuitBreaker_CircuitExistsAndClosed(t *testing.T) {
|
||||||
|
timestamp := time.Now().Nanosecond()
|
||||||
|
nonExCircuit := fmt.Sprintf("nonexistent_%d", timestamp) // unique name to avoid conflicts with go tests `-count` option
|
||||||
|
require.False(t, CircuitExists(nonExCircuit))
|
||||||
|
|
||||||
|
cb := NewCircuitBreaker(Config{})
|
||||||
|
cmd := NewCommand(context.TODO(), nil)
|
||||||
|
existCircuit := fmt.Sprintf("existing_%d", timestamp) // unique name to avoid conflicts with go tests `-count` option
|
||||||
|
cmd.Add(NewFunctor(func() ([]interface{}, error) {
|
||||||
|
return nil, nil
|
||||||
|
}, existCircuit))
|
||||||
|
_ = cb.Execute(cmd)
|
||||||
|
require.True(t, CircuitExists(existCircuit))
|
||||||
|
require.False(t, IsCircuitOpen(existCircuit))
|
||||||
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/ethclient"
|
"github.com/ethereum/go-ethereum/ethclient"
|
||||||
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
"github.com/status-im/status-go/circuitbreaker"
|
"github.com/status-im/status-go/circuitbreaker"
|
||||||
"github.com/status-im/status-go/services/rpcstats"
|
"github.com/status-im/status-go/services/rpcstats"
|
||||||
|
@ -71,6 +72,15 @@ func DeepCopyTagger(t Tagger) Tagger {
|
||||||
return t.DeepCopyTag()
|
return t.DeepCopyTag()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type HealthMonitor interface {
|
||||||
|
GetCircuitBreaker() *circuitbreaker.CircuitBreaker
|
||||||
|
SetCircuitBreaker(cb *circuitbreaker.CircuitBreaker)
|
||||||
|
}
|
||||||
|
|
||||||
|
type Copyable interface {
|
||||||
|
Copy() interface{}
|
||||||
|
}
|
||||||
|
|
||||||
// Shallow copy of the client with a deep copy of tag and group tag
|
// Shallow copy of the client with a deep copy of tag and group tag
|
||||||
// To avoid passing tags as parameter to every chain call, it is sufficient for now
|
// To avoid passing tags as parameter to every chain call, it is sufficient for now
|
||||||
// to set the tag and group tag once on the client
|
// to set the tag and group tag once on the client
|
||||||
|
@ -117,6 +127,20 @@ type ClientWithFallback struct {
|
||||||
groupTag string // tag for the limiter group
|
groupTag string // tag for the limiter group
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ClientWithFallback) Copy() interface{} {
|
||||||
|
return &ClientWithFallback{
|
||||||
|
ChainID: c.ChainID,
|
||||||
|
ethClients: c.ethClients,
|
||||||
|
commonLimiter: c.commonLimiter,
|
||||||
|
circuitbreaker: c.circuitbreaker,
|
||||||
|
WalletNotifier: c.WalletNotifier,
|
||||||
|
isConnected: c.isConnected,
|
||||||
|
LastCheckedAt: c.LastCheckedAt,
|
||||||
|
tag: c.tag,
|
||||||
|
groupTag: c.groupTag,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Don't mark connection as failed if we get one of these errors
|
// Don't mark connection as failed if we get one of these errors
|
||||||
var propagateErrors = []error{
|
var propagateErrors = []error{
|
||||||
vm.ErrOutOfGas,
|
vm.ErrOutOfGas,
|
||||||
|
@ -263,7 +287,7 @@ func (c *ClientWithFallback) makeCall(ctx context.Context, ethClients []*EthClie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isVMError(err) {
|
if isVMError(err) || errors.Is(err, context.Canceled) {
|
||||||
cmd.Cancel()
|
cmd.Cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,8 +972,10 @@ func (c *ClientWithFallback) SetWalletNotifier(notifier func(chainId uint64, mes
|
||||||
func (c *ClientWithFallback) toggleConnectionState(err error) {
|
func (c *ClientWithFallback) toggleConnectionState(err error) {
|
||||||
connected := true
|
connected := true
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !isVMError(err) && !errors.Is(err, ErrRequestsOverLimit) {
|
if !isVMError(err) && !errors.Is(err, ErrRequestsOverLimit) && !errors.Is(err, context.Canceled) {
|
||||||
connected = false
|
connected = false
|
||||||
|
} else {
|
||||||
|
log.Warn("Error in chain call", "error", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.SetIsConnected(connected)
|
c.SetIsConnected(connected)
|
||||||
|
@ -983,3 +1009,11 @@ func (c *ClientWithFallback) GetLimiter() RequestLimiter {
|
||||||
func (c *ClientWithFallback) SetLimiter(limiter RequestLimiter) {
|
func (c *ClientWithFallback) SetLimiter(limiter RequestLimiter) {
|
||||||
c.commonLimiter = limiter
|
c.commonLimiter = limiter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ClientWithFallback) GetCircuitBreaker() *circuitbreaker.CircuitBreaker {
|
||||||
|
return c.circuitbreaker
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ClientWithFallback) SetCircuitBreaker(cb *circuitbreaker.CircuitBreaker) {
|
||||||
|
c.circuitbreaker = cb
|
||||||
|
}
|
||||||
|
|
|
@ -11,6 +11,14 @@ import (
|
||||||
"github.com/status-im/status-go/sqlite"
|
"github.com/status-im/status-go/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type CollectibleDataStorage interface {
|
||||||
|
SetData(collectibles []thirdparty.CollectibleData, allowUpdate bool) error
|
||||||
|
GetIDsNotInDB(ids []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleUniqueID, error)
|
||||||
|
GetData(ids []thirdparty.CollectibleUniqueID) (map[string]thirdparty.CollectibleData, error)
|
||||||
|
SetCommunityInfo(id thirdparty.CollectibleUniqueID, communityInfo thirdparty.CollectibleCommunityInfo) error
|
||||||
|
GetCommunityInfo(id thirdparty.CollectibleUniqueID) (*thirdparty.CollectibleCommunityInfo, error)
|
||||||
|
}
|
||||||
|
|
||||||
type CollectibleDataDB struct {
|
type CollectibleDataDB struct {
|
||||||
db *sql.DB
|
db *sql.DB
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,14 @@ import (
|
||||||
"github.com/status-im/status-go/sqlite"
|
"github.com/status-im/status-go/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type CollectionDataStorage interface {
|
||||||
|
SetData(collections []thirdparty.CollectionData, allowUpdate bool) error
|
||||||
|
GetIDsNotInDB(ids []thirdparty.ContractID) ([]thirdparty.ContractID, error)
|
||||||
|
GetData(ids []thirdparty.ContractID) (map[string]thirdparty.CollectionData, error)
|
||||||
|
SetCollectionSocialsData(id thirdparty.ContractID, collectionSocials *thirdparty.CollectionSocials) error
|
||||||
|
GetSocialsForID(contractID thirdparty.ContractID) (*thirdparty.CollectionSocials, error)
|
||||||
|
}
|
||||||
|
|
||||||
type CollectionDataDB struct {
|
type CollectionDataDB struct {
|
||||||
db *sql.DB
|
db *sql.DB
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"github.com/status-im/status-go/contracts/community-tokens/collectibles"
|
"github.com/status-im/status-go/contracts/community-tokens/collectibles"
|
||||||
"github.com/status-im/status-go/contracts/ierc1155"
|
"github.com/status-im/status-go/contracts/ierc1155"
|
||||||
"github.com/status-im/status-go/rpc"
|
"github.com/status-im/status-go/rpc"
|
||||||
|
"github.com/status-im/status-go/rpc/chain"
|
||||||
"github.com/status-im/status-go/server"
|
"github.com/status-im/status-go/server"
|
||||||
"github.com/status-im/status-go/services/wallet/async"
|
"github.com/status-im/status-go/services/wallet/async"
|
||||||
"github.com/status-im/status-go/services/wallet/bigint"
|
"github.com/status-im/status-go/services/wallet/bigint"
|
||||||
|
@ -52,13 +53,13 @@ type ManagerInterface interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Manager struct {
|
type Manager struct {
|
||||||
rpcClient *rpc.Client
|
rpcClient rpc.ClientInterface
|
||||||
providers thirdparty.CollectibleProviders
|
providers thirdparty.CollectibleProviders
|
||||||
|
|
||||||
httpClient *http.Client
|
httpClient *http.Client
|
||||||
|
|
||||||
collectiblesDataDB *CollectibleDataDB
|
collectiblesDataDB CollectibleDataStorage
|
||||||
collectionsDataDB *CollectionDataDB
|
collectionsDataDB CollectionDataStorage
|
||||||
communityManager *community.Manager
|
communityManager *community.Manager
|
||||||
ownershipDB *OwnershipDB
|
ownershipDB *OwnershipDB
|
||||||
|
|
||||||
|
@ -72,14 +73,20 @@ type Manager struct {
|
||||||
|
|
||||||
func NewManager(
|
func NewManager(
|
||||||
db *sql.DB,
|
db *sql.DB,
|
||||||
rpcClient *rpc.Client,
|
rpcClient rpc.ClientInterface,
|
||||||
communityManager *community.Manager,
|
communityManager *community.Manager,
|
||||||
providers thirdparty.CollectibleProviders,
|
providers thirdparty.CollectibleProviders,
|
||||||
mediaServer *server.MediaServer,
|
mediaServer *server.MediaServer,
|
||||||
feed *event.Feed) *Manager {
|
feed *event.Feed) *Manager {
|
||||||
|
|
||||||
ownershipDB := NewOwnershipDB(db)
|
var ownershipDB *OwnershipDB
|
||||||
statuses := initStatuses(ownershipDB)
|
var statuses *sync.Map
|
||||||
|
var statusNotifier *connection.StatusNotifier
|
||||||
|
if db != nil {
|
||||||
|
ownershipDB = NewOwnershipDB(db)
|
||||||
|
statuses = initStatuses(ownershipDB)
|
||||||
|
statusNotifier = createStatusNotifier(statuses, feed)
|
||||||
|
}
|
||||||
|
|
||||||
cb := circuitbreaker.NewCircuitBreaker(circuitbreaker.Config{
|
cb := circuitbreaker.NewCircuitBreaker(circuitbreaker.Config{
|
||||||
Timeout: 10000,
|
Timeout: 10000,
|
||||||
|
@ -101,7 +108,7 @@ func NewManager(
|
||||||
ownershipDB: ownershipDB,
|
ownershipDB: ownershipDB,
|
||||||
mediaServer: mediaServer,
|
mediaServer: mediaServer,
|
||||||
statuses: statuses,
|
statuses: statuses,
|
||||||
statusNotifier: createStatusNotifier(statuses, feed),
|
statusNotifier: statusNotifier,
|
||||||
feed: feed,
|
feed: feed,
|
||||||
circuitBreaker: cb,
|
circuitBreaker: cb,
|
||||||
}
|
}
|
||||||
|
@ -577,12 +584,15 @@ func (o *Manager) fetchTokenURI(ctx context.Context, id thirdparty.CollectibleUn
|
||||||
if id.TokenID == nil {
|
if id.TokenID == nil {
|
||||||
return "", errors.New("empty token ID")
|
return "", errors.New("empty token ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
backend, err := o.rpcClient.EthClient(uint64(id.ContractID.ChainID))
|
backend, err := o.rpcClient.EthClient(uint64(id.ContractID.ChainID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backend = getClientWithNoCircuitTripping(backend)
|
||||||
caller, err := collectibles.NewCollectiblesCaller(id.ContractID.Address, backend)
|
caller, err := collectibles.NewCollectiblesCaller(id.ContractID.Address, backend)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -1162,3 +1172,32 @@ func createStatusNotifier(statuses *sync.Map, feed *event.Feed) *connection.Stat
|
||||||
func getCircuitName(provider thirdparty.CollectibleProvider, chainID walletCommon.ChainID) string {
|
func getCircuitName(provider thirdparty.CollectibleProvider, chainID walletCommon.ChainID) string {
|
||||||
return provider.ID() + chainID.String()
|
return provider.ID() + chainID.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getCircuitNameForTokenURI(mainCircuitName string) string {
|
||||||
|
return mainCircuitName + "_tokenURI"
|
||||||
|
}
|
||||||
|
|
||||||
|
// As we don't use hystrix internal way of switching to another circuit, just its metrics,
|
||||||
|
// we still can switch to another provider without tripping the circuit.
|
||||||
|
func getClientWithNoCircuitTripping(backend chain.ClientInterface) chain.ClientInterface {
|
||||||
|
copyable := backend.(chain.Copyable)
|
||||||
|
if copyable != nil {
|
||||||
|
backendCopy := copyable.Copy().(chain.ClientInterface)
|
||||||
|
hm := backendCopy.(chain.HealthMonitor)
|
||||||
|
if hm != nil {
|
||||||
|
cb := circuitbreaker.NewCircuitBreaker(circuitbreaker.Config{
|
||||||
|
Timeout: 20000,
|
||||||
|
MaxConcurrentRequests: 100,
|
||||||
|
SleepWindow: 300000,
|
||||||
|
ErrorPercentThreshold: 101, // Always healthy
|
||||||
|
})
|
||||||
|
cb.SetOverrideCircuitNameHandler(func(circuitName string) string {
|
||||||
|
return getCircuitNameForTokenURI(circuitName)
|
||||||
|
})
|
||||||
|
hm.SetCircuitBreaker(cb)
|
||||||
|
backend = backendCopy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return backend
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
package collectibles
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"math/big"
|
||||||
|
"sync"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang/mock/gomock"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/status-im/status-go/circuitbreaker"
|
||||||
|
mock_client "github.com/status-im/status-go/rpc/chain/mock/client"
|
||||||
|
mock_rpcclient "github.com/status-im/status-go/rpc/mock/client"
|
||||||
|
"github.com/status-im/status-go/services/wallet/bigint"
|
||||||
|
mock_collectibles "github.com/status-im/status-go/services/wallet/collectibles/mock"
|
||||||
|
walletCommon "github.com/status-im/status-go/services/wallet/common"
|
||||||
|
"github.com/status-im/status-go/services/wallet/thirdparty"
|
||||||
|
mock_thirdparty "github.com/status-im/status-go/services/wallet/thirdparty/mock"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CopyableMockChainClient struct {
|
||||||
|
*mock_client.MockClientInterface
|
||||||
|
cb *circuitbreaker.CircuitBreaker
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CopyableMockChainClient) Copy() interface{} {
|
||||||
|
return &CopyableMockChainClient{
|
||||||
|
MockClientInterface: c.MockClientInterface,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CopyableMockChainClient) GetCircuitBreaker() *circuitbreaker.CircuitBreaker {
|
||||||
|
return c.cb
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CopyableMockChainClient) SetCircuitBreaker(cb *circuitbreaker.CircuitBreaker) {
|
||||||
|
c.cb = cb
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestManager_FetchAllAssetsByOwner(t *testing.T) {
|
||||||
|
mockCtrl := gomock.NewController(t)
|
||||||
|
defer mockCtrl.Finish()
|
||||||
|
|
||||||
|
ctx := context.TODO()
|
||||||
|
chainID := walletCommon.ChainID(1)
|
||||||
|
owner := common.HexToAddress("0x1234567890abcdef")
|
||||||
|
cursor := ""
|
||||||
|
limit := 1
|
||||||
|
timestamp := time.Now().Nanosecond()
|
||||||
|
providerID := fmt.Sprintf("circuit_%d", timestamp)
|
||||||
|
|
||||||
|
chainClient := &CopyableMockChainClient{
|
||||||
|
MockClientInterface: mock_client.NewMockClientInterface(mockCtrl),
|
||||||
|
}
|
||||||
|
chainClient.EXPECT().CallContract(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, nil).Times(limit)
|
||||||
|
chainClient.EXPECT().CodeAt(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, nil).Times(limit)
|
||||||
|
rpcClient := mock_rpcclient.NewMockClientInterface(mockCtrl)
|
||||||
|
rpcClient.EXPECT().EthClient(gomock.Any()).Return(chainClient, nil).AnyTimes()
|
||||||
|
mockProvider1 := mock_thirdparty.NewMockCollectibleAccountOwnershipProvider(mockCtrl)
|
||||||
|
|
||||||
|
mockProviders := thirdparty.CollectibleProviders{
|
||||||
|
AccountOwnershipProviders: []thirdparty.CollectibleAccountOwnershipProvider{mockProvider1},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate many collectibles, but none support toeknURI method, but circuit must not be tripped
|
||||||
|
var items []thirdparty.FullCollectibleData
|
||||||
|
for i := 0; i < limit; i++ {
|
||||||
|
items = append(items, thirdparty.FullCollectibleData{
|
||||||
|
CollectibleData: thirdparty.CollectibleData{
|
||||||
|
ID: thirdparty.CollectibleUniqueID{
|
||||||
|
ContractID: thirdparty.ContractID{
|
||||||
|
Address: common.HexToAddress(fmt.Sprintf("0x%064x", i)),
|
||||||
|
},
|
||||||
|
TokenID: &bigint.BigInt{
|
||||||
|
Int: big.NewInt(int64(i)),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
mockAssetContainer := &thirdparty.FullCollectibleDataContainer{
|
||||||
|
Items: items,
|
||||||
|
}
|
||||||
|
|
||||||
|
mockProvider1.EXPECT().IsChainSupported(chainID).Return(true).AnyTimes()
|
||||||
|
mockProvider1.EXPECT().IsConnected().Return(true).AnyTimes()
|
||||||
|
mockProvider1.EXPECT().ID().Return(providerID).AnyTimes()
|
||||||
|
mockProvider1.EXPECT().FetchAllAssetsByOwner(gomock.Any(), chainID, owner, cursor, limit).Return(mockAssetContainer, nil)
|
||||||
|
|
||||||
|
manager := NewManager(nil, rpcClient, nil, mockProviders, nil, nil)
|
||||||
|
manager.statuses = &sync.Map{}
|
||||||
|
collectiblesDataDB := mock_collectibles.NewMockCollectibleDataStorage(mockCtrl)
|
||||||
|
collectiblesDataDB.EXPECT().SetData(gomock.Any(), gomock.Any()).Return(nil)
|
||||||
|
collectionsDataDB := mock_collectibles.NewMockCollectionDataStorage(mockCtrl)
|
||||||
|
collectionsDataDB.EXPECT().SetData(gomock.Any(), gomock.Any()).Return(nil)
|
||||||
|
manager.collectiblesDataDB = collectiblesDataDB
|
||||||
|
manager.collectionsDataDB = collectionsDataDB
|
||||||
|
|
||||||
|
assetContainer, err := manager.FetchAllAssetsByOwner(ctx, chainID, owner, cursor, limit, providerID)
|
||||||
|
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, mockAssetContainer, assetContainer)
|
||||||
|
|
||||||
|
// Make sure the main circuit is not tripped
|
||||||
|
circuitName := getCircuitName(mockProvider1, chainID)
|
||||||
|
assert.True(t, circuitbreaker.CircuitExists(circuitName))
|
||||||
|
assert.False(t, circuitbreaker.IsCircuitOpen(circuitName))
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: services/wallet/collectibles/collectible_data_db.go
|
||||||
|
|
||||||
|
// Package mock_collectibles is a generated GoMock package.
|
||||||
|
package mock_collectibles
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "github.com/golang/mock/gomock"
|
||||||
|
|
||||||
|
thirdparty "github.com/status-im/status-go/services/wallet/thirdparty"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockCollectibleDataStorage is a mock of CollectibleDataStorage interface.
|
||||||
|
type MockCollectibleDataStorage struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleDataStorageMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleDataStorageMockRecorder is the mock recorder for MockCollectibleDataStorage.
|
||||||
|
type MockCollectibleDataStorageMockRecorder struct {
|
||||||
|
mock *MockCollectibleDataStorage
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleDataStorage creates a new mock instance.
|
||||||
|
func NewMockCollectibleDataStorage(ctrl *gomock.Controller) *MockCollectibleDataStorage {
|
||||||
|
mock := &MockCollectibleDataStorage{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleDataStorageMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleDataStorage) EXPECT() *MockCollectibleDataStorageMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetCommunityInfo mocks base method.
|
||||||
|
func (m *MockCollectibleDataStorage) GetCommunityInfo(id thirdparty.CollectibleUniqueID) (*thirdparty.CollectibleCommunityInfo, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetCommunityInfo", id)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.CollectibleCommunityInfo)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetCommunityInfo indicates an expected call of GetCommunityInfo.
|
||||||
|
func (mr *MockCollectibleDataStorageMockRecorder) GetCommunityInfo(id interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommunityInfo", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetCommunityInfo), id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetData mocks base method.
|
||||||
|
func (m *MockCollectibleDataStorage) GetData(ids []thirdparty.CollectibleUniqueID) (map[string]thirdparty.CollectibleData, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetData", ids)
|
||||||
|
ret0, _ := ret[0].(map[string]thirdparty.CollectibleData)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetData indicates an expected call of GetData.
|
||||||
|
func (mr *MockCollectibleDataStorageMockRecorder) GetData(ids interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetData", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetData), ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetIDsNotInDB mocks base method.
|
||||||
|
func (m *MockCollectibleDataStorage) GetIDsNotInDB(ids []thirdparty.CollectibleUniqueID) ([]thirdparty.CollectibleUniqueID, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetIDsNotInDB", ids)
|
||||||
|
ret0, _ := ret[0].([]thirdparty.CollectibleUniqueID)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetIDsNotInDB indicates an expected call of GetIDsNotInDB.
|
||||||
|
func (mr *MockCollectibleDataStorageMockRecorder) GetIDsNotInDB(ids interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIDsNotInDB", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetIDsNotInDB), ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCommunityInfo mocks base method.
|
||||||
|
func (m *MockCollectibleDataStorage) SetCommunityInfo(id thirdparty.CollectibleUniqueID, communityInfo thirdparty.CollectibleCommunityInfo) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SetCommunityInfo", id, communityInfo)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCommunityInfo indicates an expected call of SetCommunityInfo.
|
||||||
|
func (mr *MockCollectibleDataStorageMockRecorder) SetCommunityInfo(id, communityInfo interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCommunityInfo", reflect.TypeOf((*MockCollectibleDataStorage)(nil).SetCommunityInfo), id, communityInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetData mocks base method.
|
||||||
|
func (m *MockCollectibleDataStorage) SetData(collectibles []thirdparty.CollectibleData, allowUpdate bool) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SetData", collectibles, allowUpdate)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetData indicates an expected call of SetData.
|
||||||
|
func (mr *MockCollectibleDataStorageMockRecorder) SetData(collectibles, allowUpdate interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetData", reflect.TypeOf((*MockCollectibleDataStorage)(nil).SetData), collectibles, allowUpdate)
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: services/wallet/collectibles/collection_data_db.go
|
||||||
|
|
||||||
|
// Package mock_collectibles is a generated GoMock package.
|
||||||
|
package mock_collectibles
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "github.com/golang/mock/gomock"
|
||||||
|
|
||||||
|
thirdparty "github.com/status-im/status-go/services/wallet/thirdparty"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockCollectionDataStorage is a mock of CollectionDataStorage interface.
|
||||||
|
type MockCollectionDataStorage struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectionDataStorageMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectionDataStorageMockRecorder is the mock recorder for MockCollectionDataStorage.
|
||||||
|
type MockCollectionDataStorageMockRecorder struct {
|
||||||
|
mock *MockCollectionDataStorage
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectionDataStorage creates a new mock instance.
|
||||||
|
func NewMockCollectionDataStorage(ctrl *gomock.Controller) *MockCollectionDataStorage {
|
||||||
|
mock := &MockCollectionDataStorage{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectionDataStorageMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectionDataStorage) EXPECT() *MockCollectionDataStorageMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetData mocks base method.
|
||||||
|
func (m *MockCollectionDataStorage) GetData(ids []thirdparty.ContractID) (map[string]thirdparty.CollectionData, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetData", ids)
|
||||||
|
ret0, _ := ret[0].(map[string]thirdparty.CollectionData)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetData indicates an expected call of GetData.
|
||||||
|
func (mr *MockCollectionDataStorageMockRecorder) GetData(ids interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetData", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetData), ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetIDsNotInDB mocks base method.
|
||||||
|
func (m *MockCollectionDataStorage) GetIDsNotInDB(ids []thirdparty.ContractID) ([]thirdparty.ContractID, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetIDsNotInDB", ids)
|
||||||
|
ret0, _ := ret[0].([]thirdparty.ContractID)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetIDsNotInDB indicates an expected call of GetIDsNotInDB.
|
||||||
|
func (mr *MockCollectionDataStorageMockRecorder) GetIDsNotInDB(ids interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIDsNotInDB", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetIDsNotInDB), ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSocialsForID mocks base method.
|
||||||
|
func (m *MockCollectionDataStorage) GetSocialsForID(contractID thirdparty.ContractID) (*thirdparty.CollectionSocials, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetSocialsForID", contractID)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.CollectionSocials)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSocialsForID indicates an expected call of GetSocialsForID.
|
||||||
|
func (mr *MockCollectionDataStorageMockRecorder) GetSocialsForID(contractID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSocialsForID", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetSocialsForID), contractID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCollectionSocialsData mocks base method.
|
||||||
|
func (m *MockCollectionDataStorage) SetCollectionSocialsData(id thirdparty.ContractID, collectionSocials *thirdparty.CollectionSocials) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SetCollectionSocialsData", id, collectionSocials)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCollectionSocialsData indicates an expected call of SetCollectionSocialsData.
|
||||||
|
func (mr *MockCollectionDataStorageMockRecorder) SetCollectionSocialsData(id, collectionSocials interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCollectionSocialsData", reflect.TypeOf((*MockCollectionDataStorage)(nil).SetCollectionSocialsData), id, collectionSocials)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetData mocks base method.
|
||||||
|
func (m *MockCollectionDataStorage) SetData(collections []thirdparty.CollectionData, allowUpdate bool) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SetData", collections, allowUpdate)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetData indicates an expected call of SetData.
|
||||||
|
func (mr *MockCollectionDataStorageMockRecorder) SetData(collections, allowUpdate interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetData", reflect.TypeOf((*MockCollectionDataStorage)(nil).SetData), collections, allowUpdate)
|
||||||
|
}
|
|
@ -0,0 +1,526 @@
|
||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: services/wallet/thirdparty/collectible_types.go
|
||||||
|
|
||||||
|
// Package mock_thirdparty is a generated GoMock package.
|
||||||
|
package mock_thirdparty
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "github.com/golang/mock/gomock"
|
||||||
|
|
||||||
|
common "github.com/ethereum/go-ethereum/common"
|
||||||
|
common0 "github.com/status-im/status-go/services/wallet/common"
|
||||||
|
thirdparty "github.com/status-im/status-go/services/wallet/thirdparty"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockCollectibleProvider is a mock of CollectibleProvider interface.
|
||||||
|
type MockCollectibleProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleProviderMockRecorder is the mock recorder for MockCollectibleProvider.
|
||||||
|
type MockCollectibleProviderMockRecorder struct {
|
||||||
|
mock *MockCollectibleProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleProvider creates a new mock instance.
|
||||||
|
func NewMockCollectibleProvider(ctrl *gomock.Controller) *MockCollectibleProvider {
|
||||||
|
mock := &MockCollectibleProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleProvider) EXPECT() *MockCollectibleProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectibleProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectibleProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectibleProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectibleProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectibleProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectibleProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectibleProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectibleProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleContractOwnershipProvider is a mock of CollectibleContractOwnershipProvider interface.
|
||||||
|
type MockCollectibleContractOwnershipProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleContractOwnershipProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleContractOwnershipProviderMockRecorder is the mock recorder for MockCollectibleContractOwnershipProvider.
|
||||||
|
type MockCollectibleContractOwnershipProviderMockRecorder struct {
|
||||||
|
mock *MockCollectibleContractOwnershipProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleContractOwnershipProvider creates a new mock instance.
|
||||||
|
func NewMockCollectibleContractOwnershipProvider(ctrl *gomock.Controller) *MockCollectibleContractOwnershipProvider {
|
||||||
|
mock := &MockCollectibleContractOwnershipProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleContractOwnershipProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleContractOwnershipProvider) EXPECT() *MockCollectibleContractOwnershipProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectibleOwnersByContractAddress mocks base method.
|
||||||
|
func (m *MockCollectibleContractOwnershipProvider) FetchCollectibleOwnersByContractAddress(ctx context.Context, chainID common0.ChainID, contractAddress common.Address) (*thirdparty.CollectibleContractOwnership, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchCollectibleOwnersByContractAddress", ctx, chainID, contractAddress)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.CollectibleContractOwnership)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectibleOwnersByContractAddress indicates an expected call of FetchCollectibleOwnersByContractAddress.
|
||||||
|
func (mr *MockCollectibleContractOwnershipProviderMockRecorder) FetchCollectibleOwnersByContractAddress(ctx, chainID, contractAddress interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectibleOwnersByContractAddress", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).FetchCollectibleOwnersByContractAddress), ctx, chainID, contractAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectibleContractOwnershipProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectibleContractOwnershipProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectibleContractOwnershipProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectibleContractOwnershipProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectibleContractOwnershipProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectibleContractOwnershipProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleAccountOwnershipProvider is a mock of CollectibleAccountOwnershipProvider interface.
|
||||||
|
type MockCollectibleAccountOwnershipProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleAccountOwnershipProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleAccountOwnershipProviderMockRecorder is the mock recorder for MockCollectibleAccountOwnershipProvider.
|
||||||
|
type MockCollectibleAccountOwnershipProviderMockRecorder struct {
|
||||||
|
mock *MockCollectibleAccountOwnershipProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleAccountOwnershipProvider creates a new mock instance.
|
||||||
|
func NewMockCollectibleAccountOwnershipProvider(ctrl *gomock.Controller) *MockCollectibleAccountOwnershipProvider {
|
||||||
|
mock := &MockCollectibleAccountOwnershipProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleAccountOwnershipProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) EXPECT() *MockCollectibleAccountOwnershipProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAllAssetsByOwner mocks base method.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) FetchAllAssetsByOwner(ctx context.Context, chainID common0.ChainID, owner common.Address, cursor string, limit int) (*thirdparty.FullCollectibleDataContainer, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchAllAssetsByOwner", ctx, chainID, owner, cursor, limit)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.FullCollectibleDataContainer)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAllAssetsByOwner indicates an expected call of FetchAllAssetsByOwner.
|
||||||
|
func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwner(ctx, chainID, owner, cursor, limit interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAllAssetsByOwner", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).FetchAllAssetsByOwner), ctx, chainID, owner, cursor, limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAllAssetsByOwnerAndContractAddress mocks base method.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) FetchAllAssetsByOwnerAndContractAddress(ctx context.Context, chainID common0.ChainID, owner common.Address, contractAddresses []common.Address, cursor string, limit int) (*thirdparty.FullCollectibleDataContainer, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchAllAssetsByOwnerAndContractAddress", ctx, chainID, owner, contractAddresses, cursor, limit)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.FullCollectibleDataContainer)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAllAssetsByOwnerAndContractAddress indicates an expected call of FetchAllAssetsByOwnerAndContractAddress.
|
||||||
|
func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwnerAndContractAddress(ctx, chainID, owner, contractAddresses, cursor, limit interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAllAssetsByOwnerAndContractAddress", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).FetchAllAssetsByOwnerAndContractAddress), ctx, chainID, owner, contractAddresses, cursor, limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectibleAccountOwnershipProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleDataProvider is a mock of CollectibleDataProvider interface.
|
||||||
|
type MockCollectibleDataProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleDataProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleDataProviderMockRecorder is the mock recorder for MockCollectibleDataProvider.
|
||||||
|
type MockCollectibleDataProviderMockRecorder struct {
|
||||||
|
mock *MockCollectibleDataProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleDataProvider creates a new mock instance.
|
||||||
|
func NewMockCollectibleDataProvider(ctrl *gomock.Controller) *MockCollectibleDataProvider {
|
||||||
|
mock := &MockCollectibleDataProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleDataProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleDataProvider) EXPECT() *MockCollectibleDataProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAssetsByCollectibleUniqueID mocks base method.
|
||||||
|
func (m *MockCollectibleDataProvider) FetchAssetsByCollectibleUniqueID(ctx context.Context, uniqueIDs []thirdparty.CollectibleUniqueID) ([]thirdparty.FullCollectibleData, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchAssetsByCollectibleUniqueID", ctx, uniqueIDs)
|
||||||
|
ret0, _ := ret[0].([]thirdparty.FullCollectibleData)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchAssetsByCollectibleUniqueID indicates an expected call of FetchAssetsByCollectibleUniqueID.
|
||||||
|
func (mr *MockCollectibleDataProviderMockRecorder) FetchAssetsByCollectibleUniqueID(ctx, uniqueIDs interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAssetsByCollectibleUniqueID", reflect.TypeOf((*MockCollectibleDataProvider)(nil).FetchAssetsByCollectibleUniqueID), ctx, uniqueIDs)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectionSocials mocks base method.
|
||||||
|
func (m *MockCollectibleDataProvider) FetchCollectionSocials(ctx context.Context, contractID thirdparty.ContractID) (*thirdparty.CollectionSocials, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchCollectionSocials", ctx, contractID)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.CollectionSocials)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectionSocials indicates an expected call of FetchCollectionSocials.
|
||||||
|
func (mr *MockCollectibleDataProviderMockRecorder) FetchCollectionSocials(ctx, contractID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectionSocials", reflect.TypeOf((*MockCollectibleDataProvider)(nil).FetchCollectionSocials), ctx, contractID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectibleDataProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectibleDataProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectibleDataProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectibleDataProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectibleDataProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleDataProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectibleDataProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectibleDataProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectibleDataProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectionDataProvider is a mock of CollectionDataProvider interface.
|
||||||
|
type MockCollectionDataProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectionDataProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectionDataProviderMockRecorder is the mock recorder for MockCollectionDataProvider.
|
||||||
|
type MockCollectionDataProviderMockRecorder struct {
|
||||||
|
mock *MockCollectionDataProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectionDataProvider creates a new mock instance.
|
||||||
|
func NewMockCollectionDataProvider(ctrl *gomock.Controller) *MockCollectionDataProvider {
|
||||||
|
mock := &MockCollectionDataProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectionDataProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectionDataProvider) EXPECT() *MockCollectionDataProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectionsDataByContractID mocks base method.
|
||||||
|
func (m *MockCollectionDataProvider) FetchCollectionsDataByContractID(ctx context.Context, ids []thirdparty.ContractID) ([]thirdparty.CollectionData, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "FetchCollectionsDataByContractID", ctx, ids)
|
||||||
|
ret0, _ := ret[0].([]thirdparty.CollectionData)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// FetchCollectionsDataByContractID indicates an expected call of FetchCollectionsDataByContractID.
|
||||||
|
func (mr *MockCollectionDataProviderMockRecorder) FetchCollectionsDataByContractID(ctx, ids interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectionsDataByContractID", reflect.TypeOf((*MockCollectionDataProvider)(nil).FetchCollectionsDataByContractID), ctx, ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectionDataProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectionDataProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectionDataProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectionDataProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectionDataProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectionDataProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectionDataProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectionDataProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectionDataProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleSearchProvider is a mock of CollectibleSearchProvider interface.
|
||||||
|
type MockCollectibleSearchProvider struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockCollectibleSearchProviderMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockCollectibleSearchProviderMockRecorder is the mock recorder for MockCollectibleSearchProvider.
|
||||||
|
type MockCollectibleSearchProviderMockRecorder struct {
|
||||||
|
mock *MockCollectibleSearchProvider
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockCollectibleSearchProvider creates a new mock instance.
|
||||||
|
func NewMockCollectibleSearchProvider(ctrl *gomock.Controller) *MockCollectibleSearchProvider {
|
||||||
|
mock := &MockCollectibleSearchProvider{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockCollectibleSearchProviderMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockCollectibleSearchProvider) EXPECT() *MockCollectibleSearchProviderMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID mocks base method.
|
||||||
|
func (m *MockCollectibleSearchProvider) ID() string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ID")
|
||||||
|
ret0, _ := ret[0].(string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ID indicates an expected call of ID.
|
||||||
|
func (mr *MockCollectibleSearchProviderMockRecorder) ID() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported mocks base method.
|
||||||
|
func (m *MockCollectibleSearchProvider) IsChainSupported(chainID common0.ChainID) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsChainSupported", chainID)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsChainSupported indicates an expected call of IsChainSupported.
|
||||||
|
func (mr *MockCollectibleSearchProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).IsChainSupported), chainID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected mocks base method.
|
||||||
|
func (m *MockCollectibleSearchProvider) IsConnected() bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsConnected")
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsConnected indicates an expected call of IsConnected.
|
||||||
|
func (mr *MockCollectibleSearchProviderMockRecorder) IsConnected() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).IsConnected))
|
||||||
|
}
|
||||||
|
|
||||||
|
// SearchCollectibles mocks base method.
|
||||||
|
func (m *MockCollectibleSearchProvider) SearchCollectibles(ctx context.Context, chainID common0.ChainID, collections []common.Address, text, cursor string, limit int) (*thirdparty.FullCollectibleDataContainer, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SearchCollectibles", ctx, chainID, collections, text, cursor, limit)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.FullCollectibleDataContainer)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// SearchCollectibles indicates an expected call of SearchCollectibles.
|
||||||
|
func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollectibles(ctx, chainID, collections, text, cursor, limit interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchCollectibles", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).SearchCollectibles), ctx, chainID, collections, text, cursor, limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SearchCollections mocks base method.
|
||||||
|
func (m *MockCollectibleSearchProvider) SearchCollections(ctx context.Context, chainID common0.ChainID, text, cursor string, limit int) (*thirdparty.CollectionDataContainer, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "SearchCollections", ctx, chainID, text, cursor, limit)
|
||||||
|
ret0, _ := ret[0].(*thirdparty.CollectionDataContainer)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// SearchCollections indicates an expected call of SearchCollections.
|
||||||
|
func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollections(ctx, chainID, text, cursor, limit interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchCollections", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).SearchCollections), ctx, chainID, text, cursor, limit)
|
||||||
|
}
|
Loading…
Reference in New Issue