authz

package module
v0.0.0-...-f74a9f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 38 Imported by: 7

README


sidebar_position: 1

x/authz

Abstract

x/authz is an implementation of a Cosmos SDK module, per ADR 30, that allows granting arbitrary privileges from one account (the granter) to another account (the grantee). Authorizations must be granted for a particular Msg service method one by one using an implementation of the Authorization interface.

Contents

Concepts

Authorization and Grant

The x/authz module defines interfaces and messages grant authorizations to perform actions on behalf of one account to other accounts. The design is defined in the ADR 030.

A grant is an allowance to execute a Msg by the grantee on behalf of the granter. Authorization is an interface that must be implemented by a concrete authorization logic to validate and execute grants. Authorizations are extensible and can be defined for any Msg service method, even if the Msg method is defined outside of the module. See the SendAuthorization example in the next section for more details.

Note: The authz module is different from the auth (authentication) module, which is responsible for specifying the base transaction and account types.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/authorizations.go#L14-L28

Built-in Authorizations

The Cosmos SDK x/authz module comes with following authorization types:

GenericAuthorization

GenericAuthorization implements the Authorization interface that gives unrestricted permission to execute the provided Msg on behalf of granter's account.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/authz.proto#L14-L22
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/generic_authorization.go#L18-L34
  • msg stores Msg type URL.
SendAuthorization

SendAuthorization implements the Authorization interface for the cosmos.bank.v1beta1.MsgSend Msg.

  • It takes a (positive) SpendLimit that specifies the maximum amount of tokens the grantee can spend. The SpendLimit is updated as the tokens are spent.
  • It takes an (optional) AllowList that specifies to which addresses a grantee can send token.
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/bank/proto/cosmos/bank/v1beta1/authz.proto#L11-L29
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/bank/types/send_authorization.go#L33-L73
  • spend_limit keeps track of how many coins are left in the authorization.
  • allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the granter.
StakeAuthorization

StakeAuthorization implements the Authorization interface for messages in the staking module. It takes an AuthorizationType to specify whether you want to authorize delegation, undelegation, redelegation or cancel unbonding delegation, each of which must be authorized separately. It also takes an optional MaxTokens that keeps track of a limit to the amount of tokens that can be delegated/undelegated/redelegated. If left empty, the amount is unlimited. Additionally, this Msg takes an AllowList or a DenyList, enabling you to specify which validators the grantee can or cannot stake with.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/staking/proto/cosmos/staking/v1beta1/authz.proto#L11-L34
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/staking/types/authz.go#L78-L166

Gas

To prevent DoS attacks, granting StakeAuthorizations with x/authz incurs gas. StakeAuthorization allows you to authorize another account to delegate, undelegate, or redelegate tokens to validators. The granter can define a list of validators for which they allow or deny delegations. The Cosmos SDK then iterates over these lists and charge 10 gas for each validator included in both lists.

Since the state maintains a list of granter-grantee pairs with same expiration, we iterate over this list to remove the grant from the list (in case of any revoke of particular msgType), charging 20 gas for each iteration.

State

Grant

Grants are identified by combining granter address (the address bytes of the granter), grantee address (the address bytes of the grantee) and Authorization type (its type URL). Hence we only allow one grant for the (granter, grantee, Authorization) triple.

  • Grant: 0x01 | granter_address_len (1 byte) | granter_address_bytes | grantee_address_len (1 byte) | grantee_address_bytes | msgType_bytes -> ProtocolBuffer(AuthorizationGrant)

The grant object encapsulates an Authorization type and an expiration timestamp:

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/authz.proto#L24-L32

GrantQueue

We are maintaining a queue for authz pruning. Whenever a grant is created, an item will be added to GrantQueue with a key of expiration, granter, grantee.

In EndBlock (which runs for every block) we continuously check and prune the expired grants by forming a prefix key with current blocktime that passed the stored expiration in GrantQueue, we iterate through all the matched records from GrantQueue and delete maximum of 200 grants from the GrantQueue & Grants store for each run.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/keeper/keeper.go#L479-L520
  • GrantQueue: 0x02 | expiration_bytes | granter_address_len (1 byte) | granter_address_bytes | grantee_address_len (1 byte) | grantee_address_bytes -> ProtocolBuffer(GrantQueueItem)

The expiration_bytes are the expiration date in UTC with the format "2006-01-02T15:04:05.000000000".

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/keeper/keys.go#L84-L100

The GrantQueueItem object contains the list of type urls between granter and grantee that expire at the time indicated in the key.

Messages

In this section we describe the processing of messages for the authz module.

MsgGrant

An authorization grant is created using the MsgGrant message. If there is already a grant for the (granter, grantee, Authorization) triple, then the new grant overwrites the previous one. To update or extend an existing grant, a new grant with the same (granter, grantee, Authorization) triple should be created.

An authorization grant for authz MsgGrant is not allowed and will return an error. This is for preventing user from accidentally authorizing their entire account to a different account.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/tx.proto#L45-L55

The message handling should fail if:

  • both granter and grantee have the same address.
  • provided Expiration time is less than current unix timestamp (but a grant will be created if no expiration time is provided since expiration is optional).
  • provided Grant.Authorization is not implemented.
  • Authorization.MsgTypeURL() is not defined in the router (there is no defined handler in the app router to handle that Msg types).

MsgRevoke

A grant can be removed with the MsgRevoke message.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/tx.proto#L79-L88

The message handling should fail if:

  • both granter and grantee have the same address.
  • provided MsgTypeUrl is empty.

NOTE: The MsgExec message removes a grant if the grant has expired.

MsgRevokeAll

The MsgRevokeAll message revokes all grants issued by the specified granter. This is useful for quickly removing all authorizations granted by a single granter without specifying individual message types or grantees.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/tx.proto#L93-L100

The message handling should fail if:

  • the granter address is not provided or invalid.
  • the granter does not have any active grants.

MsgExec

When a grantee wants to execute a transaction on behalf of a granter, they must send MsgExec.

https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/x/authz/proto/cosmos/authz/v1beta1/tx.proto#L60-L72

The message handling should fail if:

  • provided Authorization is not implemented.
  • grantee doesn't have permission to run the transaction.
  • if granted authorization is expired.

MsgPruneExpiredGrants

Message that clean up 75 expired grants. A user has no benefit sending this transaction, it is only used by the chain to clean up expired grants.

Events

The authz module emits proto events defined in the Protobuf reference.

Client

CLI

A user can query and interact with the authz module using the CLI.

Query

The query commands allow users to query authz state.

simd query authz --help
grants

The grants command allows users to query grants for a granter-grantee pair. If the message type URL is set, it selects grants only for that message type.

simd query authz grants [granter-addr] [grantee-addr] [msg-type-url]? [flags]

Example:

simd query authz grants cosmos1.. cosmos1.. /cosmos.bank.v1beta1.MsgSend

Example Output:

grants:
- authorization:
    '@type': /cosmos.bank.v1beta1.SendAuthorization
    spend_limit:
    - amount: "100"
      denom: stake
  expiration: "2022-01-01T00:00:00Z"
pagination: null
Transactions

The tx commands allow users to interact with the authz module.

simd tx authz --help
exec

The exec command allows a grantee to execute a transaction on behalf of granter.

  simd tx authz exec [tx-json-file] --from [grantee] [flags]

Example:

simd tx authz exec tx.json --from=cosmos1..
grant

The grant command allows a granter to grant an authorization to a grantee.

simd tx authz grant <grantee> <authorization_type="send"|"generic"|"delegate"|"unbond"|"redelegate"> --from <granter> [flags]
  • The send authorization_type refers to the built-in SendAuthorization type. The custom flags available are spend-limit (required) and allow-list (optional) , documented here

