/
keeper_mock.go
30 lines (24 loc) · 977 Bytes
/
keeper_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Copyright [2019] - [2020], PERSISTENCE TECHNOLOGIES PTE. LTD. and the persistenceSDK contributors
SPDX-License-Identifier: Apache-2.0
*/
package mint
import (
sdkTypes "github.com/cosmos/cosmos-sdk/types"
"github.com/persistenceOne/persistenceSDK/constants/errors"
"github.com/persistenceOne/persistenceSDK/schema/helpers"
)
type auxiliaryKeeperMock struct {
mapper helpers.Mapper
}
var _ helpers.AuxiliaryKeeper = (*auxiliaryKeeperMock)(nil)
func (auxiliaryKeeper auxiliaryKeeperMock) Help(_ sdkTypes.Context, AuxiliaryRequest helpers.AuxiliaryRequest) helpers.AuxiliaryResponse {
auxiliaryRequest := auxiliaryRequestFromInterface(AuxiliaryRequest)
if auxiliaryRequest.OwnerID.String() == "mintError" {
return newAuxiliaryResponse(errors.MockError)
}
return newAuxiliaryResponse(nil)
}
func initializeAuxiliaryKeeperMock(mapper helpers.Mapper, _ helpers.Parameters, _ []interface{}) helpers.AuxiliaryKeeper {
return auxiliaryKeeperMock{mapper: mapper}
}