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

package centchain

import (
	context "context"

	signature "github.com/centrifuge/go-substrate-rpc-client/v4/signature"
	mock "github.com/stretchr/testify/mock"

	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
}

// Call provides a mock function with given fields: result, method, args
func (_m *APIMock) Call(result interface{}, method string, args ...interface{}) error {
	var _ca []interface{}
	_ca = append(_ca, result, method)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok {
		r0 = rf(result, method, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// GetBlock provides a mock function with given fields: blockHash
func (_m *APIMock) GetBlock(blockHash types.Hash) (*types.SignedBlock, error) {
	ret := _m.Called(blockHash)

	var r0 *types.SignedBlock
	if rf, ok := ret.Get(0).(func(types.Hash) *types.SignedBlock); ok {
		r0 = rf(blockHash)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.SignedBlock)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(types.Hash) error); ok {
		r1 = rf(blockHash)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetBlockHash provides a mock function with given fields: blockNumber
func (_m *APIMock) GetBlockHash(blockNumber uint64) (types.Hash, error) {
	ret := _m.Called(blockNumber)

	var r0 types.Hash
	if rf, ok := ret.Get(0).(func(uint64) types.Hash); ok {
		r0 = rf(blockNumber)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(types.Hash)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(uint64) error); ok {
		r1 = rf(blockNumber)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetBlockLatest provides a mock function with given fields:
func (_m *APIMock) GetBlockLatest() (*types.SignedBlock, error) {
	ret := _m.Called()

	var r0 *types.SignedBlock
	if rf, ok := ret.Get(0).(func() *types.SignedBlock); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.SignedBlock)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetMetadataLatest provides a mock function with given fields:
func (_m *APIMock) GetMetadataLatest() (*types.Metadata, error) {
	ret := _m.Called()

	var r0 *types.Metadata
	if rf, ok := ret.Get(0).(func() *types.Metadata); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.Metadata)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetPendingExtrinsics provides a mock function with given fields:
func (_m *APIMock) GetPendingExtrinsics() ([]types.Extrinsic, error) {
	ret := _m.Called()

	var r0 []types.Extrinsic
	if rf, ok := ret.Get(0).(func() []types.Extrinsic); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]types.Extrinsic)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetStorageLatest provides a mock function with given fields: key, target
func (_m *APIMock) GetStorageLatest(key types.StorageKey, target interface{}) (bool, error) {
	ret := _m.Called(key, target)

	var r0 bool
	if rf, ok := ret.Get(0).(func(types.StorageKey, interface{}) bool); ok {
		r0 = rf(key, target)
	} else {
		r0 = ret.Get(0).(bool)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(types.StorageKey, interface{}) error); ok {
		r1 = rf(key, target)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// SubmitAndWatch provides a mock function with given fields: ctx, meta, c, krp
func (_m *APIMock) SubmitAndWatch(ctx context.Context, meta *types.Metadata, c types.Call, krp signature.KeyringPair) (ExtrinsicInfo, error) {
	ret := _m.Called(ctx, meta, c, krp)

	var r0 ExtrinsicInfo
	if rf, ok := ret.Get(0).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) ExtrinsicInfo); ok {
		r0 = rf(ctx, meta, c, krp)
	} else {
		r0 = ret.Get(0).(ExtrinsicInfo)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) error); ok {
		r1 = rf(ctx, meta, c, krp)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// SubmitExtrinsic provides a mock function with given fields: ctx, meta, c, krp
func (_m *APIMock) SubmitExtrinsic(ctx context.Context, meta *types.Metadata, c types.Call, krp signature.KeyringPair) (types.Hash, types.BlockNumber, types.MultiSignature, error) {
	ret := _m.Called(ctx, meta, c, krp)

	var r0 types.Hash
	if rf, ok := ret.Get(0).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) types.Hash); ok {
		r0 = rf(ctx, meta, c, krp)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(types.Hash)
		}
	}

	var r1 types.BlockNumber
	if rf, ok := ret.Get(1).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) types.BlockNumber); ok {
		r1 = rf(ctx, meta, c, krp)
	} else {
		r1 = ret.Get(1).(types.BlockNumber)
	}

	var r2 types.MultiSignature
	if rf, ok := ret.Get(2).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) types.MultiSignature); ok {
		r2 = rf(ctx, meta, c, krp)
	} else {
		r2 = ret.Get(2).(types.MultiSignature)
	}

	var r3 error
	if rf, ok := ret.Get(3).(func(context.Context, *types.Metadata, types.Call, signature.KeyringPair) error); ok {
		r3 = rf(ctx, meta, c, krp)
	} else {
		r3 = ret.Error(3)
	}

	return r0, r1, r2, r3
}

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
}