Example:

    simd tx authz grant cosmos1.. send --spend-limit=100stake --allow-list=cosmos1...,cosmos2... --from=cosmos1..
  • The generic authorization_type refers to the built-in GenericAuthorization type. The custom flag available is msg-type ( required) documented here.

Note: msg-type is any valid Cosmos SDK Msg type url.

Example:

    simd tx authz grant cosmos1.. generic --msg-type=/cosmos.bank.v1beta1.MsgSend --from=cosmos1..
  • The delegate,unbond,redelegate authorization_types refer to the built-in StakeAuthorization type. The custom flags available are spend-limit (optional), allowed-validators (optional) and deny-validators (optional) documented here.

Note: allowed-validators and deny-validators cannot both be empty. spend-limit represents the MaxTokens

Example:

simd tx authz grant cosmos1.. delegate --spend-limit=100stake --allowed-validators=cosmos...,cosmos... --deny-validators=cosmos... --from=cosmos1..
revoke

The revoke command allows a granter to revoke an authorization from a grantee.

simd tx authz revoke [grantee] [msg-type-url] --from=[granter] [flags]

Example:

simd tx authz revoke cosmos1.. /cosmos.bank.v1beta1.MsgSend --from=cosmos1..
revoke-all

The revoke-all command allows a granter to revoke all authorizations created by the granter.

simd tx authz revoke-all --from=[granter] [flags]

Example:

simd tx authz revoke-all --from=cosmos1..

gRPC

A user can query the authz module using gRPC endpoints.

Grants

The Grants endpoint allows users to query grants for a granter-grantee pair. If the message type URL is set, it selects grants only for that message type.

cosmos.authz.v1beta1.Query/Grants

Example:

grpcurl -plaintext \
    -d '{"granter":"cosmos1..","grantee":"cosmos1..","msg_type_url":"/cosmos.bank.v1beta1.MsgSend"}' \
    localhost:9090 \
    cosmos.authz.v1beta1.Query/Grants

REST

A user can query the authz module using REST endpoints.

/cosmos/authz/v1beta1/grants

Example:

curl "localhost:1317/cosmos/authz/v1beta1/grants?granter=cosmos1..&grantee=cosmos1..&msg_type_url=/cosmos.bank.v1beta1.MsgSend"

Documentation

Overview

Package authz is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "authz"

ModuleName is the module name constant used in many places

Variables

View Source
var (
	ErrInvalidLengthAuthz        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuthz          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ErrNoAuthorizationFound error if there is no authorization found given a grant key
	ErrNoAuthorizationFound = errors.Register(ModuleName, 2, "authorization not found")
	// ErrInvalidExpirationTime error if the set expiration time is in the past
	ErrInvalidExpirationTime = errors.Register(ModuleName, 3, "expiration time of authorization should be more than current time")
	// ErrUnknownAuthorizationType error for unknown authorization type
	ErrUnknownAuthorizationType = errors.Register(ModuleName, 4, "unknown authorization type")
	// ErrNoGrantKeyFound error if the requested grant key does not exist
	ErrNoGrantKeyFound = errors.Register(ModuleName, 5, "grant key not found")
	// ErrAuthorizationExpired error if the authorization has expired
	ErrAuthorizationExpired = errors.Register(ModuleName, 6, "authorization expired")
	// ErrGranteeIsGranter error if the grantee and the granter are the same
	ErrGranteeIsGranter = errors.Register(ModuleName, 7, "grantee and granter should be different")
	// ErrAuthorizationNumOfSigners error if an authorization message does not have only one signer
	ErrAuthorizationNumOfSigners = errors.Register(ModuleName, 9, "authorization can be given to msg with only one signer")
	// ErrNegativeMaxTokens error if the max tokens is negative
	ErrNegativeMaxTokens = errors.Register(ModuleName, 12, "max tokens should be positive")
)

x/authz module sentinel errors

View Source
var (
	ErrInvalidLengthEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Msg_serviceDesc = _Msg_serviceDesc
View Source
var Query_serviceDesc = _Query_serviceDesc

Functions

func MsgServiceDesc

func MsgServiceDesc() *grpc.ServiceDesc

MsgServiceDesc return ServiceDesc for Msg server

func RegisterInterfaces

func RegisterInterfaces(registrar registry.InterfaceRegistrar)

RegisterInterfaces registers the interfaces types with the interface registry

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar)

RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis check the given genesis state has no integrity issues

Types

type Authorization

type Authorization interface {
	proto.Message

	// MsgTypeURL returns the fully-qualified Msg service method URL (as described in ADR 031),
	// which will process and accept or reject a request.
	MsgTypeURL() string

	// Accept determines whether this grant permits the provided sdk.Msg to be performed,
	// and if so provides an upgraded authorization instance.
	Accept(ctx context.Context, msg sdk.Msg) (authz.AcceptResponse, error)

	// ValidateBasic does a simple validation check that
	// doesn't require access to any other information.
	ValidateBasic() error
}

Authorization represents the interface of various Authorization types implemented by other modules.

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type EventGrant

type EventGrant struct {
	// Msg type URL for which an authorization is granted
	MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`
	// Granter account address
	Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"`
	// Grantee account address
	Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"`
}

EventGrant is emitted on Msg/Grant

func (*EventGrant) Descriptor

func (*EventGrant) Descriptor() ([]byte, []int)

func (*EventGrant) GetGrantee

func (m *EventGrant) GetGrantee() string

func (*EventGrant) GetGranter

func (m *EventGrant) GetGranter() string

func (*EventGrant) GetMsgTypeUrl

func (m *EventGrant) GetMsgTypeUrl() string

func (*EventGrant) Marshal

func (m *EventGrant) Marshal() (dAtA []byte, err error)

func (*EventGrant) MarshalTo

func (m *EventGrant) MarshalTo(dAtA []byte) (int, error)

func (*EventGrant) MarshalToSizedBuffer

func (m *EventGrant) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventGrant) ProtoMessage

func (*EventGrant) ProtoMessage()

func (*EventGrant) Reset

func (m *EventGrant) Reset()

func (*EventGrant) Size

func (m *EventGrant) Size() (n int)

func (*EventGrant) String

func (m *EventGrant) String() string

func (*EventGrant) Unmarshal

func (m *EventGrant) Unmarshal(dAtA []byte) error

func (*EventGrant) XXX_DiscardUnknown

func (m *EventGrant) XXX_DiscardUnknown()

func (*EventGrant) XXX_Marshal

func (m *EventGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventGrant) XXX_Merge

func (m *EventGrant) XXX_Merge(src proto.Message)

func (*EventGrant) XXX_Size

func (m *EventGrant) XXX_Size() int

func (*EventGrant) XXX_Unmarshal

func (m *EventGrant) XXX_Unmarshal(b []byte) error

type EventPruneExpiredGrants

type EventPruneExpiredGrants struct {
	// Address of the pruner
	Pruner string `protobuf:"bytes,2,opt,name=pruner,proto3" json:"pruner,omitempty"`
}

EventPruneExpiredGrants is emitted on Msg/PruneExpiredGrants

func (*EventPruneExpiredGrants) Descriptor

func (*EventPruneExpiredGrants) Descriptor() ([]byte, []int)

func (*EventPruneExpiredGrants) GetPruner

func (m *EventPruneExpiredGrants) GetPruner() string

func (*EventPruneExpiredGrants) Marshal

func (m *EventPruneExpiredGrants) Marshal() (dAtA []byte, err error)

func (*EventPruneExpiredGrants) MarshalTo

func (m *EventPruneExpiredGrants) MarshalTo(dAtA []byte) (int, error)

func (*EventPruneExpiredGrants) MarshalToSizedBuffer

func (m *EventPruneExpiredGrants) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventPruneExpiredGrants) ProtoMessage

func (*EventPruneExpiredGrants) ProtoMessage()

func (*EventPruneExpiredGrants) Reset

func (m *EventPruneExpiredGrants) Reset()

func (*EventPruneExpiredGrants) Size

