-
Notifications
You must be signed in to change notification settings - Fork 6
/
expected_keepers.go
50 lines (41 loc) · 2.15 KB
/
expected_keepers.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//go:generate mockgen -destination=../../../testutil/proof/mocks/expected_keepers_mock.go -package=mocks . BankKeeper,SessionKeeper,ApplicationKeeper,AccountKeeper
package types
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
apptypes "github.com/pokt-network/poktroll/x/application/types"
sessiontypes "github.com/pokt-network/poktroll/x/session/types"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)
type SessionKeeper interface {
GetSession(context.Context, *sessiontypes.QueryGetSessionRequest) (*sessiontypes.QueryGetSessionResponse, error)
GetBlockHash(ctx context.Context, height int64) []byte
StoreBlockHash(ctx context.Context)
}
type SupplierKeeper interface {
SetSupplier(context.Context, sharedtypes.Supplier)
}
// AccountKeeper defines the expected interface for the Account module.
type AccountKeeper interface {
GetAccount(context.Context, sdk.AccAddress) sdk.AccountI
SetAccount(context.Context, sdk.AccountI)
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
NewAccountWithAddress(context.Context, sdk.AccAddress) sdk.AccountI
// Fetch the next account number, and increment the internal counter.
NextAccountNumber(context.Context) uint64
}
// BankKeeper defines the expected interface for the Bank module.
type BankKeeper interface {
// We use the bankkeeper SendXXX instead of DelegateXX methods
// because their purpose is to "escrow" funds on behalf of an account rather
// than "delegate" funds from one account to another which is more closely
// linked to staking.
SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}
// ApplicationKeeper defines the expected application keeper to retrieve applications
type ApplicationKeeper interface {
GetApplication(ctx context.Context, address string) (app apptypes.Application, found bool)
GetAllApplications(ctx context.Context) []apptypes.Application
SetApplication(context.Context, apptypes.Application)
}