// Code generated by mockery v2.13.0-beta.1. DO NOT EDIT.

package keystore

import (
	context "context"

	centchain "github.com/centrifuge/pod/centchain"

	mock "github.com/stretchr/testify/mock"

	pkgkeystore "github.com/centrifuge/chain-custom-types/pkg/keystore"

	types "github.com/centrifuge/go-substrate-rpc-client/v4/types"
)

// APIMock is an autogenerated mock type for the API type
type APIMock struct {
	mock.Mock
}

// AddKeys provides a mock function with given fields: ctx, keys
func (_m *APIMock) AddKeys(ctx context.Context, keys []*pkgkeystore.AddKey) (*centchain.ExtrinsicInfo, error) {
	ret := _m.Called(ctx, keys)

	var r0 *centchain.ExtrinsicInfo
	if rf, ok := ret.Get(0).(func(context.Context, []*pkgkeystore.AddKey) *centchain.ExtrinsicInfo); ok {
		r0 = rf(ctx, keys)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*centchain.ExtrinsicInfo)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, []*pkgkeystore.AddKey) error); ok {
		r1 = rf(ctx, keys)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetKey provides a mock function with given fields: accountID, keyID
func (_m *APIMock) GetKey(accountID *types.AccountID, keyID *pkgkeystore.KeyID) (*pkgkeystore.Key, error) {
	ret := _m.Called(accountID, keyID)

	var r0 *pkgkeystore.Key
	if rf, ok := ret.Get(0).(func(*types.AccountID, *pkgkeystore.KeyID) *pkgkeystore.Key); ok {
		r0 = rf(accountID, keyID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*pkgkeystore.Key)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(*types.AccountID, *pkgkeystore.KeyID) error); ok {
		r1 = rf(accountID, keyID)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetLastKeyByPurpose provides a mock function with given fields: accountID, keyPurpose
func (_m *APIMock) GetLastKeyByPurpose(accountID *types.AccountID, keyPurpose pkgkeystore.KeyPurpose) (*types.Hash, error) {
	ret := _m.Called(accountID, keyPurpose)

	var r0 *types.Hash
	if rf, ok := ret.Get(0).(func(*types.AccountID, pkgkeystore.KeyPurpose) *types.Hash); ok {
		r0 = rf(accountID, keyPurpose)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.Hash)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(*types.AccountID, pkgkeystore.KeyPurpose) error); ok {
		r1 = rf(accountID, keyPurpose)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// RevokeKeys provides a mock function with given fields: ctx, keys, keyPurpose
func (_m *APIMock) RevokeKeys(ctx context.Context, keys []*types.Hash, keyPurpose pkgkeystore.KeyPurpose) (*centchain.ExtrinsicInfo, error) {
	ret := _m.Called(ctx, keys, keyPurpose)

	var r0 *centchain.ExtrinsicInfo
	if rf, ok := ret.Get(0).(func(context.Context, []*types.Hash, pkgkeystore.KeyPurpose) *centchain.ExtrinsicInfo); ok {
		r0 = rf(ctx, keys, keyPurpose)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*centchain.ExtrinsicInfo)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, []*types.Hash, pkgkeystore.KeyPurpose) error); ok {
		r1 = rf(ctx, keys, keyPurpose)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

type NewAPIMockT interface {
	mock.TestingT
	Cleanup(func())
}

// NewAPIMock creates a new instance of APIMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAPIMock(t NewAPIMockT) *APIMock {
	mock := &APIMock{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