func (m *EventPruneExpiredGrants) Size() (n int)

func (*EventPruneExpiredGrants) String

func (m *EventPruneExpiredGrants) String() string

func (*EventPruneExpiredGrants) Unmarshal

func (m *EventPruneExpiredGrants) Unmarshal(dAtA []byte) error

func (*EventPruneExpiredGrants) XXX_DiscardUnknown

func (m *EventPruneExpiredGrants) XXX_DiscardUnknown()

func (*EventPruneExpiredGrants) XXX_Marshal

func (m *EventPruneExpiredGrants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventPruneExpiredGrants) XXX_Merge

func (m *EventPruneExpiredGrants) XXX_Merge(src proto.Message)

func (*EventPruneExpiredGrants) XXX_Size

func (m *EventPruneExpiredGrants) XXX_Size() int

func (*EventPruneExpiredGrants) XXX_Unmarshal

func (m *EventPruneExpiredGrants) XXX_Unmarshal(b []byte) error

type EventRevoke

type EventRevoke struct {
	// Msg type URL for which an authorization is revoked
	MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`
	// Granter account address
	Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"`
	// Grantee account address
	Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"`
}

EventRevoke is emitted on Msg/Revoke

func (*EventRevoke) Descriptor

func (*EventRevoke) Descriptor() ([]byte, []int)

func (*EventRevoke) GetGrantee

func (m *EventRevoke) GetGrantee() string

func (*EventRevoke) GetGranter

func (m *EventRevoke) GetGranter() string

func (*EventRevoke) GetMsgTypeUrl

func (m *EventRevoke) GetMsgTypeUrl() string

func (*EventRevoke) Marshal

func (m *EventRevoke) Marshal() (dAtA []byte, err error)

func (*EventRevoke) MarshalTo

func (m *EventRevoke) MarshalTo(dAtA []byte) (int, error)

func (*EventRevoke) MarshalToSizedBuffer

func (m *EventRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventRevoke) ProtoMessage

func (*EventRevoke) ProtoMessage()

func (*EventRevoke) Reset

func (m *EventRevoke) Reset()

func (*EventRevoke) Size

func (m *EventRevoke) Size() (n int)

func (*EventRevoke) String

func (m *EventRevoke) String() string

func (*EventRevoke) Unmarshal

func (m *EventRevoke) Unmarshal(dAtA []byte) error

func (*EventRevoke) XXX_DiscardUnknown

func (m *EventRevoke) XXX_DiscardUnknown()

func (*EventRevoke) XXX_Marshal

func (m *EventRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventRevoke) XXX_Merge

func (m *EventRevoke) XXX_Merge(src proto.Message)

func (*EventRevoke) XXX_Size

func (m *EventRevoke) XXX_Size() int

func (*EventRevoke) XXX_Unmarshal

func (m *EventRevoke) XXX_Unmarshal(b []byte) error

type EventRevokeAll

type EventRevokeAll struct {
	// Msg type URL for which all authorizations are revoked
	MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`
	// Granter account address
	Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"`
}

EventRevokeAll is emitted on Msg/RevokeAll

func (*EventRevokeAll) Descriptor

func (*EventRevokeAll) Descriptor() ([]byte, []int)

func (*EventRevokeAll) GetGranter

func (m *EventRevokeAll) GetGranter() string

func (*EventRevokeAll) GetMsgTypeUrl

func (m *EventRevokeAll) GetMsgTypeUrl() string

func (*EventRevokeAll) Marshal

func (m *EventRevokeAll) Marshal() (dAtA []byte, err error)

func (*EventRevokeAll) MarshalTo

func (m *EventRevokeAll) MarshalTo(dAtA []byte) (int, error)

func (*EventRevokeAll) MarshalToSizedBuffer

func (m *EventRevokeAll) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventRevokeAll) ProtoMessage

func (*EventRevokeAll) ProtoMessage()

func (*EventRevokeAll) Reset

func (m *EventRevokeAll) Reset()

func (*EventRevokeAll) Size

func (m *EventRevokeAll) Size() (n int)

func (*EventRevokeAll) String

func (m *EventRevokeAll) String() string

func (*EventRevokeAll) Unmarshal

func (m *EventRevokeAll) Unmarshal(dAtA []byte) error

func (*EventRevokeAll) XXX_DiscardUnknown

func (m *EventRevokeAll) XXX_DiscardUnknown()

func (*EventRevokeAll) XXX_Marshal

func (m *EventRevokeAll) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventRevokeAll) XXX_Merge

func (m *EventRevokeAll) XXX_Merge(src proto.Message)

func (*EventRevokeAll) XXX_Size

func (m *EventRevokeAll) XXX_Size() int

func (*EventRevokeAll) XXX_Unmarshal

func (m *EventRevokeAll) XXX_Unmarshal(b []byte) error

type GenericAuthorization

type GenericAuthorization struct {
	// Msg, identified by it's type URL, to grant unrestricted permissions to execute
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
}

GenericAuthorization gives the grantee unrestricted permissions to execute the provided method on behalf of the granter's account.

func NewGenericAuthorization

func NewGenericAuthorization(msgTypeURL string) *GenericAuthorization

NewGenericAuthorization creates a new GenericAuthorization object.

func (GenericAuthorization) Accept

Accept implements Authorization.Accept.

func (*GenericAuthorization) Descriptor

func (*GenericAuthorization) Descriptor() ([]byte, []int)

func (*GenericAuthorization) Marshal

func (m *GenericAuthorization) Marshal() (dAtA []byte, err error)

func (*GenericAuthorization) MarshalTo

func (m *GenericAuthorization) MarshalTo(dAtA []byte) (int, error)

func (*GenericAuthorization) MarshalToSizedBuffer

func (m *GenericAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (GenericAuthorization) MsgTypeURL

func (a GenericAuthorization) MsgTypeURL() string

MsgTypeURL implements Authorization.MsgTypeURL.

func (*GenericAuthorization) ProtoMessage

func (*GenericAuthorization) ProtoMessage()

func (*GenericAuthorization) Reset

func (m *GenericAuthorization) Reset()

func (*GenericAuthorization) Size

func (m *GenericAuthorization) Size() (n int)

func (*GenericAuthorization) String

func (m *GenericAuthorization) String() string

func (*GenericAuthorization) Unmarshal

func (m *GenericAuthorization) Unmarshal(dAtA []byte) error

func (GenericAuthorization) ValidateBasic

func (a GenericAuthorization) ValidateBasic() error

ValidateBasic implements Authorization.ValidateBasic.

func (*GenericAuthorization) XXX_DiscardUnknown

func (m *GenericAuthorization) XXX_DiscardUnknown()

func (*GenericAuthorization) XXX_Marshal

func (m *GenericAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenericAuthorization) XXX_Merge

func (m *GenericAuthorization) XXX_Merge(src proto.Message)

func (*GenericAuthorization) XXX_Size

func (m *GenericAuthorization) XXX_Size() int

func (*GenericAuthorization) XXX_Unmarshal

func (m *GenericAuthorization) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Authorization []GrantAuthorization `protobuf:"bytes,1,rep,name=authorization,proto3" json:"authorization"`
}

GenesisState defines the authz module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState - Return a default genesis state

func NewGenesisState

func NewGenesisState(entries []GrantAuthorization) *GenesisState

NewGenesisState creates new GenesisState object

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAuthorization

func (m *GenesisState) GetAuthorization() []GrantAuthorization

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) UnpackInterfaces

func (data GenesisState) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type Grant

type Grant struct {
	Authorization *any.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"`
	// time when the grant will expire and will be pruned. If null, then the grant
	// doesn't have a time expiration (other conditions  in `authorization`
	// may apply to invalidate the grant)
	Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"`
}

Grant gives permissions to execute the provide method with expiration time.

func NewGrant

