v1

package
v0.0.3-rc13 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

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")
)

Functions

func AuthorizeDeposit

func AuthorizeDeposit(sctx sdk.Context, authZ AuthzKeeper, bank BankKeeper, msg sdk.Msg) ([]ev1.Deposit, error)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the x/deployment interfaces types with the interface registry

Types

type Authorization

type Authorization interface {
	authz.Authorization
	TryAccept(context.Context, sdk.Msg, bool) (authz.AcceptResponse, error)
}

type AuthzKeeper

type AuthzKeeper interface {
	DeleteGrant(ctx context.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) error
	GetAuthorization(ctx context.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) (authz.Authorization, *time.Time)
	SaveGrant(ctx context.Context, grantee sdk.AccAddress, granter sdk.AccAddress, authorization authz.Authorization, expiration *time.Time) error
	GetGranteeGrantsByMsgType(ctx context.Context, grantee sdk.AccAddress, msgType string, onGrant func(context.Context, sdk.AccAddress, authz.Authorization, *time.Time) bool)
}

type BankKeeper

type BankKeeper interface {
	SpendableCoin(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
}

type DepositAuthorization

type DepositAuthorization struct {
	// SpendLimit is the amount the grantee is authorized to spend from the granter's account for
	// the purpose of deployment.
	SpendLimit types.Coin `protobuf:"bytes,1,opt,name=spend_limit,json=spendLimit,proto3" json:"spend_limit"`
}

DepositAuthorization allows the grantee to deposit up to spend_limit coins from the granter's account for a deployment.

func NewDepositAuthorization

func NewDepositAuthorization(spendLimit sdk.Coin) *DepositAuthorization

NewDepositAuthorization creates a new DepositAuthorization object.

func (*DepositAuthorization) Accept

Accept implements Authorization.Accept.

func (*DepositAuthorization) Descriptor

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

func (*DepositAuthorization) GetSpendLimit

func (m *DepositAuthorization) GetSpendLimit() types.Coin

func (*DepositAuthorization) Marshal

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

func (*DepositAuthorization) MarshalTo

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

func (*DepositAuthorization) MarshalToSizedBuffer

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

func (*DepositAuthorization) MsgTypeURL

func (m *DepositAuthorization) MsgTypeURL() string

MsgTypeURL implements Authorization.MsgTypeURL.

func (*DepositAuthorization) ProtoMessage

func (*DepositAuthorization) ProtoMessage()

func (*DepositAuthorization) Reset

func (m *DepositAuthorization) Reset()

func (*DepositAuthorization) Size

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

func (*DepositAuthorization) String

func (m *DepositAuthorization) String() string

func (*DepositAuthorization) TryAccept

func (m *DepositAuthorization) TryAccept(_ context.Context, msg sdk.Msg, partial bool) (authz.AcceptResponse, error)

func (*DepositAuthorization) Unmarshal

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

func (*DepositAuthorization) ValidateBasic

func (m *DepositAuthorization) ValidateBasic() error

ValidateBasic implements Authorization.ValidateBasic.

func (*DepositAuthorization) XXX_DiscardUnknown

func (m *DepositAuthorization) XXX_DiscardUnknown()

func (*DepositAuthorization) XXX_Marshal

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

func (*DepositAuthorization) XXX_Merge

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

func (*DepositAuthorization) XXX_Size

func (m *DepositAuthorization) XXX_Size() int

func (*DepositAuthorization) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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