-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_injected_msg.go
38 lines (31 loc) · 1.05 KB
/
app_injected_msg.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
package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
bridgetypes "github.com/furyanprotocol/v4-chain/protocol/x/bridge/types"
clobtypes "github.com/furyanprotocol/v4-chain/protocol/x/clob/types"
perpetualstypes "github.com/furyanprotocol/v4-chain/protocol/x/perpetuals/types"
pricestypes "github.com/furyanprotocol/v4-chain/protocol/x/prices/types"
)
// IsSingleAppInjectedMsg returns true if the given list of msgs contains an "app-injected msg"
// and it's the only msg in the list. Otherwise, returns false.
func IsSingleAppInjectedMsg(msgs []sdk.Msg) bool {
return len(msgs) == 1 && IsAppInjectedMsg(msgs[0])
}
// IsAppInjectedMsg returns true if the given msg is an "app-injected msg".
// Otherwise, returns false.
func IsAppInjectedMsg(msg sdk.Msg) bool {
switch msg.(type) {
case
// ------- Custom modules
// bridge
*bridgetypes.MsgAcknowledgeBridges,
// clob
*clobtypes.MsgProposedOperations,
// perpetuals
*perpetualstypes.MsgAddPremiumVotes,
// prices
*pricestypes.MsgUpdateMarketPrices:
return true
}
return false
}