func NewGrant(blockTime time.Time, a Authorization, expiration *time.Time) (Grant, error)

NewGrant returns new Grant. Expiration is optional and noop if null. It returns an error if the expiration is before the current block time, which is passed into the `blockTime` arg.

func (*Grant) Descriptor

func (*Grant) Descriptor() ([]byte, []int)

func (Grant) GetAuthorization

func (g Grant) GetAuthorization() (Authorization, error)

GetAuthorization returns the cached value from the Grant.Authorization if present.

func (*Grant) Marshal

func (m *Grant) Marshal() (dAtA []byte, err error)

func (*Grant) MarshalTo

func (m *Grant) MarshalTo(dAtA []byte) (int, error)

func (*Grant) MarshalToSizedBuffer

func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Grant) ProtoMessage

func (*Grant) ProtoMessage()

func (*Grant) Reset

func (m *Grant) Reset()

func (*Grant) Size

func (m *Grant) Size() (n int)

func (*Grant) String

func (m *Grant) String() string

func (*Grant) Unmarshal

func (m *Grant) Unmarshal(dAtA []byte) error

func (Grant) UnpackInterfaces

func (g Grant) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (Grant) ValidateBasic

func (g Grant) ValidateBasic() error

func (*Grant) XXX_DiscardUnknown

func (m *Grant) XXX_DiscardUnknown()

func (*Grant) XXX_Marshal

func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Grant) XXX_Merge

func (m *Grant) XXX_Merge(src proto.Message)

func (*Grant) XXX_Size

func (m *Grant) XXX_Size() int

func (*Grant) XXX_Unmarshal

func (m *Grant) XXX_Unmarshal(b []byte) error

type GrantAuthorization

type GrantAuthorization struct {
	Granter       string     `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	Grantee       string     `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
	Authorization *any.Any   `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
	Expiration    *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"`
}

GrantAuthorization extends a grant with both the addresses of the grantee and granter. It is used in genesis.proto and query.proto

func (*GrantAuthorization) Descriptor

func (*GrantAuthorization) Descriptor() ([]byte, []int)

func (*GrantAuthorization) Marshal

func (m *GrantAuthorization) Marshal() (dAtA []byte, err error)

func (*GrantAuthorization) MarshalTo

func (m *GrantAuthorization) MarshalTo(dAtA []byte) (int, error)

func (*GrantAuthorization) MarshalToSizedBuffer

func (m *GrantAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GrantAuthorization) ProtoMessage

func (*GrantAuthorization) ProtoMessage()

func (*GrantAuthorization) Reset

func (m *GrantAuthorization) Reset()

func (*GrantAuthorization) Size

func (m *GrantAuthorization) Size() (n int)

func (*GrantAuthorization) String

func (m *GrantAuthorization) String() string

func (*GrantAuthorization) Unmarshal

func (m *GrantAuthorization) Unmarshal(dAtA []byte) error

func (GrantAuthorization) UnpackInterfaces

func (msg GrantAuthorization) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*GrantAuthorization) XXX_DiscardUnknown

func (m *GrantAuthorization) XXX_DiscardUnknown()

func (*GrantAuthorization) XXX_Marshal

func (m *GrantAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GrantAuthorization) XXX_Merge

func (m *GrantAuthorization) XXX_Merge(src proto.Message)

func (*GrantAuthorization) XXX_Size

func (m *GrantAuthorization) XXX_Size() int

func (*GrantAuthorization) XXX_Unmarshal

func (m *GrantAuthorization) XXX_Unmarshal(b []byte) error

type GrantQueueItem

type GrantQueueItem struct {
	// msg_type_urls contains the list of TypeURL of a sdk.Msg.
	MsgTypeUrls []string `protobuf:"bytes,1,rep,name=msg_type_urls,json=msgTypeUrls,proto3" json:"msg_type_urls,omitempty"`
}

GrantQueueItem contains the list of TypeURL of a sdk.Msg.

func (*GrantQueueItem) Descriptor

func (*GrantQueueItem) Descriptor() ([]byte, []int)

func (*GrantQueueItem) Marshal

func (m *GrantQueueItem) Marshal() (dAtA []byte, err error)

func (*GrantQueueItem) MarshalTo

func (m *GrantQueueItem) MarshalTo(dAtA []byte) (int, error)

func (*GrantQueueItem) MarshalToSizedBuffer

func (m *GrantQueueItem) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GrantQueueItem) ProtoMessage

func (*GrantQueueItem) ProtoMessage()

func (*GrantQueueItem) Reset

func (m *GrantQueueItem) Reset()

func (*GrantQueueItem) Size

func (m *GrantQueueItem) Size() (n int)

func (*GrantQueueItem) String

func (m *GrantQueueItem) String() string

func (*GrantQueueItem) Unmarshal

func (m *GrantQueueItem) Unmarshal(dAtA []byte) error

func (*GrantQueueItem) XXX_DiscardUnknown

func (m *GrantQueueItem) XXX_DiscardUnknown()

func (*GrantQueueItem) XXX_Marshal

func (m *GrantQueueItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GrantQueueItem) XXX_Merge

func (m *GrantQueueItem) XXX_Merge(src proto.Message)

func (*GrantQueueItem) XXX_Size

func (m *GrantQueueItem) XXX_Size() int

func (*GrantQueueItem) XXX_Unmarshal

func (m *GrantQueueItem) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// Grant grants the provided authorization to the grantee on the granter's
	// account with the provided expiration time. If there is already a grant
	// for the given (granter, grantee, Authorization) triple, then the grant
	// will be overwritten.
	Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error)
	// Exec attempts to execute the provided messages using
	// authorizations granted to the grantee. Each message should have only
	// one signer corresponding to the granter of the authorization.
	Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error)
	// Revoke revokes any authorization corresponding to the provided method name on the
	// granter's account that has been granted to the grantee.
	Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error)
	// RevokeAll revokes all grants issued by the specified granter.
	RevokeAll(ctx context.Context, in *MsgRevokeAll, opts ...grpc.CallOption) (*MsgRevokeAllResponse, error)
	// PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time.
	PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgExec

type MsgExec struct {
	Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"`
	// Execute Msg.
	// The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
	// triple and validate it.
	Msgs []*any.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"`
}

MsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.

func NewMsgExec

func NewMsgExec(grantee string, msgs []sdk.Msg) MsgExec

NewMsgExec creates a new MsgExecAuthorized

func (*MsgExec) Descriptor

func (*MsgExec) Descriptor() ([]byte, []int)

func (MsgExec) GetMessages

func (msg MsgExec) GetMessages() ([]sdk.Msg, error)

GetMessages returns the cache values from the MsgExecAuthorized.Msgs if present.

func (*MsgExec) Marshal

func (m *MsgExec) Marshal() (dAtA []byte, err error)

func (*MsgExec) MarshalTo

func (m *MsgExec) MarshalTo(dAtA []byte) (int, error)

func (*MsgExec) MarshalToSizedBuffer

func (m *MsgExec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExec) ProtoMessage

func (*MsgExec) ProtoMessage()

func (*MsgExec) Reset

func (m *MsgExec) Reset()

func (*MsgExec) Size

func (m *MsgExec) Size() (n int)

func (*MsgExec) String

func (m *MsgExec) String() string

func (*MsgExec) Unmarshal

func (m *MsgExec) Unmarshal(dAtA []byte) error

func (MsgExec) UnpackInterfaces

func (msg MsgExec) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*MsgExec) XXX_DiscardUnknown

func (m *MsgExec) XXX_DiscardUnknown()

func (*MsgExec) XXX_Marshal

func (m *MsgExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExec) XXX_Merge

func (m *MsgExec) XXX_Merge(src proto.Message)

func (*MsgExec) XXX_Size

func (m *MsgExec) XXX_Size() int

func (*MsgExec) XXX_Unmarshal

func (m *MsgExec) XXX_Unmarshal(b []byte) error

