osmos/gogoproto/types"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
math_bits "math/bits"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// BasicAllowance implements Allowance with a one-time grant of coins
// that optionally expires. The grantee can use up to SpendLimit to cover fees.
type BasicAllowance struct {
// spend_limit specifies the maximum amount of coins that can be spent
// by this allowance and will be updated as coins are spent. If it is
// empty, there is no spend limit and any amount of coins can be spent.
SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"`
// expiration specifies an optional time when this allowance expires
Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"`
}
func (m *BasicAllowance)
Reset() { *m = BasicAllowance{
}
}
func (m *BasicAllowance)
String()
string {
return proto.CompactTextString(m)
}
func (*BasicAllowance)
ProtoMessage() {
}
func (*BasicAllowance)
Descriptor() ([]byte, []int) {
return fileDescriptor_7279582900c30aea, []int{0
}
}
func (m *BasicAllowance)
XXX_Unmarshal(b []byte)
error {
return m.Unmarshal(b)
}
func (m *BasicAllowance)
XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BasicAllowance.Marshal(b, m, deterministic)
}
else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BasicAllowance)
XXX_Merge(src proto.Message) {
xxx_messageInfo_BasicAllowance.Merge(m, src)
}
func (m *BasicAllowance)
XXX_Size()
int {
return m.Size()
}
func (m *BasicAllowance)
XXX_DiscardUnknown() {
xxx_messageInfo_BasicAllowance.DiscardUnknown(m)
}
var xxx_messageInfo_BasicAllowance proto.InternalMessageInfo
func (m *BasicAllowance)
GetSpendLimit()
github_com_cosmos_cosmos_sdk_types.Coins {
if m != nil {
return m.SpendLimit
}
return nil
}
func (m *BasicAllowance)
GetExpiration() *time.Time {
if m != nil {
return m.Expiration
}
return nil
}
// PeriodicAllowance extends Allowance to allow for both a maximum cap,
// as well as a limit per time period.
type PeriodicAllowance struct {
// basic specifies a struct of `BasicAllowance`
Basic BasicAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"`
// period specifies the time duration in which period_spend_limit coins can
// be spent before that allowance is reset
Period time.Duration `protobuf:"bytes,2,opt,name=period,proto3,stdduration" json:"period"`
// period_spend_limit specifies the maximum number of coins that can be spent
// in the period
PeriodSpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=period_spend_limit,json=periodSpendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_spend_limit"`
// period_can_spend is the number of coins left to be spent before the period_reset time
PeriodCanSpend github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=period_can_spend,json=periodCanSpend,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_can_spend"`
// period_reset is the time at which this period resets and a new one begins,
// it is calculated from the start time of the first transaction after the
// last period ended
PeriodReset time.Time `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3,stdtime" json:"period_reset"`
}
func (m *PeriodicAllowance)
Reset() { *m = PeriodicAllowance{
}
}
func (m *PeriodicAllowance)
String()
string {
return proto.CompactTextString(m)
}
func (*PeriodicAllowance)
ProtoMessage() {
}
func (*PeriodicAllowance)
Descriptor() ([]byte, []int) {
return fileDescriptor_7279582900c30aea, []int{1
}
}
func (m *PeriodicAllowance)
XXX_Unmarshal(b []byte)
error {
return m.Unmarshal(b)
}
func (m *PeriodicAllowance)
XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_PeriodicAllowance.Marshal(b, m, deterministic)
}
else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *PeriodicAllowance)
XXX_Merge(src proto.Message) {
xxx_messageInfo_PeriodicAllowance.Merge(m, src)
}
func (m *PeriodicAllowance)
XXX_Size()
int {
return m.Size()
}
func (m *PeriodicAllowance)
XXX_DiscardUnknown() {
xxx_messageInfo_PeriodicAllowance.DiscardUnknown(m)
}
var xxx_messageInfo_PeriodicAllowance proto.InternalMessageInfo
func (m *PeriodicAllowance)
GetBasic()
BasicAllowance {
if m != nil {
return m.Basic
}
return BasicAllowance{
}
}
func (m *PeriodicAllowance)
GetPeriod()
time.Duration {
if m != nil {
return m.Period
}
return 0
}
func (m *PeriodicAllowance)
GetPeriodSpendLimit()
github_com_cosmos_cosmos_sdk_types.Coins {
if m != nil {
return m.PeriodSpendLimit
}
return nil
}
func (m *PeriodicAllowance)
GetPeriodCanSpend()
github_com_cosmos_cosmos_sdk_types.Coins {
if m != nil {
return m.PeriodCanSpend
}
return nil
}
func (m *PeriodicAllowance)
GetPeriodReset()
time.Time {
if m != nil {
return m.PeriodReset
}
return time.Time{
}
}
// AllowedMsgAllowance creates allowance only for specified message types.
type AllowedMsgAllowance struct {
// allowance can be any of basic and periodic fee allowance.
Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"`
// allowed_messages are the messages for which the grantee has the access.
AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"`
}
func (m *AllowedMsgAllowance)
Reset() { *m = AllowedMsgAllowance{
}
}
func (m *AllowedMsgAllowance)
String()
string {
return proto.CompactTextString(m)
}
func (*AllowedMsgAllowance)
ProtoMessage() {
}
func (*AllowedMsgAllowance)
Descriptor() ([]byte, []int) {
return fileDescriptor_7279582900c30aea, []int{2
}
}
func (m *AllowedMsgAllowance)
XXX_Unmarshal(b []byte)
error {
return m.Unmarshal(b)
}
func (m *AllowedMsgAllowance)
XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AllowedMsgAllowance.Marshal(b, m, deterministic)
}
else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *AllowedMsgAllowance)
XXX_Merge(src proto.Message) {
xxx_messageInfo_AllowedMsgAllowance.Merge(m, src)
}
func (m *AllowedMsgAllowance)
XXX_Size()
int {
return m.Size()
}
func (m *AllowedMsgAllowance)
XXX_DiscardUnknown() {
xxx_messageInfo_AllowedMsgAllowance.DiscardUnknown(m)
}
var xxx_messageInfo_AllowedMsgAllowance proto.InternalMessageInfo
// Grant is stored in the KVStore to record a grant with full context
type Grant struct {
// granter is the address of the user granting an allowance of their funds.
Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
// grantee is the address of the user being granted an allowance of another user's funds.
Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
// allowance can be any of basic, periodic, allowed fee allowance.
Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
}
func (m *Grant)
Reset() { *m = Grant{
}
}
func (m *Grant)
String()
string {
return proto.CompactTextString(m)
}
func (*Grant)
ProtoMessage() {
}
func (*Grant)
Descriptor() ([]byte, []int) {
return fileDescriptor_7279582900c30aea, []int{3
}
}
func (m *Grant)
XXX_Unmarshal(b []byte)
error {
return m.Unmarshal(b)
}
func (m *Grant)
XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Grant.Marshal(b, m, deterministic)
}
else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Grant)
XXX_Merge(src proto.Message) {
xxx_messageInfo_Grant.Merge(m, src)
}
func (m *Grant)
XXX_Size()
int {
return m.Size()
}
func (m *Grant)
XXX_DiscardUnknown() {
xxx_messageInfo_Grant.DiscardUnknown(m)
}
var xxx_messageInfo_Grant proto.InternalMessageInfo
func (m *Grant)
GetGranter()
string {
if m != nil {
return m.Granter
}
return ""
}
func (m *Grant)
GetGrantee()
string {
if m != nil {
return m.Grantee
}
return ""
}
func (m *Grant)
GetAllowance() *types1.Any {
if m != nil {
return m.Allowance
}
return nil
}
func init() {
proto.RegisterType((*BasicAllowance)(nil), "cosmos.feegrant.v1beta1.BasicAllowance")
proto.RegisterType((*PeriodicAllowance)(nil), "cosmos.feegrant.v1beta1.PeriodicAllowance")
proto.RegisterType((*AllowedMsgAllowance)(nil), "cosmos.feegrant.v1beta1.AllowedMsgAllowance")
proto.RegisterType((*Grant)(nil), "cosmos.feegrant.v1beta1.Grant")
}
func init() {
proto.RegisterFile("cosmos/feegrant/v1beta1/feegrant.proto", fileDescriptor_7279582900c30aea)
}
var fileDescriptor_7279582900c30aea = []byte{
// 639 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x3f, 0x6f, 0xd3, 0x40,
0x14, 0x8f, 0x9b, 0xb6, 0x28, 0x17, 0x28, 0xad, 0xa9, 0x84, 0x53, 0x21, 0xbb, 0x8a, 0x04, 0x4d,
0x2b, 0xd5, 0x56, 0x8b, 0x58, 0x3a, 0x35, 0x2e, 0xa2, 0x80, 0x5a, 0xa9, 0x72, 0x99, 0x90, 0x50,
0x74, 0xb6, 0xaf, 0xe6, 0x44, 0xec, 0x33, 0x3e, 0x17, 0x1a, 0x06, 0x66, 0xc4, 0x80, 0x32, 0x32,
0x32, 0x22, 0xa6, 0x0e, 0xe5, 0x3b, 0x54, 0x0c, 0xa8, 0x62, 0x62, 0x22, 0x28, 0x19, 0x3a, 0xf3,
0x0d, 0x90, 0xef, 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owance)
Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *BasicAllowance)
MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BasicAllowance)
MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Expiration != nil {
n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintFeegrant(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x12
}
if len(m.SpendLimit) > 0 {
for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *PeriodicAllowance)
Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PeriodicAllowance)
MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PeriodicAllowance)
MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PeriodReset, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintFeegrant(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x2a
if len(m.PeriodCanSpend) > 0 {
for iNdEx := len(m.PeriodCanSpend) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.PeriodCanSpend[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
}
if len(m.PeriodSpendLimit) > 0 {
for iNdEx := len(m.PeriodSpendLimit) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.PeriodSpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period):])
if err3 != nil {
return 0, err3
}
i -= n3
i = encodeVarintFeegrant(dAtA, i, uint64(n3))
i--
dAtA[i] = 0x12
{
size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
func (m *AllowedMsgAllowance)
Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AllowedMsgAllowance)
MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AllowedMsgAllowance)
MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.AllowedMessages) > 0 {
for iNdEx := len(m.AllowedMessages) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.AllowedMessages[iNdEx])
copy(dAtA[i:], m.AllowedMessages[iNdEx])
i = encodeVarintFeegrant(dAtA, i, uint64(len(m.AllowedMessages[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if m.Allowance != nil {
{
size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Grant)
Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Grant)
MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Grant)
MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Allowance != nil {
{
size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFeegrant(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
if len(m.Grantee) > 0 {
i -= len(m.Grantee)
copy(dAtA[i:], m.Grantee)
i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Grantee)))
i--
dAtA[i] = 0x12
}
if len(m.Granter) > 0 {
i -= len(m.Granter)
copy(dAtA[i:], m.Granter)
i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Granter)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintFeegrant(dAtA []byte, offset int, v uint64)
int {
offset -= sovFeegrant(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *BasicAllowance)
Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.SpendLimit) > 0 {
for _, e := range m.SpendLimit {
l = e.Size()
n += 1 + l + sovFeegrant(uint64(l))
}
}
if m.Expiration != nil {
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration)
n += 1 + l + sovFeegrant(uint64(l))
}
return n
}
func (m *PeriodicAllowance)
Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = m.Basic.Size()
n += 1 + l + sovFeegrant(uint64(l))
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period)
n += 1 + l + sovFeegrant(uint64(l))
if len(m.PeriodSpendLimit) > 0 {
for _, e := range m.PeriodSpendLimit {
l = e.Size()
n += 1 + l + sovFeegrant(uint64(l))
}
}
if len(m.PeriodCanSpend) > 0 {
for _, e := range m.PeriodCanSpend {
l = e.Size()
n += 1 + l + sovFeegrant(uint64(l))
}
}
l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset)
n += 1 + l + sovFeegrant(uint64(l))
return n
}
func (m *AllowedMsgAllowance)
Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Allowance != nil {
l = m.Allowance.Size()
n += 1 + l + sovFeegrant(uint64(l))
}
if len(m.AllowedMessages) > 0 {
for _, s := range m.AllowedMessages {
l = len(s)
n += 1 + l + sovFeegrant(uint64(l))
}
}
return n
}
func (m *Grant)
Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Granter)프로젝트로 돌아가기