-
Notifications
You must be signed in to change notification settings - Fork 6
/
expected_keepers.go
44 lines (35 loc) · 1.81 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
//go:generate mockgen -destination ../../../testutil/tokenomics/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,ApplicationKeeper,ProofKeeper
package types
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
apptypes "github.com/pokt-network/poktroll/x/application/types"
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
)
// AccountKeeper defines the expected interface for the Account module.
type AccountKeeper interface {
GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // only used for simulation
}
// BankKeeper defines the expected interface for the Bank module.
type BankKeeper interface {
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
// 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.
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}
type ApplicationKeeper interface {
GetApplication(ctx context.Context, appAddr string) (app apptypes.Application, found bool)
SetApplication(ctx context.Context, app apptypes.Application)
}
type ProofKeeper interface {
GetAllClaims(ctx context.Context) []prooftypes.Claim
RemoveClaim(ctx context.Context, sessionId, supplierAddr string)
GetProof(ctx context.Context, sessionId, supplierAddr string) (proof prooftypes.Proof, isProofFound bool)
RemoveProof(ctx context.Context, sessionId, supplierAddr string)
// Only used for testing & simulation
UpsertClaim(ctx context.Context, claim prooftypes.Claim)
UpsertProof(ctx context.Context, claim prooftypes.Proof)
}