type MsgExecResponse

type MsgExecResponse struct {
	Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
}

MsgExecResponse defines the Msg/MsgExecResponse response type.

func (*MsgExecResponse) Descriptor

func (*MsgExecResponse) Descriptor() ([]byte, []int)

func (*MsgExecResponse) Marshal

func (m *MsgExecResponse) Marshal() (dAtA []byte, err error)

func (*MsgExecResponse) MarshalTo

func (m *MsgExecResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgExecResponse) MarshalToSizedBuffer

func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExecResponse) ProtoMessage

func (*MsgExecResponse) ProtoMessage()

func (*MsgExecResponse) Reset

func (m *MsgExecResponse) Reset()

func (*MsgExecResponse) Size

func (m *MsgExecResponse) Size() (n int)

func (*MsgExecResponse) String

func (m *MsgExecResponse) String() string

func (*MsgExecResponse) Unmarshal

func (m *MsgExecResponse) Unmarshal(dAtA []byte) error

func (*MsgExecResponse) XXX_DiscardUnknown

func (m *MsgExecResponse) XXX_DiscardUnknown()

func (*MsgExecResponse) XXX_Marshal

func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExecResponse) XXX_Merge

func (m *MsgExecResponse) XXX_Merge(src proto.Message)

func (*MsgExecResponse) XXX_Size

func (m *MsgExecResponse) XXX_Size() int

func (*MsgExecResponse) XXX_Unmarshal

func (m *MsgExecResponse) XXX_Unmarshal(b []byte) error

type MsgGrant

type MsgGrant struct {
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
	Grant   Grant  `protobuf:"bytes,3,opt,name=grant,proto3" json:"grant"`
}

MsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.

func NewMsgGrant

func NewMsgGrant(granter, grantee string, a Authorization, expiration *time.Time) (*MsgGrant, error)

NewMsgGrant creates a new MsgGrant

func (*MsgGrant) Descriptor

func (*MsgGrant) Descriptor() ([]byte, []int)

func (*MsgGrant) GetAuthorization

func (msg *MsgGrant) GetAuthorization() (Authorization, error)

GetAuthorization returns the cache value from the MsgGrant.Authorization if present.

func (*MsgGrant) Marshal

func (m *MsgGrant) Marshal() (dAtA []byte, err error)

func (*MsgGrant) MarshalTo

func (m *MsgGrant) MarshalTo(dAtA []byte) (int, error)

func (*MsgGrant) MarshalToSizedBuffer

func (m *MsgGrant) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgGrant) ProtoMessage

func (*MsgGrant) ProtoMessage()

func (*MsgGrant) Reset

func (m *MsgGrant) Reset()

func (*MsgGrant) SetAuthorization

func (msg *MsgGrant) SetAuthorization(a Authorization) error

SetAuthorization converts Authorization to any and adds it to MsgGrant.Authorization.

func (*MsgGrant) Size

func (m *MsgGrant) Size() (n int)

func (*MsgGrant) String

func (m *MsgGrant) String() string

func (*MsgGrant) Unmarshal

func (m *MsgGrant) Unmarshal(dAtA []byte) error

func (MsgGrant) UnpackInterfaces

func (msg MsgGrant) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*MsgGrant) XXX_DiscardUnknown

func (m *MsgGrant) XXX_DiscardUnknown()

func (*MsgGrant) XXX_Marshal

func (m *MsgGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgGrant) XXX_Merge

func (m *MsgGrant) XXX_Merge(src proto.Message)

func (*MsgGrant) XXX_Size

func (m *MsgGrant) XXX_Size() int

func (*MsgGrant) XXX_Unmarshal

func (m *MsgGrant) XXX_Unmarshal(b []byte) error

type MsgGrantResponse

type MsgGrantResponse struct {
}

MsgGrantResponse defines the Msg/MsgGrant response type.

func (*MsgGrantResponse) Descriptor

func (*MsgGrantResponse) Descriptor() ([]byte, []int)

func (*MsgGrantResponse) Marshal

func (m *MsgGrantResponse) Marshal() (dAtA []byte, err error)

func (*MsgGrantResponse) MarshalTo

func (m *MsgGrantResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgGrantResponse) MarshalToSizedBuffer

func (m *MsgGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgGrantResponse) ProtoMessage

func (*MsgGrantResponse) ProtoMessage()

func (*MsgGrantResponse) Reset

func (m *MsgGrantResponse) Reset()

func (*MsgGrantResponse) Size

func (m *MsgGrantResponse) Size() (n int)

func (*MsgGrantResponse) String

func (m *MsgGrantResponse) String() string

func (*MsgGrantResponse) Unmarshal

func (m *MsgGrantResponse) Unmarshal(dAtA []byte) error

func (*MsgGrantResponse) XXX_DiscardUnknown

func (m *MsgGrantResponse) XXX_DiscardUnknown()

func (*MsgGrantResponse) XXX_Marshal

func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgGrantResponse) XXX_Merge

func (m *MsgGrantResponse) XXX_Merge(src proto.Message)

func (*MsgGrantResponse) XXX_Size

func (m *MsgGrantResponse) XXX_Size() int

func (*MsgGrantResponse) XXX_Unmarshal

func (m *MsgGrantResponse) XXX_Unmarshal(b []byte) error

type MsgPruneExpiredGrants

type MsgPruneExpiredGrants struct {
	Pruner string `protobuf:"bytes,1,opt,name=pruner,proto3" json:"pruner,omitempty"`
}

MsgPruneExpiredGrants prunes the expired grants.

func (*MsgPruneExpiredGrants) Descriptor

func (*MsgPruneExpiredGrants) Descriptor() ([]byte, []int)

func (*MsgPruneExpiredGrants) Marshal

func (m *MsgPruneExpiredGrants) Marshal() (dAtA []byte, err error)

func (*MsgPruneExpiredGrants) MarshalTo

func (m *MsgPruneExpiredGrants) MarshalTo(dAtA []byte) (int, error)

func (*MsgPruneExpiredGrants) MarshalToSizedBuffer

func (m *MsgPruneExpiredGrants) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPruneExpiredGrants) ProtoMessage

func (*MsgPruneExpiredGrants) ProtoMessage()

func (*MsgPruneExpiredGrants) Reset

func (m *MsgPruneExpiredGrants) Reset()

func (*MsgPruneExpiredGrants) Size

func (m *MsgPruneExpiredGrants) Size() (n int)

func (*MsgPruneExpiredGrants) String

func (m *MsgPruneExpiredGrants) String() string

func (*MsgPruneExpiredGrants) Unmarshal

func (m *MsgPruneExpiredGrants) Unmarshal(dAtA []byte) error

func (*MsgPruneExpiredGrants) XXX_DiscardUnknown

func (m *MsgPruneExpiredGrants) XXX_DiscardUnknown()

func (*MsgPruneExpiredGrants) XXX_Marshal

func (m *MsgPruneExpiredGrants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPruneExpiredGrants) XXX_Merge

func (m *MsgPruneExpiredGrants) XXX_Merge(src proto.Message)

func (*MsgPruneExpiredGrants) XXX_Size

func (m *MsgPruneExpiredGrants) XXX_Size() int

func (*MsgPruneExpiredGrants) XXX_Unmarshal

func (m *MsgPruneExpiredGrants) XXX_Unmarshal(b []byte) error

type MsgPruneExpiredGrantsResponse

type MsgPruneExpiredGrantsResponse struct {
}

MsgPruneExpiredGrantsResponse defines the Msg/MsgPruneExpiredGrantsResponse response type.

func (*MsgPruneExpiredGrantsResponse) Descriptor

func (*MsgPruneExpiredGrantsResponse) Descriptor() ([]byte, []int)

func (*MsgPruneExpiredGrantsResponse) Marshal

func (m *MsgPruneExpiredGrantsResponse) Marshal() (dAtA []byte, err error)

