-
Notifications
You must be signed in to change notification settings - Fork 2
/
module.go
59 lines (49 loc) · 1.51 KB
/
module.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
51
52
53
54
55
56
57
58
59
package types
import (
"context"
"encoding/json"
cometbftcoretypes "github.com/cometbft/cometbft/rpc/core/types"
cometbfttypes "github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type (
Module interface {
// Name base implementation of Module interface.
Name() string
}
BlockHandler interface {
Module
// HandleBlock handles a single block in blockchain.
HandleBlock(ctx context.Context, block *Block) error
}
TransactionHandler interface {
Module
// HandleTx handles a single transaction of block.
HandleTx(ctx context.Context, tx *Tx) error
}
MessageHandler interface {
Module
// HandleMessage handles a single message of transaction.
HandleMessage(ctx context.Context, index int, msg sdk.Msg, tx *Tx) error
}
ValidatorsHandler interface {
Module
// HandleValidators handles of all validators in blockchain.
HandleValidators(ctx context.Context, vals *cometbftcoretypes.ResultValidators) error
}
GenesisHandler interface {
Module
// HandleGenesis handles a genesis state.
HandleGenesis(ctx context.Context, doc *cometbfttypes.GenesisDoc, appState map[string]json.RawMessage) error
}
BeginBlockerHandler interface {
Module
// HandleBeginBlocker handles of beginblocker events.
HandleBeginBlocker(ctx context.Context, eventsMap BlockerEvents, height int64) error
}
EndBlockerHandler interface {
Module
// HandleEndBlocker handles of endblocker events.
HandleEndBlocker(ctx context.Context, eventsMap BlockerEvents, height int64) error
}
)