cosmos-sdk/x/authz/generic_authorization.go
Matt Kocubinski 1363a02da0
refactor: remove cyclic authz dependencies (#16509)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-06-13 18:30:22 +00:00

31 lines
765 B
Go

package authz
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/authz"
)
// NewGenericAuthorization creates a new GenericAuthorization object.
func NewGenericAuthorization(msgTypeURL string) *GenericAuthorization {
return &GenericAuthorization{
Msg: msgTypeURL,
}
}
// MsgTypeURL implements Authorization.MsgTypeURL.
func (a GenericAuthorization) MsgTypeURL() string {
return a.Msg
}
// Accept implements Authorization.Accept.
func (a GenericAuthorization) Accept(ctx context.Context, msg sdk.Msg) (authz.AcceptResponse, error) {
return authz.AcceptResponse{Accept: true}, nil
}
// ValidateBasic implements Authorization.ValidateBasic.
func (a GenericAuthorization) ValidateBasic() error {
return nil
}