func (*MsgPruneExpiredGrantsResponse) MarshalTo

func (m *MsgPruneExpiredGrantsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgPruneExpiredGrantsResponse) MarshalToSizedBuffer

func (m *MsgPruneExpiredGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPruneExpiredGrantsResponse) ProtoMessage

func (*MsgPruneExpiredGrantsResponse) ProtoMessage()

func (*MsgPruneExpiredGrantsResponse) Reset

func (m *MsgPruneExpiredGrantsResponse) Reset()

func (*MsgPruneExpiredGrantsResponse) Size

func (m *MsgPruneExpiredGrantsResponse) Size() (n int)

func (*MsgPruneExpiredGrantsResponse) String

func (*MsgPruneExpiredGrantsResponse) Unmarshal

func (m *MsgPruneExpiredGrantsResponse) Unmarshal(dAtA []byte) error

func (*MsgPruneExpiredGrantsResponse) XXX_DiscardUnknown

func (m *MsgPruneExpiredGrantsResponse) XXX_DiscardUnknown()

func (*MsgPruneExpiredGrantsResponse) XXX_Marshal

func (m *MsgPruneExpiredGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPruneExpiredGrantsResponse) XXX_Merge

func (m *MsgPruneExpiredGrantsResponse) XXX_Merge(src proto.Message)

func (*MsgPruneExpiredGrantsResponse) XXX_Size

func (m *MsgPruneExpiredGrantsResponse) XXX_Size() int

func (*MsgPruneExpiredGrantsResponse) XXX_Unmarshal

func (m *MsgPruneExpiredGrantsResponse) XXX_Unmarshal(b []byte) error

type MsgRevoke

