x/authz charge gas for expensive authorizations (#8995)
* WIP * Add consume gas * update authz.go * add build flag * Update x/staking/types/authz.go * Update x/staking/types/authz.go * add tests docs * review changes * fix operations * Update x/authz/types/msgs.go Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * review changes * update gas cost * review changes Co-authored-by: SaReN <sahithnarahari@gmail.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package msgservice
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"google.golang.org/grpc"
|
||||
@@ -42,3 +43,9 @@ func RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.Serv
|
||||
func noopInterceptor(_ context.Context, _ interface{}, _ *grpc.UnaryServerInfo, _ grpc.UnaryHandler) (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// IsServiceMsg checks if a type URL corresponds to a service method name,
|
||||
// i.e. /cosmos.bank.Msg/Send vs /cosmos.bank.MsgSend
|
||||
func IsServiceMsg(typeURL string) bool {
|
||||
return strings.Count(typeURL, "/") >= 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user