Skip to content

Commit

Permalink
docs: add authz reference info in the circuit antehandler (cosmos#20146)
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and ipangpang committed Apr 24, 2024
1 parent 069ead1 commit 5f3a2e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/circuit/ante/circuit.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func NewCircuitBreakerDecorator(ck CircuitBreaker) CircuitBreakerDecorator {
}
}

// If you copy this as reference and your app has the authz module enabled, you must either:
// - recursively check for nested authz.Exec messages in this function.
// - or error early if a nested authz grant is found.
// The circuit AnteHandler handles this with baseapp's service router: https://github.com/cosmos/cosmos-sdk/issues/18632.
func (cbd CircuitBreakerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// loop through all the messages and check if the message type is allowed
for _, msg := range tx.GetMsgs() {
Expand Down

0 comments on commit 5f3a2e6

Please sign in to comment.