type MsgRevoke struct {
	Granter    string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	Grantee    string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
	MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`
}

MsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.

func NewMsgRevoke

func NewMsgRevoke(granter, grantee, msgTypeURL string) MsgRevoke

NewMsgRevoke creates a new MsgRevoke

func (*MsgRevoke) Descriptor

func (*MsgRevoke) Descriptor() ([]byte, []int)

func (*MsgRevoke) Marshal

func (m *MsgRevoke) Marshal() (dAtA []byte, err error)

func (*MsgRevoke) MarshalTo

func (m *MsgRevoke) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevoke) MarshalToSizedBuffer

func (m *MsgRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevoke) ProtoMessage

func (*MsgRevoke) ProtoMessage()

func (*MsgRevoke) Reset

func (m *MsgRevoke) Reset()

func (*MsgRevoke) Size

func (m *MsgRevoke) Size() (n int)

func (*MsgRevoke) String

func (m *MsgRevoke) String() string

func (*MsgRevoke) Unmarshal

func (m *MsgRevoke) Unmarshal(dAtA []byte) error

func (*MsgRevoke) XXX_DiscardUnknown

func (m *MsgRevoke) XXX_DiscardUnknown()

func (*MsgRevoke) XXX_Marshal

func (m *MsgRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevoke) XXX_Merge

func (m *MsgRevoke) XXX_Merge(src proto.Message)

func (*MsgRevoke) XXX_Size

func (m *MsgRevoke) XXX_Size() int

func (*MsgRevoke) XXX_Unmarshal

func (m *MsgRevoke) XXX_Unmarshal(b []byte) error

type MsgRevokeAll

type MsgRevokeAll struct {
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
}

MsgRevokeAll revokes all grants issued by the specified granter.

func (*MsgRevokeAll) Descriptor

func (*MsgRevokeAll) Descriptor() ([]byte, []int)

func (*MsgRevokeAll) Marshal

func (m *MsgRevokeAll) Marshal() (dAtA []byte, err error)

func (*MsgRevokeAll) MarshalTo

func (m *MsgRevokeAll) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevokeAll) MarshalToSizedBuffer

func (m *MsgRevokeAll) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevokeAll) ProtoMessage

func (*MsgRevokeAll) ProtoMessage()

func (*MsgRevokeAll) Reset

func (m *MsgRevokeAll) Reset()

func (*MsgRevokeAll) Size

func (m *MsgRevokeAll) Size() (n int)

func (*MsgRevokeAll) String

func (m *MsgRevokeAll) String() string

func (*MsgRevokeAll) Unmarshal

func (m *MsgRevokeAll) Unmarshal(dAtA []byte) error

func (*MsgRevokeAll) XXX_DiscardUnknown

func (m *MsgRevokeAll) XXX_DiscardUnknown()

func (*MsgRevokeAll) XXX_Marshal

func (m *MsgRevokeAll) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevokeAll) XXX_Merge

func (m *MsgRevokeAll) XXX_Merge(src proto.Message)

func (*MsgRevokeAll) XXX_Size

func (m *MsgRevokeAll) XXX_Size() int

func (*MsgRevokeAll) XXX_Unmarshal

func (m *MsgRevokeAll) XXX_Unmarshal(b []byte) error

type MsgRevokeAllResponse

type MsgRevokeAllResponse struct {
}

MsgRevokeAllResponse defines the Msg/MsgRevokeAllResponse response type.

func (*MsgRevokeAllResponse) Descriptor

func (*MsgRevokeAllResponse) Descriptor() ([]byte, []int)

func (*MsgRevokeAllResponse) Marshal

func (m *MsgRevokeAllResponse) Marshal() (dAtA []byte, err error)

func (*MsgRevokeAllResponse) MarshalTo

func (m *MsgRevokeAllResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevokeAllResponse) MarshalToSizedBuffer

func (m *MsgRevokeAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevokeAllResponse) ProtoMessage

func (*MsgRevokeAllResponse) ProtoMessage()

func (*MsgRevokeAllResponse) Reset

func (m *MsgRevokeAllResponse) Reset()

func (*MsgRevokeAllResponse) Size

func (m *MsgRevokeAllResponse) Size() (n int)

func (*MsgRevokeAllResponse) String

func (m *MsgRevokeAllResponse) String() string

func (*MsgRevokeAllResponse) Unmarshal

func (m *MsgRevokeAllResponse) Unmarshal(dAtA []byte) error

func (*MsgRevokeAllResponse) XXX_DiscardUnknown

func (m *MsgRevokeAllResponse) XXX_DiscardUnknown()

func (*MsgRevokeAllResponse) XXX_Marshal

func (m *MsgRevokeAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevokeAllResponse) XXX_Merge

func (m *MsgRevokeAllResponse) XXX_Merge(src proto.Message)

func (*MsgRevokeAllResponse) XXX_Size

func (m *MsgRevokeAllResponse) XXX_Size() int

func (*MsgRevokeAllResponse) XXX_Unmarshal

func (m *MsgRevokeAllResponse) XXX_Unmarshal(b []byte) error

type MsgRevokeResponse

type MsgRevokeResponse struct {
}

MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.

func (*MsgRevokeResponse) Descriptor

func (*MsgRevokeResponse) Descriptor() ([]byte, []int)

func (*MsgRevokeResponse) Marshal

func (m *MsgRevokeResponse) Marshal() (dAtA []byte, err error)

func (*MsgRevokeResponse) MarshalTo

func (m *MsgRevokeResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgRevokeResponse) MarshalToSizedBuffer

func (m *MsgRevokeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgRevokeResponse) ProtoMessage

func (*MsgRevokeResponse) ProtoMessage()

func (*MsgRevokeResponse) Reset

func (m *MsgRevokeResponse) Reset()

func (*MsgRevokeResponse) Size

func (m *MsgRevokeResponse) Size() (n int)

func (*MsgRevokeResponse) String

func (m *MsgRevokeResponse) String() string

func (*MsgRevokeResponse) Unmarshal

func (m *MsgRevokeResponse) Unmarshal(dAtA []byte) error

func (*MsgRevokeResponse) XXX_DiscardUnknown

func (m *MsgRevokeResponse) XXX_DiscardUnknown()

func (*MsgRevokeResponse) XXX_Marshal

func (m *MsgRevokeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgRevokeResponse) XXX_Merge

func (m *MsgRevokeResponse) XXX_Merge(src proto.Message)

func (*MsgRevokeResponse) XXX_Size

func (m *MsgRevokeResponse) XXX_Size() int

func (*MsgRevokeResponse) XXX_Unmarshal

func (m *MsgRevokeResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// Grant grants the provided authorization to the grantee on the granter's
	// account with the provided expiration time. If there is already a grant
	// for the given (granter, grantee, Authorization) triple, then the grant
	// will be overwritten.
	Grant(context.Context, *MsgGrant) (*MsgGrantResponse, error)
	// Exec attempts to execute the provided messages using
	// authorizations granted to the grantee. Each message should have only
	// one signer corresponding to the granter of the authorization.
	Exec(context.Context, *MsgExec) (*MsgExecResponse, error)
	// Revoke revokes any authorization corresponding to the provided method name on the
	// granter's account that has been granted to the grantee.
	Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error)
	// RevokeAll revokes all grants issued by the specified granter.
	RevokeAll(context.Context, *MsgRevokeAll) (*MsgRevokeAllResponse, error)
	// PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time.
	PruneExpiredGrants(context.Context, *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// Returns list of `Authorization`, granted to the grantee by the granter.
	Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error)
	// GranterGrants returns list of `GrantAuthorization`, granted by granter.
	GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error)
	// GranteeGrants returns a list of `GrantAuthorization` by grantee.
	GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryGranteeGrantsRequest

type QueryGranteeGrantsRequest struct {
	Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"`
	// pagination defines an pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method.

func (*QueryGranteeGrantsRequest) Descriptor

func (*QueryGranteeGrantsRequest) Descriptor() ([]byte, []int)

func (*QueryGranteeGrantsRequest) GetGrantee

func (m *QueryGranteeGrantsRequest) GetGrantee() string

func (*QueryGranteeGrantsRequest) GetPagination

func (m *QueryGranteeGrantsRequest) GetPagination() *query.PageRequest

func (*QueryGranteeGrantsRequest) Marshal

func (m *QueryGranteeGrantsRequest) Marshal() (dAtA []byte, err error)

func (*QueryGranteeGrantsRequest) MarshalTo

func (m *QueryGranteeGrantsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGranteeGrantsRequest) MarshalToSizedBuffer

func (m *QueryGranteeGrantsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGranteeGrantsRequest) ProtoMessage

func (*QueryGranteeGrantsRequest) ProtoMessage()

func (*QueryGranteeGrantsRequest) Reset

func (m *QueryGranteeGrantsRequest) Reset()

func (*QueryGranteeGrantsRequest) Size

func (m *QueryGranteeGrantsRequest) Size() (n int)

func (*QueryGranteeGrantsRequest) String

func (m *QueryGranteeGrantsRequest) String() string

func (*QueryGranteeGrantsRequest) Unmarshal

func (m *QueryGranteeGrantsRequest) Unmarshal(dAtA []byte) error

func (*QueryGranteeGrantsRequest) XXX_DiscardUnknown

func (m *QueryGranteeGrantsRequest) XXX_DiscardUnknown()

func (*QueryGranteeGrantsRequest) XXX_Marshal

func (m *QueryGranteeGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGranteeGrantsRequest) XXX_Merge

func (m *QueryGranteeGrantsRequest) XXX_Merge(src proto.Message)

func (*QueryGranteeGrantsRequest) XXX_Size

func (m *QueryGranteeGrantsRequest) XXX_Size() int

func (*QueryGranteeGrantsRequest) XXX_Unmarshal

func (m *QueryGranteeGrantsRequest) XXX_Unmarshal(b []byte) error

type QueryGranteeGrantsResponse

type QueryGranteeGrantsResponse struct {
	// grants is a list of grants granted to the grantee.
	Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"`
	// pagination defines an pagination for the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.

func (*QueryGranteeGrantsResponse) Descriptor

func (*QueryGranteeGrantsResponse) Descriptor() ([]byte, []int)

func (*QueryGranteeGrantsResponse) GetGrants

func (*QueryGranteeGrantsResponse) GetPagination

func (m *QueryGranteeGrantsResponse) GetPagination() *query.PageResponse

func (*QueryGranteeGrantsResponse) Marshal

func (m *QueryGranteeGrantsResponse) Marshal() (dAtA []byte, err error)

func (*QueryGranteeGrantsResponse) MarshalTo

func (m *QueryGranteeGrantsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGranteeGrantsResponse) MarshalToSizedBuffer

func (m *QueryGranteeGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGranteeGrantsResponse) ProtoMessage

func (*QueryGranteeGrantsResponse) ProtoMessage()

func (*QueryGranteeGrantsResponse) Reset

func (m *QueryGranteeGrantsResponse) Reset()

func (*QueryGranteeGrantsResponse) Size

func (m *QueryGranteeGrantsResponse) Size() (n int)

func (*QueryGranteeGrantsResponse) String

func (m *QueryGranteeGrantsResponse) String() string

func (*QueryGranteeGrantsResponse) Unmarshal

func (m *QueryGranteeGrantsResponse) Unmarshal(dAtA []byte) error

func (*QueryGranteeGrantsResponse) XXX_DiscardUnknown

func (m *QueryGranteeGrantsResponse) XXX_DiscardUnknown()

func (*QueryGranteeGrantsResponse) XXX_Marshal

func (m *QueryGranteeGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGranteeGrantsResponse) XXX_Merge

func (m *QueryGranteeGrantsResponse) XXX_Merge(src proto.Message)

func (*QueryGranteeGrantsResponse) XXX_Size

func (m *QueryGranteeGrantsResponse) XXX_Size() int

func (*QueryGranteeGrantsResponse) XXX_Unmarshal

func (m *QueryGranteeGrantsResponse) XXX_Unmarshal(b []byte) error

type QueryGranterGrantsRequest

type QueryGranterGrantsRequest struct {
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	// pagination defines an pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.

func (*QueryGranterGrantsRequest) Descriptor

func (*QueryGranterGrantsRequest) Descriptor() ([]byte, []int)

func (*QueryGranterGrantsRequest) GetGranter

func (m *QueryGranterGrantsRequest) GetGranter() string

func (*QueryGranterGrantsRequest) GetPagination

func (m *QueryGranterGrantsRequest) GetPagination() *query.PageRequest

func (*QueryGranterGrantsRequest) Marshal

func (m *QueryGranterGrantsRequest) Marshal() (dAtA []byte, err error)

func (*QueryGranterGrantsRequest) MarshalTo

func (m *QueryGranterGrantsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGranterGrantsRequest) MarshalToSizedBuffer

func (m *QueryGranterGrantsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGranterGrantsRequest) ProtoMessage

func (*QueryGranterGrantsRequest) ProtoMessage()

func (*QueryGranterGrantsRequest) Reset

func (m *QueryGranterGrantsRequest) Reset()

func (*QueryGranterGrantsRequest) Size

func (m *QueryGranterGrantsRequest) Size() (n int)

func (*QueryGranterGrantsRequest) String

func (m *QueryGranterGrantsRequest) String() string

func (*QueryGranterGrantsRequest) Unmarshal

func (m *QueryGranterGrantsRequest) Unmarshal(dAtA []byte) error

func (*QueryGranterGrantsRequest) XXX_DiscardUnknown

func (m *QueryGranterGrantsRequest) XXX_DiscardUnknown()

func (*QueryGranterGrantsRequest) XXX_Marshal

func (m *QueryGranterGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGranterGrantsRequest) XXX_Merge

func (m *QueryGranterGrantsRequest) XXX_Merge(src proto.Message)

func (*QueryGranterGrantsRequest) XXX_Size

func (m *QueryGranterGrantsRequest) XXX_Size() int

func (*QueryGranterGrantsRequest) XXX_Unmarshal

func (m *QueryGranterGrantsRequest) XXX_Unmarshal(b []byte) error

type QueryGranterGrantsResponse

type QueryGranterGrantsResponse struct {
	// grants is a list of grants granted by the granter.
	Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"`
	// pagination defines an pagination for the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.

func (*QueryGranterGrantsResponse) Descriptor

func (*QueryGranterGrantsResponse) Descriptor() ([]byte, []int)

func (*QueryGranterGrantsResponse) GetGrants

func (*QueryGranterGrantsResponse) GetPagination

func (m *QueryGranterGrantsResponse) GetPagination() *query.PageResponse

func (*QueryGranterGrantsResponse) Marshal

func (m *QueryGranterGrantsResponse) Marshal() (dAtA []byte, err error)

func (*QueryGranterGrantsResponse) MarshalTo

func (m *QueryGranterGrantsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGranterGrantsResponse) MarshalToSizedBuffer

func (m *QueryGranterGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGranterGrantsResponse) ProtoMessage

func (*QueryGranterGrantsResponse) ProtoMessage()

func (*QueryGranterGrantsResponse) Reset

func (m *QueryGranterGrantsResponse) Reset()

func (*QueryGranterGrantsResponse) Size

func (m *QueryGranterGrantsResponse) Size() (n int)

func (*QueryGranterGrantsResponse) String

func (m *QueryGranterGrantsResponse) String() string

func (*QueryGranterGrantsResponse) Unmarshal

func (m *QueryGranterGrantsResponse) Unmarshal(dAtA []byte) error

func (*QueryGranterGrantsResponse) XXX_DiscardUnknown

func (m *QueryGranterGrantsResponse) XXX_DiscardUnknown()

func (*QueryGranterGrantsResponse) XXX_Marshal

func (m *QueryGranterGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGranterGrantsResponse) XXX_Merge

func (m *QueryGranterGrantsResponse) XXX_Merge(src proto.Message)

func (*QueryGranterGrantsResponse) XXX_Size

func (m *QueryGranterGrantsResponse) XXX_Size() int

func (*QueryGranterGrantsResponse) XXX_Unmarshal

func (m *QueryGranterGrantsResponse) XXX_Unmarshal(b []byte) error

type QueryGrantsRequest

type QueryGrantsRequest struct {
	Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
	Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
	// Optional, msg_type_url, when set, will query only grants matching given msg type.
	MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"`
	// pagination defines an pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGrantsRequest is the request type for the Query/Grants RPC method.

func (*QueryGrantsRequest) Descriptor

func (*QueryGrantsRequest) Descriptor() ([]byte, []int)

func (*QueryGrantsRequest) GetGrantee

func (m *QueryGrantsRequest) GetGrantee() string

func (*QueryGrantsRequest) GetGranter

func (m *QueryGrantsRequest) GetGranter() string

func (*QueryGrantsRequest) GetMsgTypeUrl

func (m *QueryGrantsRequest) GetMsgTypeUrl() string

func (*QueryGrantsRequest) GetPagination

func (m *QueryGrantsRequest) GetPagination() *query.PageRequest

func (*QueryGrantsRequest) Marshal

func (m *QueryGrantsRequest) Marshal() (dAtA []byte, err error)

func (*QueryGrantsRequest) MarshalTo

func (m *QueryGrantsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGrantsRequest) MarshalToSizedBuffer

func (m *QueryGrantsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGrantsRequest) ProtoMessage

func (*QueryGrantsRequest) ProtoMessage()

func (*QueryGrantsRequest) Reset

func (m *QueryGrantsRequest) Reset()

func (*QueryGrantsRequest) Size

func (m *QueryGrantsRequest) Size() (n int)

func (*QueryGrantsRequest) String

func (m *QueryGrantsRequest) String() string

func (*QueryGrantsRequest) Unmarshal

func (m *QueryGrantsRequest) Unmarshal(dAtA []byte) error

func (*QueryGrantsRequest) XXX_DiscardUnknown

func (m *QueryGrantsRequest) XXX_DiscardUnknown()

func (*QueryGrantsRequest) XXX_Marshal

func (m *QueryGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGrantsRequest) XXX_Merge

func (m *QueryGrantsRequest) XXX_Merge(src proto.Message)

func (*QueryGrantsRequest) XXX_Size

func (m *QueryGrantsRequest) XXX_Size() int

func (*QueryGrantsRequest) XXX_Unmarshal

func (m *QueryGrantsRequest) XXX_Unmarshal(b []byte) error

type QueryGrantsResponse

type QueryGrantsResponse struct {
	// authorizations is a list of grants granted for grantee by granter.
	Grants []*Grant `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"`
	// pagination defines an pagination for the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryGrantsResponse is the response type for the Query/Authorizations RPC method.

func (*QueryGrantsResponse) Descriptor

func (*QueryGrantsResponse) Descriptor() ([]byte, []int)

func (*QueryGrantsResponse) GetGrants

func (m *QueryGrantsResponse) GetGrants() []*Grant

func (*QueryGrantsResponse) GetPagination

func (m *QueryGrantsResponse) GetPagination() *query.PageResponse

func (*QueryGrantsResponse) Marshal

func (m *QueryGrantsResponse) Marshal() (dAtA []byte, err error)

func (*QueryGrantsResponse) MarshalTo

func (m *QueryGrantsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGrantsResponse) MarshalToSizedBuffer

func (m *QueryGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGrantsResponse) ProtoMessage

func (*QueryGrantsResponse) ProtoMessage()

func (*QueryGrantsResponse) Reset

func (m *QueryGrantsResponse) Reset()

func (*QueryGrantsResponse) Size

func (m *QueryGrantsResponse) Size() (n int)

func (*QueryGrantsResponse) String

func (m *QueryGrantsResponse) String() string

func (*QueryGrantsResponse) Unmarshal

func (m *QueryGrantsResponse) Unmarshal(dAtA []byte) error

func (*QueryGrantsResponse) XXX_DiscardUnknown

func (m *QueryGrantsResponse) XXX_DiscardUnknown()

func (*QueryGrantsResponse) XXX_Marshal

func (m *QueryGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGrantsResponse) XXX_Merge

func (m *QueryGrantsResponse) XXX_Merge(src proto.Message)

func (*QueryGrantsResponse) XXX_Size

func (m *QueryGrantsResponse) XXX_Size() int

func (*QueryGrantsResponse) XXX_Unmarshal

func (m *QueryGrantsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Returns list of `Authorization`, granted to the grantee by the granter.
	Grants(context.Context, *QueryGrantsRequest) (*QueryGrantsResponse, error)
	// GranterGrants returns list of `GrantAuthorization`, granted by granter.
	GranterGrants(context.Context, *QueryGranterGrantsRequest) (*QueryGranterGrantsResponse, error)
	// GranteeGrants returns a list of `GrantAuthorization` by grantee.
	GranteeGrants(context.Context, *QueryGranteeGrantsRequest) (*QueryGranteeGrantsResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Exec

func (*UnimplementedMsgServer) Grant

func (*UnimplementedMsgServer) PruneExpiredGrants

func (*UnimplementedMsgServer) Revoke

func (*UnimplementedMsgServer) RevokeAll

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) GranteeGrants

func (*UnimplementedQueryServer) GranterGrants

func (*UnimplementedQueryServer) Grants

Directories

Path Synopsis
client
cli
Package codec provides a singleton instance of Amino codec that should be used to register any concrete type that can later be referenced inside a MsgGrant or MsgExec instance so that they can be (de)serialized properly.
Package codec provides a singleton instance of Amino codec that should be used to register any concrete type that can later be referenced inside a MsgGrant or MsgExec instance so that they can be (de)serialized properly.
internal
migrations
v2
Package testutil is a generated GoMock package.
Package testutil is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL