-
Notifications
You must be signed in to change notification settings - Fork 556
/
posthandler.go
33 lines (29 loc) · 1001 Bytes
/
posthandler.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
package app
import (
txsigning "cosmossdk.io/x/tx/signing"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
smartaccountkeeper "github.com/osmosis-labs/osmosis/v25/x/smart-account/keeper"
smartaccountpost "github.com/osmosis-labs/osmosis/v25/x/smart-account/post"
protorevkeeper "github.com/osmosis-labs/osmosis/v25/x/protorev/keeper"
)
func NewPostHandler(
cdc codec.Codec,
protoRevKeeper *protorevkeeper.Keeper,
smartAccountKeeper *smartaccountkeeper.Keeper,
accountKeeper *authkeeper.AccountKeeper,
sigModeHandler *txsigning.HandlerMap,
) sdk.PostHandler {
return sdk.ChainPostDecorators(
protorevkeeper.NewProtoRevDecorator(*protoRevKeeper),
smartaccountpost.NewAuthenticatorPostDecorator(
cdc,
smartAccountKeeper,
accountKeeper,
sigModeHandler,
// Add an empty handler here to enable a circuit breaker pattern
sdk.ChainPostDecorators(sdk.Terminator{}), //nolint
),
)
}