mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
feat: add CommunityCDPRepayDebtPermission (#1566)
* feat: add CommunityCDPRepayDebtPermission When granted, the new permission allows a committee to submit a CommunityCDPRepayDebtProposal to lower principal owed on a cdp owned by the x/community module. * update changelog * update protonet genesis.json
This commit is contained in:
parent
c5f414e6a5
commit
14a0860ddb
@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
|||||||
- (x/community) [#1563] Include x/community module pool balance in x/distribution
|
- (x/community) [#1563] Include x/community module pool balance in x/distribution
|
||||||
community_pool query response.
|
community_pool query response.
|
||||||
- (x/community) [#1565] Add CommunityCDPRepayDebtProposal
|
- (x/community) [#1565] Add CommunityCDPRepayDebtProposal
|
||||||
|
- (x/committee) [#1566] Add CommunityCDPRepayDebtPermission
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
@ -233,6 +234,7 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md).
|
|||||||
large-scale simulations remotely using aws-batch
|
large-scale simulations remotely using aws-batch
|
||||||
|
|
||||||
|
|
||||||
|
[#1566]: https://github.com/Kava-Labs/kava/pull/1566
|
||||||
[#1565]: https://github.com/Kava-Labs/kava/pull/1565
|
[#1565]: https://github.com/Kava-Labs/kava/pull/1565
|
||||||
[#1563]: https://github.com/Kava-Labs/kava/pull/1563
|
[#1563]: https://github.com/Kava-Labs/kava/pull/1563
|
||||||
[#1562]: https://github.com/Kava-Labs/kava/pull/1562
|
[#1562]: https://github.com/Kava-Labs/kava/pull/1562
|
||||||
|
6
ci/env/kava-protonet/genesis.json
vendored
6
ci/env/kava-protonet/genesis.json
vendored
@ -1091,6 +1091,12 @@
|
|||||||
{
|
{
|
||||||
"@type": "/kava.committee.v1beta1.TextPermission"
|
"@type": "/kava.committee.v1beta1.TextPermission"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"@type": "/kava.committee.v1beta1.CommunityPoolLendWithdrawPermission"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@type": "/kava.committee.v1beta1.CommunityCDPRepayDebtPermission"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"@type": "/kava.committee.v1beta1.ParamsChangePermission",
|
"@type": "/kava.committee.v1beta1.ParamsChangePermission",
|
||||||
"allowed_params_changes": [
|
"allowed_params_changes": [
|
||||||
|
@ -138,6 +138,7 @@
|
|||||||
|
|
||||||
- [kava/committee/v1beta1/permissions.proto](#kava/committee/v1beta1/permissions.proto)
|
- [kava/committee/v1beta1/permissions.proto](#kava/committee/v1beta1/permissions.proto)
|
||||||
- [AllowedParamsChange](#kava.committee.v1beta1.AllowedParamsChange)
|
- [AllowedParamsChange](#kava.committee.v1beta1.AllowedParamsChange)
|
||||||
|
- [CommunityCDPRepayDebtPermission](#kava.committee.v1beta1.CommunityCDPRepayDebtPermission)
|
||||||
- [CommunityPoolLendWithdrawPermission](#kava.committee.v1beta1.CommunityPoolLendWithdrawPermission)
|
- [CommunityPoolLendWithdrawPermission](#kava.committee.v1beta1.CommunityPoolLendWithdrawPermission)
|
||||||
- [GodPermission](#kava.committee.v1beta1.GodPermission)
|
- [GodPermission](#kava.committee.v1beta1.GodPermission)
|
||||||
- [ParamsChangePermission](#kava.committee.v1beta1.ParamsChangePermission)
|
- [ParamsChangePermission](#kava.committee.v1beta1.ParamsChangePermission)
|
||||||
@ -2325,6 +2326,16 @@ AllowedParamsChange contains data on the allowed parameter changes for subspace,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="kava.committee.v1beta1.CommunityCDPRepayDebtPermission"></a>
|
||||||
|
|
||||||
|
### CommunityCDPRepayDebtPermission
|
||||||
|
CommunityCDPRepayDebtPermission allows submission of CommunityCDPRepayDebtProposal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="kava.committee.v1beta1.CommunityPoolLendWithdrawPermission"></a>
|
<a name="kava.committee.v1beta1.CommunityPoolLendWithdrawPermission"></a>
|
||||||
|
|
||||||
### CommunityPoolLendWithdrawPermission
|
### CommunityPoolLendWithdrawPermission
|
||||||
|
@ -21,6 +21,11 @@ message TextPermission {
|
|||||||
option (cosmos_proto.implements_interface) = "Permission";
|
option (cosmos_proto.implements_interface) = "Permission";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CommunityCDPRepayDebtPermission allows submission of CommunityCDPRepayDebtProposal
|
||||||
|
message CommunityCDPRepayDebtPermission {
|
||||||
|
option (cosmos_proto.implements_interface) = "Permission";
|
||||||
|
}
|
||||||
|
|
||||||
// CommunityPoolLendWithdrawPermission allows submission of CommunityPoolLendWithdrawProposal
|
// CommunityPoolLendWithdrawPermission allows submission of CommunityPoolLendWithdrawProposal
|
||||||
message CommunityPoolLendWithdrawPermission {
|
message CommunityPoolLendWithdrawPermission {
|
||||||
option (cosmos_proto.implements_interface) = "Permission";
|
option (cosmos_proto.implements_interface) = "Permission";
|
||||||
|
@ -48,7 +48,9 @@ func init() {
|
|||||||
RegisterProposalTypeCodec(govv1beta1.TextProposal{}, "cosmos-sdk/TextProposal")
|
RegisterProposalTypeCodec(govv1beta1.TextProposal{}, "cosmos-sdk/TextProposal")
|
||||||
RegisterProposalTypeCodec(upgradetypes.SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal")
|
RegisterProposalTypeCodec(upgradetypes.SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal")
|
||||||
RegisterProposalTypeCodec(upgradetypes.CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal")
|
RegisterProposalTypeCodec(upgradetypes.CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal")
|
||||||
|
RegisterProposalTypeCodec(communitytypes.CommunityCDPRepayDebtProposal{}, "kava/CommunityCDPRepayDebtProposal")
|
||||||
RegisterProposalTypeCodec(communitytypes.CommunityPoolLendWithdrawProposal{}, "kava/CommunityPoolLendWithdrawProposal")
|
RegisterProposalTypeCodec(communitytypes.CommunityPoolLendWithdrawProposal{}, "kava/CommunityPoolLendWithdrawProposal")
|
||||||
|
RegisterProposalTypeCodec(kavadisttypes.CommunityPoolMultiSpendProposal{}, "kava/CommunityPoolMultiSpendProposal")
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the module.
|
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the module.
|
||||||
@ -70,6 +72,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|||||||
cdc.RegisterConcrete(TextPermission{}, "kava/TextPermission", nil)
|
cdc.RegisterConcrete(TextPermission{}, "kava/TextPermission", nil)
|
||||||
cdc.RegisterConcrete(SoftwareUpgradePermission{}, "kava/SoftwareUpgradePermission", nil)
|
cdc.RegisterConcrete(SoftwareUpgradePermission{}, "kava/SoftwareUpgradePermission", nil)
|
||||||
cdc.RegisterConcrete(ParamsChangePermission{}, "kava/ParamsChangePermission", nil)
|
cdc.RegisterConcrete(ParamsChangePermission{}, "kava/ParamsChangePermission", nil)
|
||||||
|
cdc.RegisterConcrete(CommunityCDPRepayDebtPermission{}, "kava/CommunityCDPRepayDebtPermission", nil)
|
||||||
cdc.RegisterConcrete(CommunityPoolLendWithdrawPermission{}, "kava/CommunityPoolLendWithdrawPermission", nil)
|
cdc.RegisterConcrete(CommunityPoolLendWithdrawPermission{}, "kava/CommunityPoolLendWithdrawPermission", nil)
|
||||||
|
|
||||||
// Msgs
|
// Msgs
|
||||||
@ -106,6 +109,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
&TextPermission{},
|
&TextPermission{},
|
||||||
&SoftwareUpgradePermission{},
|
&SoftwareUpgradePermission{},
|
||||||
&ParamsChangePermission{},
|
&ParamsChangePermission{},
|
||||||
|
&CommunityCDPRepayDebtPermission{},
|
||||||
&CommunityPoolLendWithdrawPermission{},
|
&CommunityPoolLendWithdrawPermission{},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -121,8 +125,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
&proposaltypes.ParameterChangeProposal{},
|
&proposaltypes.ParameterChangeProposal{},
|
||||||
&upgradetypes.SoftwareUpgradeProposal{},
|
&upgradetypes.SoftwareUpgradeProposal{},
|
||||||
&upgradetypes.CancelSoftwareUpgradeProposal{},
|
&upgradetypes.CancelSoftwareUpgradeProposal{},
|
||||||
|
&communitytypes.CommunityCDPRepayDebtProposal{},
|
||||||
&communitytypes.CommunityPoolLendWithdrawProposal{},
|
&communitytypes.CommunityPoolLendWithdrawProposal{},
|
||||||
&kavadisttypes.CommunityPoolMultiSpendProposal{},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterImplementations(
|
registry.RegisterImplementations(
|
||||||
|
@ -54,6 +54,7 @@ var (
|
|||||||
_ Permission = TextPermission{}
|
_ Permission = TextPermission{}
|
||||||
_ Permission = SoftwareUpgradePermission{}
|
_ Permission = SoftwareUpgradePermission{}
|
||||||
_ Permission = ParamsChangePermission{}
|
_ Permission = ParamsChangePermission{}
|
||||||
|
_ Permission = CommunityCDPRepayDebtPermission{}
|
||||||
_ Permission = CommunityPoolLendWithdrawPermission{}
|
_ Permission = CommunityPoolLendWithdrawPermission{}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -72,6 +73,12 @@ func (SoftwareUpgradePermission) Allows(_ sdk.Context, _ ParamKeeper, p PubPropo
|
|||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allows implement permission interface for CommunityCDPRepayDebtPermission.
|
||||||
|
func (CommunityCDPRepayDebtPermission) Allows(_ sdk.Context, _ ParamKeeper, p PubProposal) bool {
|
||||||
|
_, ok := p.(*communitytypes.CommunityCDPRepayDebtProposal)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
// Allows implement permission interface for CommunityPoolLendWithdrawPermission.
|
// Allows implement permission interface for CommunityPoolLendWithdrawPermission.
|
||||||
func (CommunityPoolLendWithdrawPermission) Allows(_ sdk.Context, _ ParamKeeper, p PubProposal) bool {
|
func (CommunityPoolLendWithdrawPermission) Allows(_ sdk.Context, _ ParamKeeper, p PubProposal) bool {
|
||||||
_, ok := p.(*communitytypes.CommunityPoolLendWithdrawProposal)
|
_, ok := p.(*communitytypes.CommunityPoolLendWithdrawProposal)
|
||||||
|
@ -135,6 +135,43 @@ func (m *TextPermission) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_TextPermission proto.InternalMessageInfo
|
var xxx_messageInfo_TextPermission proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// CommunityCDPRepayDebtPermission allows submission of CommunityCDPRepayDebtProposal
|
||||||
|
type CommunityCDPRepayDebtPermission struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) Reset() { *m = CommunityCDPRepayDebtPermission{} }
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*CommunityCDPRepayDebtPermission) ProtoMessage() {}
|
||||||
|
func (*CommunityCDPRepayDebtPermission) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_bdfaf7be16465ae4, []int{3}
|
||||||
|
}
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_CommunityCDPRepayDebtPermission.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 *CommunityCDPRepayDebtPermission) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_CommunityCDPRepayDebtPermission.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_CommunityCDPRepayDebtPermission.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_CommunityCDPRepayDebtPermission proto.InternalMessageInfo
|
||||||
|
|
||||||
// CommunityPoolLendWithdrawPermission allows submission of CommunityPoolLendWithdrawProposal
|
// CommunityPoolLendWithdrawPermission allows submission of CommunityPoolLendWithdrawProposal
|
||||||
type CommunityPoolLendWithdrawPermission struct {
|
type CommunityPoolLendWithdrawPermission struct {
|
||||||
}
|
}
|
||||||
@ -143,7 +180,7 @@ func (m *CommunityPoolLendWithdrawPermission) Reset() { *m = CommunityPo
|
|||||||
func (m *CommunityPoolLendWithdrawPermission) String() string { return proto.CompactTextString(m) }
|
func (m *CommunityPoolLendWithdrawPermission) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CommunityPoolLendWithdrawPermission) ProtoMessage() {}
|
func (*CommunityPoolLendWithdrawPermission) ProtoMessage() {}
|
||||||
func (*CommunityPoolLendWithdrawPermission) Descriptor() ([]byte, []int) {
|
func (*CommunityPoolLendWithdrawPermission) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_bdfaf7be16465ae4, []int{3}
|
return fileDescriptor_bdfaf7be16465ae4, []int{4}
|
||||||
}
|
}
|
||||||
func (m *CommunityPoolLendWithdrawPermission) XXX_Unmarshal(b []byte) error {
|
func (m *CommunityPoolLendWithdrawPermission) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@ -181,7 +218,7 @@ func (m *ParamsChangePermission) Reset() { *m = ParamsChangePermission{}
|
|||||||
func (m *ParamsChangePermission) String() string { return proto.CompactTextString(m) }
|
func (m *ParamsChangePermission) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ParamsChangePermission) ProtoMessage() {}
|
func (*ParamsChangePermission) ProtoMessage() {}
|
||||||
func (*ParamsChangePermission) Descriptor() ([]byte, []int) {
|
func (*ParamsChangePermission) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_bdfaf7be16465ae4, []int{4}
|
return fileDescriptor_bdfaf7be16465ae4, []int{5}
|
||||||
}
|
}
|
||||||
func (m *ParamsChangePermission) XXX_Unmarshal(b []byte) error {
|
func (m *ParamsChangePermission) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@ -233,7 +270,7 @@ func (m *AllowedParamsChange) Reset() { *m = AllowedParamsChange{} }
|
|||||||
func (m *AllowedParamsChange) String() string { return proto.CompactTextString(m) }
|
func (m *AllowedParamsChange) String() string { return proto.CompactTextString(m) }
|
||||||
func (*AllowedParamsChange) ProtoMessage() {}
|
func (*AllowedParamsChange) ProtoMessage() {}
|
||||||
func (*AllowedParamsChange) Descriptor() ([]byte, []int) {
|
func (*AllowedParamsChange) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_bdfaf7be16465ae4, []int{5}
|
return fileDescriptor_bdfaf7be16465ae4, []int{6}
|
||||||
}
|
}
|
||||||
func (m *AllowedParamsChange) XXX_Unmarshal(b []byte) error {
|
func (m *AllowedParamsChange) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@ -304,7 +341,7 @@ func (m *SubparamRequirement) Reset() { *m = SubparamRequirement{} }
|
|||||||
func (m *SubparamRequirement) String() string { return proto.CompactTextString(m) }
|
func (m *SubparamRequirement) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SubparamRequirement) ProtoMessage() {}
|
func (*SubparamRequirement) ProtoMessage() {}
|
||||||
func (*SubparamRequirement) Descriptor() ([]byte, []int) {
|
func (*SubparamRequirement) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_bdfaf7be16465ae4, []int{6}
|
return fileDescriptor_bdfaf7be16465ae4, []int{7}
|
||||||
}
|
}
|
||||||
func (m *SubparamRequirement) XXX_Unmarshal(b []byte) error {
|
func (m *SubparamRequirement) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@ -358,6 +395,7 @@ func init() {
|
|||||||
proto.RegisterType((*GodPermission)(nil), "kava.committee.v1beta1.GodPermission")
|
proto.RegisterType((*GodPermission)(nil), "kava.committee.v1beta1.GodPermission")
|
||||||
proto.RegisterType((*SoftwareUpgradePermission)(nil), "kava.committee.v1beta1.SoftwareUpgradePermission")
|
proto.RegisterType((*SoftwareUpgradePermission)(nil), "kava.committee.v1beta1.SoftwareUpgradePermission")
|
||||||
proto.RegisterType((*TextPermission)(nil), "kava.committee.v1beta1.TextPermission")
|
proto.RegisterType((*TextPermission)(nil), "kava.committee.v1beta1.TextPermission")
|
||||||
|
proto.RegisterType((*CommunityCDPRepayDebtPermission)(nil), "kava.committee.v1beta1.CommunityCDPRepayDebtPermission")
|
||||||
proto.RegisterType((*CommunityPoolLendWithdrawPermission)(nil), "kava.committee.v1beta1.CommunityPoolLendWithdrawPermission")
|
proto.RegisterType((*CommunityPoolLendWithdrawPermission)(nil), "kava.committee.v1beta1.CommunityPoolLendWithdrawPermission")
|
||||||
proto.RegisterType((*ParamsChangePermission)(nil), "kava.committee.v1beta1.ParamsChangePermission")
|
proto.RegisterType((*ParamsChangePermission)(nil), "kava.committee.v1beta1.ParamsChangePermission")
|
||||||
proto.RegisterType((*AllowedParamsChange)(nil), "kava.committee.v1beta1.AllowedParamsChange")
|
proto.RegisterType((*AllowedParamsChange)(nil), "kava.committee.v1beta1.AllowedParamsChange")
|
||||||
@ -369,37 +407,38 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_bdfaf7be16465ae4 = []byte{
|
var fileDescriptor_bdfaf7be16465ae4 = []byte{
|
||||||
// 478 bytes of a gzipped FileDescriptorProto
|
// 493 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x8b, 0xd3, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x8b, 0xd3, 0x40,
|
||||||
0x18, 0x87, 0x1b, 0xbb, 0x88, 0x3b, 0xe2, 0xb2, 0x64, 0x4b, 0xc9, 0x86, 0x35, 0x2d, 0xf5, 0x52,
|
0x18, 0x87, 0x1b, 0xb3, 0x88, 0x3b, 0xe2, 0xb2, 0x64, 0x4b, 0xc9, 0x86, 0x35, 0x2d, 0xf5, 0x52,
|
||||||
0x28, 0x9b, 0xb0, 0x8a, 0x17, 0x6f, 0xed, 0x22, 0x5e, 0x3c, 0x94, 0xac, 0x22, 0x78, 0x09, 0x93,
|
0x28, 0x9b, 0x50, 0xc5, 0x8b, 0xb7, 0xb6, 0x2b, 0x5e, 0x3c, 0x94, 0xac, 0x22, 0x78, 0x09, 0x93,
|
||||||
0x66, 0x4c, 0x87, 0xcd, 0x64, 0xe2, 0xbc, 0x6f, 0xda, 0x2d, 0x08, 0x7e, 0x05, 0xbf, 0x86, 0x9e,
|
0x66, 0x4c, 0xc3, 0x26, 0x99, 0x38, 0xef, 0x9b, 0x76, 0x0b, 0x82, 0x5f, 0xc1, 0xaf, 0xa1, 0x67,
|
||||||
0xfd, 0x10, 0x8b, 0xa7, 0x3d, 0x7a, 0x52, 0x69, 0x3f, 0x86, 0x17, 0xc9, 0xdf, 0x16, 0x0c, 0xbd,
|
0x3f, 0xc4, 0xe2, 0xa9, 0x47, 0x4f, 0x2a, 0xed, 0xc7, 0xf0, 0x22, 0xf9, 0xdb, 0x82, 0x21, 0xb7,
|
||||||
0xcd, 0xbc, 0xf3, 0xfc, 0xde, 0x99, 0x67, 0x86, 0x21, 0xc3, 0x6b, 0xba, 0xa0, 0xce, 0x4c, 0x0a,
|
0x99, 0x77, 0x9e, 0xdf, 0x3b, 0xf3, 0xcc, 0x30, 0x64, 0x70, 0x43, 0x97, 0xd4, 0x9c, 0xf3, 0x30,
|
||||||
0xc1, 0x11, 0x19, 0x73, 0x16, 0x17, 0x3e, 0x43, 0x7a, 0xe1, 0x24, 0x4c, 0x09, 0x0e, 0xc0, 0x65,
|
0xf4, 0x11, 0x19, 0x33, 0x97, 0x23, 0x87, 0x21, 0x1d, 0x99, 0x31, 0x13, 0xa1, 0x0f, 0xe0, 0xf3,
|
||||||
0x0c, 0x76, 0xa2, 0x24, 0x4a, 0xbd, 0x9b, 0x91, 0x76, 0x4d, 0xda, 0x25, 0x69, 0x9e, 0xce, 0x24,
|
0x08, 0x8c, 0x58, 0x70, 0xe4, 0x4a, 0x27, 0x25, 0x8d, 0x8a, 0x34, 0x0a, 0x52, 0x3b, 0x9f, 0x73,
|
||||||
0x08, 0x09, 0x5e, 0x4e, 0x39, 0xc5, 0xa4, 0x88, 0x98, 0x9d, 0x50, 0x86, 0xb2, 0xa8, 0x67, 0xa3,
|
0x08, 0x39, 0xd8, 0x19, 0x65, 0xe6, 0x93, 0x3c, 0xa2, 0xb5, 0x3d, 0xee, 0xf1, 0xbc, 0x9e, 0x8e,
|
||||||
0xa2, 0x3a, 0xe8, 0x91, 0x47, 0xaf, 0x64, 0x30, 0xad, 0x37, 0x78, 0x71, 0xf4, 0xe3, 0xfb, 0x39,
|
0xf2, 0x6a, 0xbf, 0x4b, 0x1e, 0xbd, 0xe2, 0xee, 0xac, 0xda, 0xe0, 0xc5, 0xc9, 0x8f, 0xef, 0x97,
|
||||||
0xd9, 0xce, 0x07, 0x23, 0x72, 0x7a, 0x25, 0x3f, 0xe0, 0x92, 0x2a, 0xf6, 0x36, 0x09, 0x15, 0x0d,
|
0x64,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, 0x7a, 0x3f, 0x0a, 0x39, 0xce, 0x53, 0x3f, 0xf3, 0x74, 0x32, 0xe1, 0xf3, 0x88,
|
0xb4, 0xd9, 0xea, 0xd2, 0x9f, 0xad, 0x2e, 0x7d, 0xd9, 0xe9, 0xad, 0xcd, 0x4e, 0x6f, 0xfd, 0xdc,
|
||||||
0xfa, 0x90, 0x8f, 0x9c, 0x9b, 0x9d, 0x2f, 0x87, 0xab, 0x84, 0x81, 0x7f, 0x3f, 0xff, 0x1c, 0xcf,
|
0xe9, 0xad, 0xf7, 0x43, 0xcf, 0xc7, 0x45, 0xe2, 0xa4, 0x9e, 0x66, 0x2a, 0x7c, 0x19, 0x50, 0x07,
|
||||||
0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xcd, 0x1f, 0x08, 0x91, 0x03, 0x00, 0x00,
|
0xb2, 0x91, 0x79, 0x7b, 0xf0, 0x4b, 0x71, 0x1d, 0x33, 0x70, 0xee, 0x67, 0xff, 0xe9, 0xd9, 0xbf,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0xff, 0x85, 0x2f, 0x94, 0x6f, 0xc4, 0x03, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GodPermission) Marshal() (dAtA []byte, err error) {
|
func (m *GodPermission) Marshal() (dAtA []byte, err error) {
|
||||||
@ -471,6 +510,29 @@ func (m *TextPermission) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) 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 *CommunityCDPRepayDebtPermission) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *CommunityPoolLendWithdrawPermission) Marshal() (dAtA []byte, err error) {
|
func (m *CommunityPoolLendWithdrawPermission) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@ -675,6 +737,15 @@ func (m *TextPermission) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func (m *CommunityPoolLendWithdrawPermission) Size() (n int) {
|
func (m *CommunityPoolLendWithdrawPermission) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
@ -907,6 +978,56 @@ func (m *TextPermission) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *CommunityCDPRepayDebtPermission) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowPermissions
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: CommunityCDPRepayDebtPermission: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: CommunityCDPRepayDebtPermission: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipPermissions(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthPermissions
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (m *CommunityPoolLendWithdrawPermission) Unmarshal(dAtA []byte) error {
|
func (m *CommunityPoolLendWithdrawPermission) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
@ -41,6 +41,44 @@ func TestUnpackPermissions_Failure(t *testing.T) {
|
|||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCommunityCDPRepayDebtPermission_Allows(t *testing.T) {
|
||||||
|
permission := types.CommunityCDPRepayDebtPermission{}
|
||||||
|
testcases := []struct {
|
||||||
|
name string
|
||||||
|
proposal types.PubProposal
|
||||||
|
allowed bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "allowed for correct proposal",
|
||||||
|
proposal: communitytypes.NewCommunityCDPRepayDebtProposal(
|
||||||
|
"repay x/community cdp debt",
|
||||||
|
"repays debt on a cdp position",
|
||||||
|
"collateral-type",
|
||||||
|
sdk.NewInt64Coin("ukava", 1e10),
|
||||||
|
),
|
||||||
|
allowed: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fails for nil proposal",
|
||||||
|
proposal: nil,
|
||||||
|
allowed: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fails for wrong proposal",
|
||||||
|
proposal: newTestParamsChangeProposalWithChanges([]paramsproposal.ParamChange{
|
||||||
|
{Subspace: "cdp", Key: "DebtThreshold", Value: `test`},
|
||||||
|
}),
|
||||||
|
allowed: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testcases {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
require.Equal(t, tc.allowed, permission.Allows(sdk.Context{}, nil, tc.proposal))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestCommunityPoolLendWithdrawPermission_Allows(t *testing.T) {
|
func TestCommunityPoolLendWithdrawPermission_Allows(t *testing.T) {
|
||||||
permission := types.CommunityPoolLendWithdrawPermission{}
|
permission := types.CommunityPoolLendWithdrawPermission{}
|
||||||
testcases := []struct {
|
testcases := []struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user