forked from cerc-io/laconicd
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d361062cb | ||
|
|
c7f9ef6576 | ||
|
|
debfb82205 | ||
|
|
3c5cd002e1 | ||
|
|
b5a76a920e | ||
|
|
f176a5889e | ||
|
|
5e7d5fc47c | ||
|
|
c162396298 | ||
|
|
7a88c82816 | ||
|
|
9fab3f8326 |
@@ -25,6 +25,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Copy over binary from the builder
|
||||
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
||||
|
||||
# Copy over init script from builder
|
||||
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/scripts/init.sh scripts/init.sh
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Run laconicd by default
|
||||
|
||||
@@ -14,12 +14,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
md_Module protoreflect.MessageDescriptor
|
||||
md_Module protoreflect.MessageDescriptor
|
||||
fd_Module_authority protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_cerc_bond_module_v1_module_proto_init()
|
||||
md_Module = File_cerc_bond_module_v1_module_proto.Messages().ByName("Module")
|
||||
fd_Module_authority = md_Module.Fields().ByName("authority")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
||||
@@ -87,6 +89,12 @@ func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.Authority != "" {
|
||||
value := protoreflect.ValueOfString(x.Authority)
|
||||
if !f(fd_Module_authority, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
@@ -102,6 +110,8 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
return x.Authority != ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -118,6 +128,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
x.Authority = ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -134,6 +146,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
value := x.Authority
|
||||
return protoreflect.ValueOfString(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -154,6 +169,8 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
x.Authority = value.Interface().(string)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -174,6 +191,8 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
panic(fmt.Errorf("field authority of message cerc.bond.module.v1.Module is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -187,6 +206,8 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cerc.bond.module.v1.Module.authority":
|
||||
return protoreflect.ValueOfString("")
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
||||
@@ -256,6 +277,10 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
l = len(x.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@@ -285,6 +310,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if len(x.Authority) > 0 {
|
||||
i -= len(x.Authority)
|
||||
copy(dAtA[i:], x.Authority)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
@@ -334,6 +366,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
@@ -388,6 +452,10 @@ type Module struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// authority defines the custom module authority. If not set, defaults to the
|
||||
// governance module.
|
||||
Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Module) Reset() {
|
||||
@@ -410,6 +478,13 @@ func (*Module) Descriptor() ([]byte, []int) {
|
||||
return file_cerc_bond_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Module) GetAuthority() string {
|
||||
if x != nil {
|
||||
return x.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_cerc_bond_module_v1_module_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_cerc_bond_module_v1_module_proto_rawDesc = []byte{
|
||||
@@ -418,24 +493,26 @@ var file_cerc_bond_module_v1_module_proto_rawDesc = []byte{
|
||||
0x74, 0x6f, 0x12, 0x13, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x62, 0x6f, 0x6e, 0x64, 0x2e, 0x6d, 0x6f,
|
||||
0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f,
|
||||
0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x06, 0x4d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x3a, 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74,
|
||||
0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f,
|
||||
0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78, 0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x42,
|
||||
0xd3, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x62, 0x6f, 0x6e,
|
||||
0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e,
|
||||
0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c,
|
||||
0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63,
|
||||
0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b,
|
||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02,
|
||||
0x13, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64,
|
||||
0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x65, 0x72,
|
||||
0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31,
|
||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43,
|
||||
0x65, 0x72, 0x63, 0x3a, 0x3a, 0x42, 0x6f, 0x6e, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x06, 0x4d, 0x6f, 0x64,
|
||||
0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
|
||||
0x79, 0x3a, 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, 0x2e, 0x76,
|
||||
0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61,
|
||||
0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78, 0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x42, 0xd3, 0x01,
|
||||
0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x62, 0x6f, 0x6e, 0x64, 0x2e,
|
||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64,
|
||||
0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63,
|
||||
0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x62,
|
||||
0x6f, 0x6e, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f,
|
||||
0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02, 0x13, 0x43,
|
||||
0x65, 0x72, 0x63, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e,
|
||||
0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d,
|
||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x65, 0x72, 0x63, 0x5c,
|
||||
0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47,
|
||||
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x65, 0x72,
|
||||
0x63, 0x3a, 0x3a, 0x42, 0x6f, 0x6e, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a,
|
||||
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
+1091
-108
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@ const (
|
||||
Msg_RefillBond_FullMethodName = "/cerc.bond.v1.Msg/RefillBond"
|
||||
Msg_WithdrawBond_FullMethodName = "/cerc.bond.v1.Msg/WithdrawBond"
|
||||
Msg_CancelBond_FullMethodName = "/cerc.bond.v1.Msg/CancelBond"
|
||||
Msg_UpdateParams_FullMethodName = "/cerc.bond.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
@@ -37,6 +38,9 @@ type MsgClient interface {
|
||||
WithdrawBond(ctx context.Context, in *MsgWithdrawBond, opts ...grpc.CallOption) (*MsgWithdrawBondResponse, error)
|
||||
// CancelBond defines a method for cancelling a bond.
|
||||
CancelBond(ctx context.Context, in *MsgCancelBond, opts ...grpc.CallOption) (*MsgCancelBondResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -83,6 +87,15 @@ func (c *msgClient) CancelBond(ctx context.Context, in *MsgCancelBond, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
@@ -95,6 +108,9 @@ type MsgServer interface {
|
||||
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
||||
// CancelBond defines a method for cancelling a bond.
|
||||
CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
@@ -114,6 +130,9 @@ func (UnimplementedMsgServer) WithdrawBond(context.Context, *MsgWithdrawBond) (*
|
||||
func (UnimplementedMsgServer) CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelBond not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -199,6 +218,24 @@ func _Msg_CancelBond_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -222,6 +259,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CancelBond",
|
||||
Handler: _Msg_CancelBond_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/bond/v1/tx.proto",
|
||||
|
||||
@@ -427,6 +427,8 @@ var (
|
||||
md_Participant protoreflect.MessageDescriptor
|
||||
fd_Participant_cosmos_address protoreflect.FieldDescriptor
|
||||
fd_Participant_nitro_address protoreflect.FieldDescriptor
|
||||
fd_Participant_role protoreflect.FieldDescriptor
|
||||
fd_Participant_kyc_id protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -434,6 +436,8 @@ func init() {
|
||||
md_Participant = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Participant")
|
||||
fd_Participant_cosmos_address = md_Participant.Fields().ByName("cosmos_address")
|
||||
fd_Participant_nitro_address = md_Participant.Fields().ByName("nitro_address")
|
||||
fd_Participant_role = md_Participant.Fields().ByName("role")
|
||||
fd_Participant_kyc_id = md_Participant.Fields().ByName("kyc_id")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_Participant)(nil)
|
||||
@@ -513,6 +517,18 @@ func (x *fastReflection_Participant) Range(f func(protoreflect.FieldDescriptor,
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.Role != "" {
|
||||
value := protoreflect.ValueOfString(x.Role)
|
||||
if !f(fd_Participant_role, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.KycId != "" {
|
||||
value := protoreflect.ValueOfString(x.KycId)
|
||||
if !f(fd_Participant_kyc_id, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
@@ -532,6 +548,10 @@ func (x *fastReflection_Participant) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
return x.CosmosAddress != ""
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
return x.NitroAddress != ""
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
return x.Role != ""
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
return x.KycId != ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -552,6 +572,10 @@ func (x *fastReflection_Participant) Clear(fd protoreflect.FieldDescriptor) {
|
||||
x.CosmosAddress = ""
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
x.NitroAddress = ""
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
x.Role = ""
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
x.KycId = ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -574,6 +598,12 @@ func (x *fastReflection_Participant) Get(descriptor protoreflect.FieldDescriptor
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
value := x.NitroAddress
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
value := x.Role
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
value := x.KycId
|
||||
return protoreflect.ValueOfString(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -598,6 +628,10 @@ func (x *fastReflection_Participant) Set(fd protoreflect.FieldDescriptor, value
|
||||
x.CosmosAddress = value.Interface().(string)
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
x.NitroAddress = value.Interface().(string)
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
x.Role = value.Interface().(string)
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
x.KycId = value.Interface().(string)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -622,6 +656,10 @@ func (x *fastReflection_Participant) Mutable(fd protoreflect.FieldDescriptor) pr
|
||||
panic(fmt.Errorf("field cosmos_address of message cerc.onboarding.v1.Participant is not mutable"))
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
panic(fmt.Errorf("field nitro_address of message cerc.onboarding.v1.Participant is not mutable"))
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
panic(fmt.Errorf("field role of message cerc.onboarding.v1.Participant is not mutable"))
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
panic(fmt.Errorf("field kyc_id of message cerc.onboarding.v1.Participant is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -639,6 +677,10 @@ func (x *fastReflection_Participant) NewField(fd protoreflect.FieldDescriptor) p
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cerc.onboarding.v1.Participant.nitro_address":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cerc.onboarding.v1.Participant.role":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cerc.onboarding.v1.Participant.kyc_id":
|
||||
return protoreflect.ValueOfString("")
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant"))
|
||||
@@ -716,6 +758,14 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods {
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.Role)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.KycId)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@@ -745,6 +795,20 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if len(x.KycId) > 0 {
|
||||
i -= len(x.KycId)
|
||||
copy(dAtA[i:], x.KycId)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KycId)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(x.Role) > 0 {
|
||||
i -= len(x.Role)
|
||||
copy(dAtA[i:], x.Role)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(x.NitroAddress) > 0 {
|
||||
i -= len(x.NitroAddress)
|
||||
copy(dAtA[i:], x.NitroAddress)
|
||||
@@ -872,6 +936,70 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
x.NitroAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Role = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.KycId = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
@@ -1447,8 +1575,14 @@ type Participant struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// participant's cosmos (laconic) address
|
||||
CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"`
|
||||
NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"`
|
||||
// participant's Nitro address
|
||||
NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"`
|
||||
// participant's role (participant | validator)
|
||||
Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"`
|
||||
// participant's KYC receipt ID
|
||||
KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Participant) Reset() {
|
||||
@@ -1485,6 +1619,20 @@ func (x *Participant) GetNitroAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Participant) GetRole() string {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Participant) GetKycId() string {
|
||||
if x != nil {
|
||||
return x.KycId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// EthPayload defines the payload that is signed by the ethereum private key
|
||||
type EthPayload struct {
|
||||
state protoimpl.MessageState
|
||||
@@ -1544,7 +1692,7 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{
|
||||
0x6c, 0x65, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x6e, 0x62, 0x6f, 0x61,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x52, 0x11,
|
||||
0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x64, 0x22, 0xb9, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
|
||||
0x64, 0x22, 0xa2, 0x02, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
|
||||
0x74, 0x12, 0x56, 0x0a, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xf2, 0xde, 0x1f, 0x2b, 0x6a,
|
||||
0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72,
|
||||
@@ -1555,29 +1703,35 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{
|
||||
0x42, 0x2d, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, 0x69, 0x74, 0x72,
|
||||
0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a,
|
||||
0x22, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52,
|
||||
0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x76, 0x0a,
|
||||
0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x61,
|
||||
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xf2, 0xde,
|
||||
0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22,
|
||||
0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52,
|
||||
0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a,
|
||||
0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22,
|
||||
0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0xd4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65,
|
||||
0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31,
|
||||
0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f,
|
||||
0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72,
|
||||
0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69,
|
||||
0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72,
|
||||
0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca,
|
||||
0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e,
|
||||
0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f,
|
||||
0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
|
||||
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e,
|
||||
0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a,
|
||||
0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f,
|
||||
0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d,
|
||||
0x6c, 0x3a, 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x36,
|
||||
0x0a, 0x06, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f,
|
||||
0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64,
|
||||
0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x52,
|
||||
0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, 0x22, 0x76, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a,
|
||||
0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22,
|
||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
|
||||
0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19,
|
||||
0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79,
|
||||
0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0xd4,
|
||||
0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f,
|
||||
0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69,
|
||||
0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f,
|
||||
0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65,
|
||||
0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31,
|
||||
0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
||||
0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c,
|
||||
0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e,
|
||||
0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c,
|
||||
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e,
|
||||
0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,9 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Query_Participants_FullMethodName = "/cerc.onboarding.v1.Query/Participants"
|
||||
Query_Participants_FullMethodName = "/cerc.onboarding.v1.Query/Participants"
|
||||
Query_GetParticipantByAddress_FullMethodName = "/cerc.onboarding.v1.Query/GetParticipantByAddress"
|
||||
Query_GetParticipantByNitroAddress_FullMethodName = "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
@@ -28,6 +30,10 @@ const (
|
||||
type QueryClient interface {
|
||||
// Participants queries Participants list
|
||||
Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error)
|
||||
// GetParticipantByAddress queries a participant by cosmos (laconic) address
|
||||
GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error)
|
||||
// GetParticipantByNitroAddress queries a participant by nitro address
|
||||
GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
@@ -47,12 +53,34 @@ func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error) {
|
||||
out := new(QueryGetParticipantByAddressResponse)
|
||||
err := c.cc.Invoke(ctx, Query_GetParticipantByAddress_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error) {
|
||||
out := new(QueryGetParticipantByNitroAddressResponse)
|
||||
err := c.cc.Invoke(ctx, Query_GetParticipantByNitroAddress_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
// All implementations must embed UnimplementedQueryServer
|
||||
// for forward compatibility
|
||||
type QueryServer interface {
|
||||
// Participants queries Participants list
|
||||
Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error)
|
||||
// GetParticipantByAddress queries a participant by cosmos (laconic) address
|
||||
GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error)
|
||||
// GetParticipantByNitroAddress queries a participant by nitro address
|
||||
GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
@@ -63,6 +91,12 @@ type UnimplementedQueryServer struct {
|
||||
func (UnimplementedQueryServer) Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByAddress not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByNitroAddress not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||
|
||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -94,6 +128,42 @@ func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_GetParticipantByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryGetParticipantByAddressRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).GetParticipantByAddress(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_GetParticipantByAddress_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).GetParticipantByAddress(ctx, req.(*QueryGetParticipantByAddressRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_GetParticipantByNitroAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryGetParticipantByNitroAddressRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_GetParticipantByNitroAddress_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, req.(*QueryGetParticipantByNitroAddressRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -105,6 +175,14 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Participants",
|
||||
Handler: _Query_Participants_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetParticipantByAddress",
|
||||
Handler: _Query_GetParticipantByAddress_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetParticipantByNitroAddress",
|
||||
Handler: _Query_GetParticipantByNitroAddress_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/onboarding/v1/query.proto",
|
||||
|
||||
+1178
-49
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Msg_OnboardParticipant_FullMethodName = "/cerc.onboarding.v1.Msg/OnboardParticipant"
|
||||
Msg_UpdateParams_FullMethodName = "/cerc.onboarding.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
@@ -28,6 +29,9 @@ const (
|
||||
type MsgClient interface {
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -47,12 +51,24 @@ func (c *msgClient) OnboardParticipant(ctx context.Context, in *MsgOnboardPartic
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
type MsgServer interface {
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
@@ -63,6 +79,9 @@ type UnimplementedMsgServer struct {
|
||||
func (UnimplementedMsgServer) OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnboardParticipant not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -94,6 +113,24 @@ func _Msg_OnboardParticipant_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -105,6 +142,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "OnboardParticipant",
|
||||
Handler: _Msg_OnboardParticipant_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/onboarding/v1/tx.proto",
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
|
||||
@@ -48,6 +49,7 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects
|
||||
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
|
||||
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
|
||||
)
|
||||
|
||||
@@ -76,6 +78,7 @@ type LaconicApp struct {
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
BankKeeper bankkeeper.Keeper
|
||||
StakingKeeper *stakingkeeper.Keeper
|
||||
SlashingKeeper slashingkeeper.Keeper
|
||||
DistrKeeper distrkeeper.Keeper
|
||||
CrisisKeeper *crisiskeeper.Keeper
|
||||
ConsensusParamsKeeper consensuskeeper.Keeper
|
||||
@@ -142,6 +145,7 @@ func NewLaconicApp(
|
||||
&app.AccountKeeper,
|
||||
&app.BankKeeper,
|
||||
&app.StakingKeeper,
|
||||
&app.SlashingKeeper,
|
||||
&app.DistrKeeper,
|
||||
&app.CrisisKeeper,
|
||||
&app.ConsensusParamsKeeper,
|
||||
|
||||
+5
-2
@@ -6,11 +6,11 @@ modules:
|
||||
# During begin block slashing happens after distr.BeginBlocker so that
|
||||
# there is nothing left over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
|
||||
# NOTE: staking module is required if HistoricalEntries param > 0
|
||||
begin_blockers: [distribution, staking]
|
||||
begin_blockers: [distribution, slashing, staking]
|
||||
end_blockers: [crisis, staking, auction, registry]
|
||||
# NOTE: The genutils module must occur after staking so that pools are properly initialized with tokens from genesis accounts.
|
||||
# NOTE: The genutils module must also occur after auth so that it can access the params from auth.
|
||||
init_genesis: [auth, bank, distribution, staking, crisis, genutil, auction, bond, registry, onboarding]
|
||||
init_genesis: [auth, bank, distribution, staking, slashing, crisis, genutil, auction, bond, registry, onboarding]
|
||||
override_store_keys:
|
||||
- module_name: auth
|
||||
kv_store_key: acc
|
||||
@@ -39,6 +39,9 @@ modules:
|
||||
- name: staking
|
||||
config:
|
||||
"@type": cosmos.staking.module.v1.Module
|
||||
- name: slashing
|
||||
config:
|
||||
"@type": cosmos.slashing.module.v1.Module
|
||||
- name: distribution
|
||||
config:
|
||||
"@type": cosmos.distribution.module.v1.Module
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
@@ -221,4 +222,16 @@ func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
/* Handle slashing state. */
|
||||
|
||||
// reset start height on signing infos
|
||||
app.SlashingKeeper.IterateValidatorSigningInfos(
|
||||
ctx,
|
||||
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
|
||||
info.StartHeight = 0
|
||||
app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
|
||||
return false
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
CoinUnit = "photon"
|
||||
CoinUnit = "lnt"
|
||||
BaseCoinUnit = "alnt"
|
||||
LntExponent = 18
|
||||
|
||||
DefaultBondDenom = CoinUnit
|
||||
DefaultBondDenom = BaseCoinUnit
|
||||
|
||||
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
|
||||
Bech32PrefixAccAddr = "laconic"
|
||||
@@ -41,6 +43,11 @@ func RegisterDenoms() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LntExponent))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func SetAddressPrefixes() {
|
||||
|
||||
@@ -98,7 +98,7 @@ func NewRootCmd() *cobra.Command {
|
||||
|
||||
// overwrite the minimum gas price from the app configuration
|
||||
srvCfg := serverconfig.DefaultConfig()
|
||||
srvCfg.MinGasPrices = "0photon"
|
||||
srvCfg.MinGasPrices = "0alnt"
|
||||
|
||||
// overwrite the block timeout
|
||||
cmtCfg := cmtcfg.DefaultConfig()
|
||||
|
||||
@@ -61,6 +61,7 @@ require (
|
||||
github.com/agnivade/levenshtein v1.1.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.10.0 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
||||
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
|
||||
|
||||
@@ -33,6 +33,8 @@ type Account {
|
||||
type Participant {
|
||||
cosmosAddress: String! # Cosmos address of the participant who will be registered.
|
||||
nitroAddress: String! # Nitro addresss of the participant who will be registered.
|
||||
role: String! # Participant's role
|
||||
kycId: String! # Participant's KYC receipt ID
|
||||
}
|
||||
|
||||
# Value describes a DAG-JSON compatible value.
|
||||
@@ -195,6 +197,11 @@ type AuthorityRecord {
|
||||
auction: Auction # Authority auction.
|
||||
}
|
||||
|
||||
type Authority {
|
||||
name: String!
|
||||
entry: AuthorityRecord!
|
||||
}
|
||||
|
||||
# Name record entry, created at a particular height.
|
||||
type NameRecordEntry {
|
||||
id: String! # Target record ID.
|
||||
@@ -245,6 +252,9 @@ type Query {
|
||||
# Naming API.
|
||||
#
|
||||
|
||||
# Get authorities list.
|
||||
getAuthorities(owner: String): [Authority]
|
||||
|
||||
# Lookup authority information.
|
||||
lookupAuthorities(names: [String!]): [AuthorityRecord]!
|
||||
|
||||
@@ -263,4 +273,6 @@ type Query {
|
||||
|
||||
# Query participants.
|
||||
getParticipants: [Participant]!
|
||||
getParticipantByAddress(address: String!): Participant!
|
||||
getParticipantByNitroAddress(nitroAddress: String!): Participant!
|
||||
}
|
||||
|
||||
+705
-12
@@ -87,6 +87,11 @@ type ComplexityRoot struct {
|
||||
Status func(childComplexity int) int
|
||||
}
|
||||
|
||||
Authority struct {
|
||||
Entry func(childComplexity int) int
|
||||
Name func(childComplexity int) int
|
||||
}
|
||||
|
||||
AuthorityRecord struct {
|
||||
Auction func(childComplexity int) int
|
||||
BondID func(childComplexity int) int
|
||||
@@ -155,7 +160,9 @@ type ComplexityRoot struct {
|
||||
|
||||
Participant struct {
|
||||
CosmosAddress func(childComplexity int) int
|
||||
KycID func(childComplexity int) int
|
||||
NitroAddress func(childComplexity int) int
|
||||
Role func(childComplexity int) int
|
||||
}
|
||||
|
||||
PeerInfo struct {
|
||||
@@ -165,18 +172,21 @@ type ComplexityRoot struct {
|
||||
}
|
||||
|
||||
Query struct {
|
||||
GetAccounts func(childComplexity int, addresses []string) int
|
||||
GetAuctionsByIds func(childComplexity int, ids []string) int
|
||||
GetBondsByIds func(childComplexity int, ids []string) int
|
||||
GetParticipants func(childComplexity int) int
|
||||
GetRecordsByIds func(childComplexity int, ids []string) int
|
||||
GetStatus func(childComplexity int) int
|
||||
LookupAuthorities func(childComplexity int, names []string) int
|
||||
LookupNames func(childComplexity int, names []string) int
|
||||
QueryBonds func(childComplexity int, attributes []*KeyValueInput) int
|
||||
QueryBondsByOwner func(childComplexity int, ownerAddresses []string) int
|
||||
QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool) int
|
||||
ResolveNames func(childComplexity int, names []string) int
|
||||
GetAccounts func(childComplexity int, addresses []string) int
|
||||
GetAuctionsByIds func(childComplexity int, ids []string) int
|
||||
GetAuthorities func(childComplexity int, owner *string) int
|
||||
GetBondsByIds func(childComplexity int, ids []string) int
|
||||
GetParticipantByAddress func(childComplexity int, address string) int
|
||||
GetParticipantByNitroAddress func(childComplexity int, nitroAddress string) int
|
||||
GetParticipants func(childComplexity int) int
|
||||
GetRecordsByIds func(childComplexity int, ids []string) int
|
||||
GetStatus func(childComplexity int) int
|
||||
LookupAuthorities func(childComplexity int, names []string) int
|
||||
LookupNames func(childComplexity int, names []string) int
|
||||
QueryBonds func(childComplexity int, attributes []*KeyValueInput) int
|
||||
QueryBondsByOwner func(childComplexity int, ownerAddresses []string) int
|
||||
QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool) int
|
||||
ResolveNames func(childComplexity int, names []string) int
|
||||
}
|
||||
|
||||
Record struct {
|
||||
@@ -227,11 +237,14 @@ type QueryResolver interface {
|
||||
QueryBondsByOwner(ctx context.Context, ownerAddresses []string) ([]*OwnerBonds, error)
|
||||
GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error)
|
||||
QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error)
|
||||
GetAuthorities(ctx context.Context, owner *string) ([]*Authority, error)
|
||||
LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error)
|
||||
LookupNames(ctx context.Context, names []string) ([]*NameRecord, error)
|
||||
ResolveNames(ctx context.Context, names []string) ([]*Record, error)
|
||||
GetAuctionsByIds(ctx context.Context, ids []string) ([]*Auction, error)
|
||||
GetParticipants(ctx context.Context) ([]*Participant, error)
|
||||
GetParticipantByAddress(ctx context.Context, address string) (*Participant, error)
|
||||
GetParticipantByNitroAddress(ctx context.Context, nitroAddress string) (*Participant, error)
|
||||
}
|
||||
|
||||
type executableSchema struct {
|
||||
@@ -452,6 +465,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.AuctionBid.Status(childComplexity), true
|
||||
|
||||
case "Authority.entry":
|
||||
if e.complexity.Authority.Entry == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Authority.Entry(childComplexity), true
|
||||
|
||||
case "Authority.name":
|
||||
if e.complexity.Authority.Name == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Authority.Name(childComplexity), true
|
||||
|
||||
case "AuthorityRecord.auction":
|
||||
if e.complexity.AuthorityRecord.Auction == nil {
|
||||
break
|
||||
@@ -648,6 +675,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Participant.CosmosAddress(childComplexity), true
|
||||
|
||||
case "Participant.kycId":
|
||||
if e.complexity.Participant.KycID == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Participant.KycID(childComplexity), true
|
||||
|
||||
case "Participant.nitroAddress":
|
||||
if e.complexity.Participant.NitroAddress == nil {
|
||||
break
|
||||
@@ -655,6 +689,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Participant.NitroAddress(childComplexity), true
|
||||
|
||||
case "Participant.role":
|
||||
if e.complexity.Participant.Role == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Participant.Role(childComplexity), true
|
||||
|
||||
case "PeerInfo.isOutbound":
|
||||
if e.complexity.PeerInfo.IsOutbound == nil {
|
||||
break
|
||||
@@ -700,6 +741,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Query.GetAuctionsByIds(childComplexity, args["ids"].([]string)), true
|
||||
|
||||
case "Query.getAuthorities":
|
||||
if e.complexity.Query.GetAuthorities == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Query_getAuthorities_args(context.TODO(), rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Query.GetAuthorities(childComplexity, args["owner"].(*string)), true
|
||||
|
||||
case "Query.getBondsByIds":
|
||||
if e.complexity.Query.GetBondsByIds == nil {
|
||||
break
|
||||
@@ -712,6 +765,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Query.GetBondsByIds(childComplexity, args["ids"].([]string)), true
|
||||
|
||||
case "Query.getParticipantByAddress":
|
||||
if e.complexity.Query.GetParticipantByAddress == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Query_getParticipantByAddress_args(context.TODO(), rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Query.GetParticipantByAddress(childComplexity, args["address"].(string)), true
|
||||
|
||||
case "Query.getParticipantByNitroAddress":
|
||||
if e.complexity.Query.GetParticipantByNitroAddress == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Query_getParticipantByNitroAddress_args(context.TODO(), rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Query.GetParticipantByNitroAddress(childComplexity, args["nitroAddress"].(string)), true
|
||||
|
||||
case "Query.getParticipants":
|
||||
if e.complexity.Query.GetParticipants == nil {
|
||||
break
|
||||
@@ -1097,6 +1174,21 @@ func (ec *executionContext) field_Query_getAuctionsByIds_args(ctx context.Contex
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getAuthorities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
var arg0 *string
|
||||
if tmp, ok := rawArgs["owner"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("owner"))
|
||||
arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["owner"] = arg0
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getBondsByIds_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
@@ -1112,6 +1204,36 @@ func (ec *executionContext) field_Query_getBondsByIds_args(ctx context.Context,
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getParticipantByAddress_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
var arg0 string
|
||||
if tmp, ok := rawArgs["address"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address"))
|
||||
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["address"] = arg0
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getParticipantByNitroAddress_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
var arg0 string
|
||||
if tmp, ok := rawArgs["nitroAddress"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nitroAddress"))
|
||||
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["nitroAddress"] = arg0
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Query_getRecordsByIds_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
@@ -2600,6 +2722,110 @@ func (ec *executionContext) fieldContext_AuctionBid_bidAmount(ctx context.Contex
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Authority_name(ctx context.Context, field graphql.CollectedField, obj *Authority) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Authority_name(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Name, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Authority_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Authority",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Authority_entry(ctx context.Context, field graphql.CollectedField, obj *Authority) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Authority_entry(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Entry, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*AuthorityRecord)
|
||||
fc.Result = res
|
||||
return ec.marshalNAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Authority_entry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Authority",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "ownerAddress":
|
||||
return ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field)
|
||||
case "ownerPublicKey":
|
||||
return ec.fieldContext_AuthorityRecord_ownerPublicKey(ctx, field)
|
||||
case "height":
|
||||
return ec.fieldContext_AuthorityRecord_height(ctx, field)
|
||||
case "status":
|
||||
return ec.fieldContext_AuthorityRecord_status(ctx, field)
|
||||
case "bondId":
|
||||
return ec.fieldContext_AuthorityRecord_bondId(ctx, field)
|
||||
case "expiryTime":
|
||||
return ec.fieldContext_AuthorityRecord_expiryTime(ctx, field)
|
||||
case "auction":
|
||||
return ec.fieldContext_AuthorityRecord_auction(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type AuthorityRecord", field.Name)
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _AuthorityRecord_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field)
|
||||
if err != nil {
|
||||
@@ -3924,6 +4150,94 @@ func (ec *executionContext) fieldContext_Participant_nitroAddress(ctx context.Co
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Participant_role(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Participant_role(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Role, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Participant_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Participant",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Participant_kycId(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Participant_kycId(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.KycID, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Participant_kycId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Participant",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _PeerInfo_node(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_PeerInfo_node(ctx, field)
|
||||
if err != nil {
|
||||
@@ -4508,6 +4822,64 @@ func (ec *executionContext) fieldContext_Query_queryRecords(ctx context.Context,
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_getAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Query_getAuthorities(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Query().GetAuthorities(rctx, fc.Args["owner"].(*string))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.([]*Authority)
|
||||
fc.Result = res
|
||||
return ec.marshalOAuthority2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Query_getAuthorities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Query",
|
||||
Field: field,
|
||||
IsMethod: true,
|
||||
IsResolver: true,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "name":
|
||||
return ec.fieldContext_Authority_name(ctx, field)
|
||||
case "entry":
|
||||
return ec.fieldContext_Authority_entry(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Authority", field.Name)
|
||||
},
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = ec.Recover(ctx, r)
|
||||
ec.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
if fc.Args, err = ec.field_Query_getAuthorities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_lookupAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Query_lookupAuthorities(ctx, field)
|
||||
if err != nil {
|
||||
@@ -4836,6 +5208,10 @@ func (ec *executionContext) fieldContext_Query_getParticipants(ctx context.Conte
|
||||
return ec.fieldContext_Participant_cosmosAddress(ctx, field)
|
||||
case "nitroAddress":
|
||||
return ec.fieldContext_Participant_nitroAddress(ctx, field)
|
||||
case "role":
|
||||
return ec.fieldContext_Participant_role(ctx, field)
|
||||
case "kycId":
|
||||
return ec.fieldContext_Participant_kycId(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name)
|
||||
},
|
||||
@@ -4843,6 +5219,136 @@ func (ec *executionContext) fieldContext_Query_getParticipants(ctx context.Conte
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_getParticipantByAddress(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Query_getParticipantByAddress(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Query().GetParticipantByAddress(rctx, fc.Args["address"].(string))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*Participant)
|
||||
fc.Result = res
|
||||
return ec.marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Query_getParticipantByAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Query",
|
||||
Field: field,
|
||||
IsMethod: true,
|
||||
IsResolver: true,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "cosmosAddress":
|
||||
return ec.fieldContext_Participant_cosmosAddress(ctx, field)
|
||||
case "nitroAddress":
|
||||
return ec.fieldContext_Participant_nitroAddress(ctx, field)
|
||||
case "role":
|
||||
return ec.fieldContext_Participant_role(ctx, field)
|
||||
case "kycId":
|
||||
return ec.fieldContext_Participant_kycId(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name)
|
||||
},
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = ec.Recover(ctx, r)
|
||||
ec.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
if fc.Args, err = ec.field_Query_getParticipantByAddress_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query_getParticipantByNitroAddress(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Query_getParticipantByNitroAddress(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Query().GetParticipantByNitroAddress(rctx, fc.Args["nitroAddress"].(string))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*Participant)
|
||||
fc.Result = res
|
||||
return ec.marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Query_getParticipantByNitroAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Query",
|
||||
Field: field,
|
||||
IsMethod: true,
|
||||
IsResolver: true,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "cosmosAddress":
|
||||
return ec.fieldContext_Participant_cosmosAddress(ctx, field)
|
||||
case "nitroAddress":
|
||||
return ec.fieldContext_Participant_nitroAddress(ctx, field)
|
||||
case "role":
|
||||
return ec.fieldContext_Participant_role(ctx, field)
|
||||
case "kycId":
|
||||
return ec.fieldContext_Participant_kycId(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name)
|
||||
},
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = ec.Recover(ctx, r)
|
||||
ec.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
if fc.Args, err = ec.field_Query_getParticipantByNitroAddress_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Query___type(ctx, field)
|
||||
if err != nil {
|
||||
@@ -8327,6 +8833,41 @@ func (ec *executionContext) _AuctionBid(ctx context.Context, sel ast.SelectionSe
|
||||
return out
|
||||
}
|
||||
|
||||
var authorityImplementors = []string{"Authority"}
|
||||
|
||||
func (ec *executionContext) _Authority(ctx context.Context, sel ast.SelectionSet, obj *Authority) graphql.Marshaler {
|
||||
fields := graphql.CollectFields(ec.OperationContext, sel, authorityImplementors)
|
||||
out := graphql.NewFieldSet(fields)
|
||||
var invalids uint32
|
||||
for i, field := range fields {
|
||||
switch field.Name {
|
||||
case "__typename":
|
||||
out.Values[i] = graphql.MarshalString("Authority")
|
||||
case "name":
|
||||
|
||||
out.Values[i] = ec._Authority_name(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "entry":
|
||||
|
||||
out.Values[i] = ec._Authority_entry(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
}
|
||||
}
|
||||
out.Dispatch()
|
||||
if invalids > 0 {
|
||||
return graphql.Null
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
var authorityRecordImplementors = []string{"AuthorityRecord"}
|
||||
|
||||
func (ec *executionContext) _AuthorityRecord(ctx context.Context, sel ast.SelectionSet, obj *AuthorityRecord) graphql.Marshaler {
|
||||
@@ -8798,6 +9339,20 @@ func (ec *executionContext) _Participant(ctx context.Context, sel ast.SelectionS
|
||||
|
||||
out.Values[i] = ec._Participant_nitroAddress(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "role":
|
||||
|
||||
out.Values[i] = ec._Participant_role(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "kycId":
|
||||
|
||||
out.Values[i] = ec._Participant_kycId(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
@@ -9013,6 +9568,26 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
|
||||
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
|
||||
}
|
||||
|
||||
out.Concurrently(i, func() graphql.Marshaler {
|
||||
return rrm(innerCtx)
|
||||
})
|
||||
case "getAuthorities":
|
||||
field := field
|
||||
|
||||
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
}
|
||||
}()
|
||||
res = ec._Query_getAuthorities(ctx, field)
|
||||
return res
|
||||
}
|
||||
|
||||
rrm := func(ctx context.Context) graphql.Marshaler {
|
||||
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
|
||||
}
|
||||
|
||||
out.Concurrently(i, func() graphql.Marshaler {
|
||||
return rrm(innerCtx)
|
||||
})
|
||||
@@ -9125,6 +9700,52 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
|
||||
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
|
||||
}
|
||||
|
||||
out.Concurrently(i, func() graphql.Marshaler {
|
||||
return rrm(innerCtx)
|
||||
})
|
||||
case "getParticipantByAddress":
|
||||
field := field
|
||||
|
||||
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
}
|
||||
}()
|
||||
res = ec._Query_getParticipantByAddress(ctx, field)
|
||||
if res == graphql.Null {
|
||||
atomic.AddUint32(&invalids, 1)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
rrm := func(ctx context.Context) graphql.Marshaler {
|
||||
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
|
||||
}
|
||||
|
||||
out.Concurrently(i, func() graphql.Marshaler {
|
||||
return rrm(innerCtx)
|
||||
})
|
||||
case "getParticipantByNitroAddress":
|
||||
field := field
|
||||
|
||||
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
}
|
||||
}()
|
||||
res = ec._Query_getParticipantByNitroAddress(ctx, field)
|
||||
if res == graphql.Null {
|
||||
atomic.AddUint32(&invalids, 1)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
rrm := func(ctx context.Context) graphql.Marshaler {
|
||||
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
|
||||
}
|
||||
|
||||
out.Concurrently(i, func() graphql.Marshaler {
|
||||
return rrm(innerCtx)
|
||||
})
|
||||
@@ -9813,6 +10434,16 @@ func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgitᚗvdbᚗtoᚋcerc
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._AuthorityRecord(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNBond2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
@@ -9951,6 +10582,10 @@ func (ec *executionContext) marshalNNodeInfo2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlac
|
||||
return ec._NodeInfo(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNParticipant2gitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v Participant) graphql.Marshaler {
|
||||
return ec._Participant(ctx, sel, &v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNParticipant2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v []*Participant) graphql.Marshaler {
|
||||
ret := make(graphql.Array, len(v))
|
||||
var wg sync.WaitGroup
|
||||
@@ -9989,6 +10624,16 @@ func (ec *executionContext) marshalNParticipant2ᚕᚖgitᚗvdbᚗtoᚋcercᚑio
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v *Participant) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._Participant(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNRecord2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler {
|
||||
ret := make(graphql.Array, len(v))
|
||||
var wg sync.WaitGroup
|
||||
@@ -10586,6 +11231,54 @@ func (ec *executionContext) marshalOAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋl
|
||||
return ec._AuctionBid(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOAuthority2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v []*Authority) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ret := make(graphql.Array, len(v))
|
||||
var wg sync.WaitGroup
|
||||
isLen1 := len(v) == 1
|
||||
if !isLen1 {
|
||||
wg.Add(len(v))
|
||||
}
|
||||
for i := range v {
|
||||
i := i
|
||||
fc := &graphql.FieldContext{
|
||||
Index: &i,
|
||||
Result: &v[i],
|
||||
}
|
||||
ctx := graphql.WithFieldContext(ctx, fc)
|
||||
f := func(i int) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = nil
|
||||
}
|
||||
}()
|
||||
if !isLen1 {
|
||||
defer wg.Done()
|
||||
}
|
||||
ret[i] = ec.marshalOAuthority2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx, sel, v[i])
|
||||
}
|
||||
if isLen1 {
|
||||
f(i)
|
||||
} else {
|
||||
go f(i)
|
||||
}
|
||||
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOAuthority2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v *Authority) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._Authority(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
|
||||
@@ -52,6 +52,11 @@ type AuctionBid struct {
|
||||
BidAmount *Coin `json:"bidAmount"`
|
||||
}
|
||||
|
||||
type Authority struct {
|
||||
Name string `json:"name"`
|
||||
Entry *AuthorityRecord `json:"entry"`
|
||||
}
|
||||
|
||||
type AuthorityRecord struct {
|
||||
OwnerAddress string `json:"ownerAddress"`
|
||||
OwnerPublicKey string `json:"ownerPublicKey"`
|
||||
@@ -138,6 +143,8 @@ type OwnerBonds struct {
|
||||
type Participant struct {
|
||||
CosmosAddress string `json:"cosmosAddress"`
|
||||
NitroAddress string `json:"nitroAddress"`
|
||||
Role string `json:"role"`
|
||||
KycID string `json:"kycId"`
|
||||
}
|
||||
|
||||
type PeerInfo struct {
|
||||
|
||||
+69
-19
@@ -35,6 +35,36 @@ func (r *Resolver) Query() QueryResolver {
|
||||
|
||||
type queryResolver struct{ *Resolver }
|
||||
|
||||
func (q queryResolver) GetAuthorities(ctx context.Context, owner *string) ([]*Authority, error) {
|
||||
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
||||
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
||||
|
||||
authoritiesReq := ®istrytypes.QueryAuthoritiesRequest{}
|
||||
if owner != nil {
|
||||
authoritiesReq.Owner = *owner
|
||||
}
|
||||
|
||||
authoritiesResp, err := nsQueryClient.Authorities(ctx, authoritiesReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
authorities := make([]*Authority, len(authoritiesResp.GetAuthorities()))
|
||||
for i, a := range authoritiesResp.Authorities {
|
||||
entry, err := getAuthorityRecord(*a.Entry, auctionQueryClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
authorities[i] = &Authority{
|
||||
Name: a.Name,
|
||||
Entry: entry,
|
||||
}
|
||||
}
|
||||
|
||||
return authorities, nil
|
||||
}
|
||||
|
||||
func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) {
|
||||
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
||||
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
||||
@@ -52,29 +82,11 @@ func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([
|
||||
}
|
||||
|
||||
nameAuthority := res.GetNameAuthority()
|
||||
gqlNameAuthorityRecord, err := GetGQLNameAuthorityRecord(&nameAuthority)
|
||||
gqlNameAuthorityRecord, err := getAuthorityRecord(nameAuthority, auctionQueryClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if nameAuthority.AuctionId != "" {
|
||||
auctionResp, err := auctionQueryClient.GetAuction(context.Background(), &auctiontypes.QueryGetAuctionRequest{Id: nameAuthority.GetAuctionId()})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bidsResp, err := auctionQueryClient.GetBids(context.Background(), &auctiontypes.QueryGetBidsRequest{AuctionId: nameAuthority.GetAuctionId()})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gqlAuctionRecord, err := GetGQLAuction(auctionResp.GetAuction(), bidsResp.GetBids())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gqlNameAuthorityRecord.Auction = gqlAuctionRecord
|
||||
}
|
||||
|
||||
gqlResponse = append(gqlResponse, gqlNameAuthorityRecord)
|
||||
}
|
||||
|
||||
@@ -373,8 +385,46 @@ func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, err
|
||||
participants[i] = &Participant{
|
||||
CosmosAddress: p.CosmosAddress,
|
||||
NitroAddress: p.NitroAddress,
|
||||
Role: p.Role,
|
||||
KycID: p.KycId,
|
||||
}
|
||||
}
|
||||
|
||||
return participants, nil
|
||||
}
|
||||
|
||||
func (q queryResolver) GetParticipantByAddress(ctx context.Context, address string) (*Participant, error) {
|
||||
onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx)
|
||||
participantResp, err := onboardingQueryClient.GetParticipantByAddress(ctx, &onboardingTypes.QueryGetParticipantByAddressRequest{Address: address})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p := participantResp.Participant
|
||||
participant := &Participant{
|
||||
CosmosAddress: p.CosmosAddress,
|
||||
NitroAddress: p.NitroAddress,
|
||||
Role: p.Role,
|
||||
KycID: p.KycId,
|
||||
}
|
||||
|
||||
return participant, nil
|
||||
}
|
||||
|
||||
func (q queryResolver) GetParticipantByNitroAddress(ctx context.Context, nitroAddress string) (*Participant, error) {
|
||||
onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx)
|
||||
participantResp, err := onboardingQueryClient.GetParticipantByNitroAddress(ctx, &onboardingTypes.QueryGetParticipantByNitroAddressRequest{NitroAddress: nitroAddress})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p := participantResp.Participant
|
||||
participant := &Participant{
|
||||
CosmosAddress: p.CosmosAddress,
|
||||
NitroAddress: p.NitroAddress,
|
||||
Role: p.Role,
|
||||
KycID: p.KycId,
|
||||
}
|
||||
|
||||
return participant, nil
|
||||
}
|
||||
|
||||
+27
@@ -303,3 +303,30 @@ func toRPCAttributes(attrs []*KeyValueInput) []*registrytypes.QueryRecordsReques
|
||||
|
||||
return kvPairs
|
||||
}
|
||||
|
||||
func getAuthorityRecord(nameAuthority registrytypes.NameAuthority, auctionQueryClient auctiontypes.QueryClient) (*AuthorityRecord, error) {
|
||||
gqlNameAuthorityRecord, err := GetGQLNameAuthorityRecord(&nameAuthority)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if nameAuthority.AuctionId != "" {
|
||||
auctionResp, err := auctionQueryClient.GetAuction(context.Background(), &auctiontypes.QueryGetAuctionRequest{Id: nameAuthority.GetAuctionId()})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bidsResp, err := auctionQueryClient.GetBids(context.Background(), &auctiontypes.QueryGetBidsRequest{AuctionId: nameAuthority.GetAuctionId()})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gqlAuctionRecord, err := GetGQLAuction(auctionResp.GetAuction(), bidsResp.GetBids())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gqlNameAuthorityRecord.Auction = gqlAuctionRecord
|
||||
}
|
||||
|
||||
return gqlNameAuthorityRecord, nil
|
||||
}
|
||||
|
||||
@@ -10,4 +10,8 @@ message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconicd/x/bond"
|
||||
};
|
||||
|
||||
// authority defines the custom module authority. If not set, defaults to the
|
||||
// governance module.
|
||||
string authority = 2;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import "cosmos/msg/v1/msg.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||
|
||||
@@ -32,6 +34,10 @@ service Msg {
|
||||
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
|
||||
option (google.api.http).post = "/cerc/bond/v1/cancel_bond";
|
||||
};
|
||||
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||
}
|
||||
|
||||
// MsgCreateBond defines a SDK message for creating a new bond.
|
||||
@@ -91,3 +97,21 @@ message MsgCancelBond {
|
||||
|
||||
// MsgCancelBondResponse defines the Msg/CancelBond response type.
|
||||
message MsgCancelBondResponse {}
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
message MsgUpdateParams {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
// authority is the address that controls the module (defaults to x/gov unless
|
||||
// overwritten).
|
||||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
|
||||
|
||||
// params defines the x/bond parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params params = 2 [ (gogoproto.nullable) = false ];
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
message MsgUpdateParamsResponse {};
|
||||
|
||||
@@ -16,14 +16,24 @@ message Params {
|
||||
// Participant defines the data that will be stored for each enrolled
|
||||
// participant
|
||||
message Participant {
|
||||
// participant's cosmos (laconic) address
|
||||
string cosmos_address = 1
|
||||
[ (gogoproto.moretags) =
|
||||
"json:\"cosmos_address\" yaml:\"cosmos_address\"" ];
|
||||
|
||||
// participant's Nitro address
|
||||
string nitro_address = 2
|
||||
[ (gogoproto.moretags) =
|
||||
"json:\"nitro_address\" yaml:\"nitro_address\"" ];
|
||||
|
||||
// participant's role (participant | validator)
|
||||
string role = 3 [ (gogoproto.moretags) = "json:\"role\" yaml:\"role\"" ];
|
||||
|
||||
// participant's KYC receipt ID
|
||||
string kyc_id = 4
|
||||
[ (gogoproto.moretags) = "json:\"kyc_id\" yaml:\"kyc_id\"" ];
|
||||
}
|
||||
|
||||
// EthPayload defines the payload that is signed by the ethereum private key
|
||||
message EthPayload {
|
||||
string address = 1
|
||||
|
||||
@@ -16,6 +16,19 @@ service Query {
|
||||
returns (QueryParticipantsResponse) {
|
||||
option (google.api.http).get = "/cerc/onboarding/v1/participants";
|
||||
}
|
||||
|
||||
// GetParticipantByAddress queries a participant by cosmos (laconic) address
|
||||
rpc GetParticipantByAddress(QueryGetParticipantByAddressRequest)
|
||||
returns (QueryGetParticipantByAddressResponse) {
|
||||
option (google.api.http).get = "/cerc/onboarding/v1/participants/{address}";
|
||||
}
|
||||
|
||||
// GetParticipantByNitroAddress queries a participant by nitro address
|
||||
rpc GetParticipantByNitroAddress(QueryGetParticipantByNitroAddressRequest)
|
||||
returns (QueryGetParticipantByNitroAddressResponse) {
|
||||
option (google.api.http).get =
|
||||
"/cerc/onboarding/v1/participants/{nitro_address}";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParticipantsRequest queries participants
|
||||
@@ -24,7 +37,7 @@ message QueryParticipantsRequest {
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryParticipantsResponse is response type for get the participants
|
||||
// QueryParticipantsResponse is response type for querying the participants
|
||||
message QueryParticipantsResponse {
|
||||
repeated Participant participants = 1
|
||||
[ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ];
|
||||
@@ -32,3 +45,31 @@ message QueryParticipantsResponse {
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryGetParticipantByAddressRequest queries participant by the laconic
|
||||
// address
|
||||
message QueryGetParticipantByAddressRequest {
|
||||
// Laconic address
|
||||
string address = 1;
|
||||
}
|
||||
|
||||
// QueryGetParticipantByAddressResponse is response type for querying
|
||||
// participant by the laconic address
|
||||
message QueryGetParticipantByAddressResponse {
|
||||
// Participant details
|
||||
Participant participant = 1;
|
||||
}
|
||||
|
||||
// QueryGetParticipantByNitroAddressRequest queries participant by the nitro
|
||||
// address
|
||||
message QueryGetParticipantByNitroAddressRequest {
|
||||
// Nitro address
|
||||
string nitro_address = 1;
|
||||
}
|
||||
|
||||
// QueryGetParticipantByNitroAddressResponse is response type for querying
|
||||
// participant by the nitro address
|
||||
message QueryGetParticipantByNitroAddressResponse {
|
||||
// Participant details
|
||||
Participant participant = 1;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import "cosmos/msg/v1/msg.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
@@ -18,6 +19,10 @@ service Msg {
|
||||
returns (MsgOnboardParticipantResponse) {
|
||||
option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant";
|
||||
};
|
||||
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||
}
|
||||
|
||||
// MsgOnboardParticipant defines a SDK message for enrolling a new validator.
|
||||
@@ -28,8 +33,28 @@ message MsgOnboardParticipant {
|
||||
string participant = 1;
|
||||
EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ];
|
||||
string eth_signature = 3;
|
||||
string role = 4;
|
||||
string kyc_id = 5;
|
||||
}
|
||||
|
||||
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
|
||||
// type.
|
||||
message MsgOnboardParticipantResponse {}
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
message MsgUpdateParams {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
// authority is the address that controls the module (defaults to x/gov unless
|
||||
// overwritten).
|
||||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
|
||||
|
||||
// params defines the x/bond parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params params = 2 [ (gogoproto.nullable) = false ];
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
message MsgUpdateParamsResponse {};
|
||||
|
||||
+40
-9
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
KEY="alice"
|
||||
CHAINID="laconic_9000-1"
|
||||
MONIKER="localtestnet"
|
||||
KEYRING="test"
|
||||
LOGLEVEL="${LOGLEVEL:-info}"
|
||||
CHAINID=${CHAINID:-"laconic_9000-1"}
|
||||
MONIKER=${MONIKER:-"localtestnet"}
|
||||
KEYRING=${KEYRING:-"test"}
|
||||
DENOM=${DENOM:-"alnt"}
|
||||
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"}
|
||||
LOGLEVEL=${LOGLEVEL:-"info"}
|
||||
|
||||
input_genesis_file=${GENESIS_FILE}
|
||||
|
||||
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
# validate dependencies are installed
|
||||
@@ -27,7 +31,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
laconicd keys add $KEY --keyring-backend $KEYRING
|
||||
|
||||
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||
laconicd init $MONIKER --chain-id $CHAINID --default-denom photon
|
||||
laconicd init $MONIKER --chain-id $CHAINID --default-denom $DENOM
|
||||
|
||||
if [[ -f ${input_genesis_file} ]]; then
|
||||
# Use provided genesis config
|
||||
cp $input_genesis_file $HOME/.laconicd/config/genesis.json
|
||||
fi
|
||||
|
||||
update_genesis() {
|
||||
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
|
||||
@@ -58,6 +67,26 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
update_genesis '.app_state["onboarding"]["params"]["onboarding_enabled"]=true'
|
||||
fi
|
||||
|
||||
if [[ "$AUTHORITY_AUCTION_ENABLED" == "true" ]]; then
|
||||
echo "Enabling authority auctions."
|
||||
update_genesis '.app_state["registry"]["params"]["authority_auction_enabled"]=true'
|
||||
fi
|
||||
|
||||
if [[ -n $AUTHORITY_AUCTION_COMMITS_DURATION ]]; then
|
||||
echo "Setting authority_auction_commits_duration to $AUTHORITY_AUCTION_COMMITS_DURATION seconds."
|
||||
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_commits_duration\"]=\"${AUTHORITY_AUCTION_COMMITS_DURATION}s\""
|
||||
fi
|
||||
|
||||
if [[ -n $AUTHORITY_AUCTION_REVEALS_DURATION ]]; then
|
||||
echo "Setting authority_auction_reveals_duration to $AUTHORITY_AUCTION_REVEALS_DURATION seconds."
|
||||
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_reveals_duration\"]=\"${AUTHORITY_AUCTION_REVEALS_DURATION}s\""
|
||||
fi
|
||||
|
||||
if [[ -n $AUTHORITY_GRACE_PERIOD ]]; then
|
||||
echo "Setting authority_grace_period to $AUTHORITY_GRACE_PERIOD seconds."
|
||||
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_grace_period\"]=\"${AUTHORITY_GRACE_PERIOD}s\""
|
||||
fi
|
||||
|
||||
# increase block time (?)
|
||||
update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"'
|
||||
|
||||
@@ -70,7 +99,7 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
else
|
||||
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||
fi
|
||||
|
||||
|
||||
# Run this to allow requests from any origin
|
||||
sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $HOME/.laconicd/config/config.toml
|
||||
|
||||
@@ -86,10 +115,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
fi
|
||||
|
||||
# Allocate genesis accounts (cosmos formatted addresses)
|
||||
laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING
|
||||
# 10^30 alnt | 10^12 lnt
|
||||
laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING
|
||||
|
||||
# Sign genesis transaction
|
||||
laconicd genesis gentx $KEY 1000000000000000000000photon --keyring-backend $KEYRING --chain-id $CHAINID
|
||||
# 10^15 alnt
|
||||
laconicd genesis gentx $KEY $STAKING_AMOUNT$DENOM --keyring-backend $KEYRING --chain-id $CHAINID
|
||||
|
||||
# Collect genesis tx
|
||||
laconicd genesis collect-gentxs
|
||||
@@ -104,7 +135,7 @@ fi
|
||||
laconicd start \
|
||||
--pruning=nothing \
|
||||
--log_level $LOGLEVEL \
|
||||
--minimum-gas-prices=0.0001photon \
|
||||
--minimum-gas-prices=1$DENOM \
|
||||
--api.enable \
|
||||
--rpc.laddr="tcp://0.0.0.0:26657" \
|
||||
--gql-server --gql-playground
|
||||
|
||||
@@ -324,7 +324,7 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au
|
||||
}
|
||||
|
||||
// Create funded account(s)
|
||||
accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(100))
|
||||
accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(1000000))
|
||||
|
||||
params, err := k.GetParams(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -101,7 +101,7 @@ func (tf *TestFixture) Setup() error {
|
||||
|
||||
auctionKeeper := auctionkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[auctionTypes.StoreKey]), accountKeeper, bankKeeper)
|
||||
|
||||
bondKeeper := bondkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[bondTypes.StoreKey]), accountKeeper, bankKeeper)
|
||||
bondKeeper := bondkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[bondTypes.StoreKey]), accountKeeper, bankKeeper, authority.String())
|
||||
|
||||
registryKeeper := registrykeeper.NewKeeper(
|
||||
cdc,
|
||||
|
||||
@@ -49,7 +49,7 @@ func (kts *KeeperTestSuite) createBond() (*bondTypes.Bond, error) {
|
||||
ctx := kts.SdkCtx
|
||||
|
||||
// Create a funded account
|
||||
kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(100000000000))
|
||||
kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(1000000000000))
|
||||
|
||||
bond, err := kts.BondKeeper.CreateBond(ctx, kts.accounts[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000000))))
|
||||
if err != nil {
|
||||
|
||||
+7
-6
@@ -13,9 +13,10 @@ import (
|
||||
var (
|
||||
DefaultCommitsDuration = 5 * time.Minute
|
||||
DefaultRevealsDuration = 5 * time.Minute
|
||||
DefaultCommitFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom}
|
||||
DefaultRevealFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom}
|
||||
DefaultMinimumBid = sdk.Coin{Amount: sdkmath.NewInt(1000), Denom: sdk.DefaultBondDenom}
|
||||
|
||||
DefaultCommitFee = sdkmath.NewInt(1000) // 10^3 alnt
|
||||
DefaultRevealFee = sdkmath.NewInt(1000) // 10^3 alnt
|
||||
DefaultMinimumBid = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
)
|
||||
|
||||
func NewParams(commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params {
|
||||
@@ -33,9 +34,9 @@ func DefaultParams() Params {
|
||||
return Params{
|
||||
CommitsDuration: DefaultCommitsDuration,
|
||||
RevealsDuration: DefaultRevealsDuration,
|
||||
CommitFee: DefaultCommitFee,
|
||||
RevealFee: DefaultRevealFee,
|
||||
MinimumBid: DefaultMinimumBid,
|
||||
CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee),
|
||||
RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee),
|
||||
MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ type Keeper struct {
|
||||
// Codecs
|
||||
cdc codec.BinaryCodec
|
||||
|
||||
authority string
|
||||
|
||||
// External keepers
|
||||
accountKeeper auth.AccountKeeper
|
||||
bankKeeper bank.Keeper
|
||||
@@ -64,10 +66,17 @@ func NewKeeper(
|
||||
storeService store.KVStoreService,
|
||||
accountKeeper auth.AccountKeeper,
|
||||
bankKeeper bank.Keeper,
|
||||
authority string,
|
||||
) *Keeper {
|
||||
// ensure that authority is a valid AccAddress
|
||||
if _, err := accountKeeper.AddressCodec().StringToBytes(authority); err != nil {
|
||||
panic("authority is not a valid acc address")
|
||||
}
|
||||
|
||||
sb := collections.NewSchemaBuilder(storeService)
|
||||
k := Keeper{
|
||||
cdc: cdc,
|
||||
authority: authority,
|
||||
accountKeeper: accountKeeper,
|
||||
bankKeeper: bankKeeper,
|
||||
Params: collections.NewItem(sb, bondtypes.ParamsPrefix, "params", codec.CollValue[bondtypes.Params](cdc)),
|
||||
@@ -355,6 +364,11 @@ func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre
|
||||
return &bond, nil
|
||||
}
|
||||
|
||||
// GetAuthority returns the x/bond module's authority.
|
||||
func (k Keeper) GetAuthority() string {
|
||||
return k.authority
|
||||
}
|
||||
|
||||
// GetParams gets the bond module's parameters.
|
||||
func (k Keeper) GetParams(ctx sdk.Context) (*bondtypes.Params, error) {
|
||||
params, err := k.Params.Get(ctx)
|
||||
@@ -365,6 +379,11 @@ func (k Keeper) GetParams(ctx sdk.Context) (*bondtypes.Params, error) {
|
||||
return ¶ms, nil
|
||||
}
|
||||
|
||||
// SetParams sets the x/bond module parameters.
|
||||
func (k Keeper) SetParams(ctx sdk.Context, params bondtypes.Params) error {
|
||||
return k.Params.Set(ctx, params)
|
||||
}
|
||||
|
||||
func (k Keeper) getMaxBondAmount(ctx sdk.Context) (sdk.Coins, error) {
|
||||
params, err := k.GetParams(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -3,7 +3,9 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"git.vdb.to/cerc-io/laconicd/utils"
|
||||
"git.vdb.to/cerc-io/laconicd/x/bond"
|
||||
@@ -168,3 +170,22 @@ func (ms msgServer) CancelBond(c context.Context, msg *bond.MsgCancelBond) (*bon
|
||||
|
||||
return &bond.MsgCancelBondResponse{}, nil
|
||||
}
|
||||
|
||||
// UpdateParams defines a method to perform updation of module params.
|
||||
func (ms msgServer) UpdateParams(c context.Context, msg *bond.MsgUpdateParams) (*bond.MsgUpdateParamsResponse, error) {
|
||||
if ms.k.authority != msg.Authority {
|
||||
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
||||
}
|
||||
|
||||
if err := msg.Params.Validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
if err := ms.k.SetParams(ctx, msg.Params); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &bond.MsgUpdateParamsResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -88,6 +88,10 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
{ProtoField: "id"},
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/bond/module/v1"
|
||||
"git.vdb.to/cerc-io/laconicd/x/bond"
|
||||
@@ -33,6 +35,7 @@ func init() {
|
||||
type ModuleInputs struct {
|
||||
depinject.In
|
||||
|
||||
Config *modulev1.Module
|
||||
Cdc codec.Codec
|
||||
StoreService store.KVStoreService
|
||||
|
||||
@@ -48,7 +51,13 @@ type ModuleOutputs struct {
|
||||
}
|
||||
|
||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, in.BankKeeper)
|
||||
// default to governance authority if not provided
|
||||
authority := authtypes.NewModuleAddress(govtypes.ModuleName)
|
||||
if in.Config.Authority != "" {
|
||||
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
|
||||
}
|
||||
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, in.BankKeeper, authority.String())
|
||||
m := NewAppModule(in.Cdc, k)
|
||||
|
||||
return ModuleOutputs{Module: m, Keeper: k}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// DefaultMaxBondAmountTokens are the default parameter values.
|
||||
var DefaultMaxBondAmountTokens = sdkmath.NewInt(100000000000)
|
||||
var DefaultMaxBondAmountTokens = sdkmath.NewInt(1000000000000) // 10^12 alnt
|
||||
|
||||
func NewParams(maxBondAmount sdk.Coin) Params {
|
||||
return Params{MaxBondAmount: maxBondAmount}
|
||||
|
||||
+434
-36
@@ -6,6 +6,7 @@ package bond
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
_ "github.com/cosmos/cosmos-proto"
|
||||
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
@@ -416,6 +417,102 @@ func (m *MsgCancelBondResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgCancelBondResponse proto.InternalMessageInfo
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
type MsgUpdateParams struct {
|
||||
// authority is the address that controls the module (defaults to x/gov unless
|
||||
// overwritten).
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the x/bond parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_efb1a132c2c5bd62, []int{8}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_efb1a132c2c5bd62, []int{9}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgCreateBond)(nil), "cerc.bond.v1.MsgCreateBond")
|
||||
proto.RegisterType((*MsgCreateBondResponse)(nil), "cerc.bond.v1.MsgCreateBondResponse")
|
||||
@@ -425,47 +522,56 @@ func init() {
|
||||
proto.RegisterType((*MsgWithdrawBondResponse)(nil), "cerc.bond.v1.MsgWithdrawBondResponse")
|
||||
proto.RegisterType((*MsgCancelBond)(nil), "cerc.bond.v1.MsgCancelBond")
|
||||
proto.RegisterType((*MsgCancelBondResponse)(nil), "cerc.bond.v1.MsgCancelBondResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "cerc.bond.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cerc.bond.v1.MsgUpdateParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cerc/bond/v1/tx.proto", fileDescriptor_efb1a132c2c5bd62) }
|
||||
|
||||
var fileDescriptor_efb1a132c2c5bd62 = []byte{
|
||||
// 548 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0x41, 0x6f, 0xd3, 0x30,
|
||||
0x18, 0x6d, 0x5a, 0x6d, 0x12, 0xde, 0x00, 0xa9, 0x62, 0x6c, 0x6d, 0x59, 0x5a, 0x32, 0x21, 0xaa,
|
||||
0x49, 0xb3, 0xd5, 0x71, 0x9b, 0x38, 0x75, 0x5c, 0x7b, 0xe9, 0x05, 0x89, 0x0b, 0x72, 0x12, 0xe3,
|
||||
0x19, 0x1a, 0x7f, 0x25, 0x36, 0xdd, 0x7a, 0x41, 0x68, 0xbf, 0x00, 0x89, 0x7f, 0xc1, 0x69, 0x07,
|
||||
0x7e, 0x02, 0x42, 0x3b, 0x4e, 0xe2, 0xc2, 0x69, 0x4c, 0x2d, 0xd2, 0xee, 0xfc, 0x02, 0x14, 0x27,
|
||||
0x4d, 0x93, 0x35, 0x9b, 0xc4, 0x0d, 0x4e, 0x8d, 0xfd, 0x9e, 0xdf, 0xfb, 0xde, 0xe7, 0xcf, 0x45,
|
||||
0x6b, 0x1e, 0x0b, 0x3d, 0xe2, 0x82, 0xf4, 0xc9, 0xa8, 0x43, 0xf4, 0x11, 0x1e, 0x86, 0xa0, 0xa1,
|
||||
0xba, 0x1a, 0x6d, 0xe3, 0x68, 0x1b, 0x8f, 0x3a, 0xf5, 0x75, 0x0f, 0x54, 0x00, 0x8a, 0x04, 0x8a,
|
||||
0x47, 0xac, 0x40, 0xf1, 0x98, 0x56, 0xbf, 0xc7, 0x81, 0x83, 0xf9, 0x24, 0xd1, 0x57, 0xb2, 0xfb,
|
||||
0x80, 0x03, 0xf0, 0x01, 0x23, 0x74, 0x28, 0x08, 0x95, 0x12, 0x34, 0xd5, 0x02, 0xa4, 0x4a, 0x50,
|
||||
0x3b, 0x11, 0x73, 0xa9, 0x62, 0x64, 0xd4, 0x71, 0x99, 0xa6, 0x1d, 0xe2, 0x81, 0x90, 0x31, 0xee,
|
||||
0x7c, 0xb1, 0xd0, 0xed, 0x9e, 0xe2, 0xfb, 0x21, 0xa3, 0x9a, 0x75, 0x41, 0xfa, 0xd5, 0xfb, 0x68,
|
||||
0x59, 0x09, 0x2e, 0x59, 0xb8, 0x61, 0xb5, 0xac, 0xf6, 0xad, 0x7e, 0xb2, 0xaa, 0xbe, 0x47, 0x4b,
|
||||
0xd1, 0x39, 0xb5, 0x51, 0x6e, 0x55, 0xda, 0x2b, 0xbb, 0x35, 0x1c, 0x2b, 0xe3, 0x48, 0x19, 0x27,
|
||||
0xca, 0x78, 0x1f, 0x84, 0xec, 0xf6, 0x4e, 0xcf, 0x9b, 0xa5, 0xdf, 0xe7, 0xcd, 0xda, 0x6b, 0x05,
|
||||
0x72, 0xcf, 0x31, 0xa7, 0x9c, 0xd6, 0x98, 0x06, 0x83, 0xd9, 0xe2, 0xf3, 0xcf, 0x66, 0x9b, 0x0b,
|
||||
0x7d, 0xf0, 0xce, 0xc5, 0x1e, 0x04, 0x24, 0xa9, 0x31, 0xfe, 0xd9, 0x51, 0xfe, 0x1b, 0xa2, 0xc7,
|
||||
0x43, 0xa6, 0x8c, 0x9a, 0xea, 0xc7, 0xb6, 0x7b, 0x2b, 0xc7, 0x97, 0x27, 0xdb, 0x49, 0x31, 0xce,
|
||||
0x63, 0xb4, 0x96, 0xab, 0xba, 0xcf, 0xd4, 0x10, 0xa4, 0x62, 0xd5, 0x3b, 0xa8, 0x2c, 0xfc, 0xa4,
|
||||
0xf2, 0xb2, 0xf0, 0x9d, 0xaf, 0x71, 0xbe, 0x3e, 0x7b, 0x25, 0x06, 0x03, 0x93, 0xef, 0x0a, 0x23,
|
||||
0x93, 0xb7, 0x5c, 0x9c, 0xb7, 0xf2, 0x0f, 0xe4, 0x5d, 0x37, 0x79, 0xe7, 0x29, 0x66, 0x79, 0x9d,
|
||||
0x6f, 0x16, 0xba, 0xdb, 0x53, 0xfc, 0xb9, 0xd0, 0x07, 0x7e, 0x48, 0x0f, 0xff, 0xdf, 0x84, 0x35,
|
||||
0xb4, 0x7e, 0x25, 0x47, 0x9a, 0xf1, 0x59, 0x3c, 0xa2, 0x54, 0x7a, 0xec, 0xaf, 0xae, 0xb0, 0xa8,
|
||||
0x85, 0x73, 0x95, 0x99, 0xfc, 0xee, 0x45, 0x05, 0x55, 0x7a, 0x8a, 0x57, 0xdf, 0x22, 0x94, 0x79,
|
||||
0x06, 0x0d, 0x9c, 0x7d, 0x94, 0x38, 0x37, 0x6d, 0xf5, 0xad, 0x1b, 0xc0, 0xb4, 0xec, 0x87, 0xc7,
|
||||
0xdf, 0x7f, 0x7d, 0x2a, 0x37, 0x9c, 0x1a, 0xc9, 0xbd, 0x7a, 0xcf, 0x30, 0x5f, 0x46, 0xcb, 0xc8,
|
||||
0x32, 0x33, 0x99, 0x8b, 0x96, 0x73, 0xb0, 0xc0, 0xb2, 0x60, 0x1a, 0xae, 0xb1, 0x0c, 0x0d, 0x33,
|
||||
0xb6, 0x1c, 0xa3, 0xd5, 0xdc, 0xb0, 0x6c, 0x2e, 0xe8, 0x66, 0xe1, 0xfa, 0xa3, 0x1b, 0xe1, 0xd4,
|
||||
0x78, 0xcb, 0x18, 0x6f, 0x3a, 0x8d, 0xbc, 0xf1, 0x61, 0xc2, 0x4d, 0xd3, 0x66, 0x2e, 0xb1, 0xa0,
|
||||
0xc1, 0x29, 0x58, 0xd4, 0xe0, 0x85, 0x8b, 0xbb, 0xb6, 0xc1, 0x86, 0x69, 0x2c, 0xeb, 0x4b, 0x1f,
|
||||
0x2e, 0x4f, 0xb6, 0xad, 0xee, 0xd3, 0xd3, 0x89, 0x6d, 0x9d, 0x4d, 0x6c, 0xeb, 0x62, 0x62, 0x5b,
|
||||
0x1f, 0xa7, 0x76, 0xe9, 0x6c, 0x6a, 0x97, 0x7e, 0x4c, 0xed, 0xd2, 0x0b, 0x87, 0x0b, 0x8d, 0x47,
|
||||
0xbe, 0x8b, 0x35, 0x18, 0x95, 0x1d, 0x01, 0x64, 0x40, 0x3d, 0x90, 0xc2, 0xf3, 0xc9, 0x91, 0xd1,
|
||||
0x74, 0x97, 0xcd, 0x5f, 0xe5, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x49, 0xe0, 0xe1,
|
||||
0xbe, 0x05, 0x00, 0x00,
|
||||
// 659 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6b, 0x13, 0x41,
|
||||
0x18, 0xce, 0xa6, 0x1f, 0xd0, 0x69, 0xad, 0xb0, 0xb4, 0xa6, 0x49, 0xed, 0xb6, 0x6e, 0x11, 0x4b,
|
||||
0xa1, 0x3b, 0x24, 0x82, 0x87, 0xe2, 0xc5, 0xd4, 0x6b, 0x40, 0xa2, 0x22, 0x78, 0x29, 0x93, 0xdd,
|
||||
0x71, 0x3a, 0x9a, 0x9d, 0x59, 0x77, 0xa6, 0x69, 0x73, 0x11, 0xe9, 0x5d, 0x10, 0xfc, 0x17, 0x9e,
|
||||
0x7a, 0x28, 0xfe, 0x02, 0x91, 0x1e, 0x8b, 0x5e, 0x3c, 0x55, 0x69, 0x85, 0xde, 0xfd, 0x05, 0xb2,
|
||||
0x33, 0xd3, 0xcd, 0x6e, 0xb3, 0x2d, 0x78, 0xd3, 0x53, 0x76, 0xe6, 0x79, 0xf3, 0x3e, 0x1f, 0xfb,
|
||||
0xce, 0x0e, 0x98, 0xf5, 0x71, 0xec, 0xc3, 0x0e, 0x67, 0x01, 0xec, 0xd5, 0xa1, 0xdc, 0xf5, 0xa2,
|
||||
0x98, 0x4b, 0x6e, 0x4f, 0x25, 0xdb, 0x5e, 0xb2, 0xed, 0xf5, 0xea, 0xb5, 0x8a, 0xcf, 0x45, 0xc8,
|
||||
0x05, 0x0c, 0x05, 0x49, 0xaa, 0x42, 0x41, 0x74, 0x59, 0x6d, 0x86, 0x70, 0xc2, 0xd5, 0x23, 0x4c,
|
||||
0x9e, 0xcc, 0xee, 0x4d, 0xc2, 0x39, 0xe9, 0x62, 0x88, 0x22, 0x0a, 0x11, 0x63, 0x5c, 0x22, 0x49,
|
||||
0x39, 0x13, 0x06, 0x75, 0x4c, 0xb3, 0x0e, 0x12, 0x18, 0xf6, 0xea, 0x1d, 0x2c, 0x51, 0x1d, 0xfa,
|
||||
0x9c, 0x32, 0x83, 0x57, 0x35, 0xbe, 0xa9, 0xdb, 0xea, 0x85, 0x81, 0x2a, 0x39, 0xb1, 0x4a, 0x9d,
|
||||
0x02, 0xdc, 0x03, 0x0b, 0x5c, 0x6b, 0x09, 0xb2, 0x11, 0x63, 0x24, 0x71, 0x93, 0xb3, 0xc0, 0xbe,
|
||||
0x01, 0xc6, 0x05, 0x25, 0x0c, 0xc7, 0x73, 0xd6, 0x92, 0xb5, 0x32, 0xd1, 0x36, 0x2b, 0xfb, 0x0d,
|
||||
0x18, 0x4b, 0xb8, 0xc4, 0x5c, 0x79, 0x69, 0x64, 0x65, 0xb2, 0x51, 0xf5, 0x0c, 0x41, 0xa2, 0xc6,
|
||||
0x33, 0x6a, 0xbc, 0x0d, 0x4e, 0x59, 0xb3, 0x75, 0x78, 0xbc, 0x58, 0xfa, 0x7d, 0xbc, 0x58, 0x7d,
|
||||
0x29, 0x38, 0x5b, 0x77, 0xd5, 0xbf, 0xdc, 0xa5, 0x3e, 0x0a, 0xbb, 0xe7, 0x8b, 0x8f, 0x3f, 0x16,
|
||||
0x57, 0x08, 0x95, 0x5b, 0xdb, 0x1d, 0xcf, 0xe7, 0xa1, 0x91, 0x6a, 0x7e, 0xd6, 0x44, 0xf0, 0x0a,
|
||||
0xca, 0x7e, 0x84, 0x85, 0xea, 0x26, 0xda, 0x9a, 0x76, 0x7d, 0x72, 0xef, 0x6c, 0x7f, 0xd5, 0x88,
|
||||
0x71, 0xef, 0x80, 0xd9, 0x9c, 0xea, 0x36, 0x16, 0x11, 0x67, 0x02, 0xdb, 0xd3, 0xa0, 0x4c, 0x03,
|
||||
0xa3, 0xbc, 0x4c, 0x03, 0xf7, 0xb3, 0xf6, 0xd7, 0xc6, 0x2f, 0x68, 0xb7, 0xab, 0xfc, 0x5d, 0xa8,
|
||||
0xc8, 0xf8, 0x2d, 0x17, 0xfb, 0x1d, 0xf9, 0x07, 0xfc, 0x56, 0x94, 0xdf, 0x81, 0x8b, 0x73, 0xbf,
|
||||
0xee, 0x17, 0x0b, 0x5c, 0x6f, 0x09, 0xf2, 0x8c, 0xca, 0xad, 0x20, 0x46, 0x3b, 0xff, 0xaf, 0xc3,
|
||||
0x2a, 0xa8, 0x5c, 0xf0, 0x91, 0x7a, 0x7c, 0xa8, 0x47, 0x14, 0x31, 0x1f, 0xff, 0xd5, 0x2b, 0x2c,
|
||||
0x8a, 0x70, 0xd0, 0x25, 0x6d, 0xff, 0x4e, 0x47, 0xf8, 0x34, 0x0a, 0x90, 0xc4, 0x8f, 0x50, 0x8c,
|
||||
0x42, 0x61, 0xdf, 0x03, 0x13, 0x68, 0x5b, 0x6e, 0xf1, 0x98, 0xca, 0xbe, 0x26, 0x6a, 0xce, 0x7d,
|
||||
0x3d, 0x58, 0x9b, 0x31, 0x09, 0x3d, 0x08, 0x82, 0x18, 0x0b, 0xf1, 0x58, 0xc6, 0x94, 0x91, 0xf6,
|
||||
0xa0, 0xd4, 0x6e, 0x80, 0xf1, 0x48, 0x75, 0x50, 0x4a, 0x26, 0x1b, 0x33, 0x5e, 0xf6, 0x73, 0xe0,
|
||||
0xe9, 0xee, 0xcd, 0xd1, 0x24, 0xce, 0xb6, 0xa9, 0x5c, 0x9f, 0x4e, 0x54, 0x0e, 0x7a, 0x98, 0x24,
|
||||
0xb2, 0x72, 0xce, 0xa5, 0x36, 0x3e, 0x8d, 0x82, 0x91, 0x96, 0x20, 0xf6, 0x6b, 0x00, 0x32, 0x27,
|
||||
0x76, 0x3e, 0x4f, 0x92, 0x3b, 0x18, 0xb5, 0xe5, 0x2b, 0xc0, 0x34, 0x82, 0x5b, 0x7b, 0xdf, 0x7e,
|
||||
0x7d, 0x28, 0xcf, 0xbb, 0x55, 0x98, 0xfb, 0x4e, 0xf8, 0xaa, 0x72, 0x33, 0x59, 0x26, 0x94, 0x99,
|
||||
0x43, 0x34, 0x4c, 0x39, 0x00, 0x0b, 0x28, 0x0b, 0x06, 0xf7, 0x12, 0xca, 0x58, 0x55, 0x6a, 0xca,
|
||||
0x3e, 0x98, 0xca, 0xcd, 0xf5, 0xc2, 0x50, 0xdf, 0x2c, 0x5c, 0xbb, 0x7d, 0x25, 0x9c, 0x12, 0x2f,
|
||||
0x2b, 0xe2, 0x05, 0x77, 0x3e, 0x4f, 0xbc, 0x63, 0x6a, 0x53, 0xb7, 0x99, 0x79, 0x2b, 0x08, 0x38,
|
||||
0x05, 0x8b, 0x02, 0x1e, 0x9e, 0xb1, 0xcb, 0x02, 0x56, 0x95, 0x9a, 0xf2, 0x09, 0x98, 0xca, 0x8d,
|
||||
0xe0, 0xb0, 0xdb, 0x2c, 0x5c, 0xe0, 0xb6, 0x68, 0x62, 0x6a, 0x63, 0x6f, 0xcf, 0xf6, 0x57, 0xad,
|
||||
0xe6, 0xfd, 0xc3, 0x13, 0xc7, 0x3a, 0x3a, 0x71, 0xac, 0x9f, 0x27, 0x8e, 0xf5, 0xfe, 0xd4, 0x29,
|
||||
0x1d, 0x9d, 0x3a, 0xa5, 0xef, 0xa7, 0x4e, 0xe9, 0xb9, 0x4b, 0xa8, 0xf4, 0x7a, 0x41, 0xc7, 0x4b,
|
||||
0xae, 0x0c, 0x1c, 0xfb, 0x6b, 0x94, 0xc3, 0x2e, 0xf2, 0x39, 0xa3, 0x7e, 0x00, 0x77, 0x95, 0xd2,
|
||||
0xce, 0xb8, 0xba, 0x2b, 0xee, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xef, 0x34, 0xfa, 0x7f, 0xf3,
|
||||
0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -488,6 +594,9 @@ type MsgClient interface {
|
||||
WithdrawBond(ctx context.Context, in *MsgWithdrawBond, opts ...grpc.CallOption) (*MsgWithdrawBondResponse, error)
|
||||
// CancelBond defines a method for cancelling a bond.
|
||||
CancelBond(ctx context.Context, in *MsgCancelBond, opts ...grpc.CallOption) (*MsgCancelBondResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -534,6 +643,15 @@ func (c *msgClient) CancelBond(ctx context.Context, in *MsgCancelBond, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cerc.bond.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// CreateBond defines a method for creating a new bond.
|
||||
@@ -544,6 +662,9 @@ type MsgServer interface {
|
||||
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
||||
// CancelBond defines a method for cancelling a bond.
|
||||
CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -562,6 +683,9 @@ func (*UnimplementedMsgServer) WithdrawBond(ctx context.Context, req *MsgWithdra
|
||||
func (*UnimplementedMsgServer) CancelBond(ctx context.Context, req *MsgCancelBond) (*MsgCancelBondResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelBond not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@@ -639,6 +763,24 @@ func _Msg_CancelBond_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cerc.bond.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cerc.bond.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
@@ -659,6 +801,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CancelBond",
|
||||
Handler: _Msg_CancelBond_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/bond/v1/tx.proto",
|
||||
@@ -946,6 +1092,69 @@ func (m *MsgCancelBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTx(v)
|
||||
base := offset
|
||||
@@ -1079,6 +1288,30 @@ func (m *MsgCancelBondResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -1843,6 +2076,171 @@ func (m *MsgCancelBondResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParams) 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 ErrIntOverflowTx
|
||||
}
|
||||
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: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx
|
||||
}
|
||||
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: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -2,6 +2,7 @@ package keeper
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
@@ -64,6 +65,20 @@ func (k Keeper) GetAuthority() string {
|
||||
return k.authority
|
||||
}
|
||||
|
||||
func (k Keeper) GetParams(ctx sdk.Context) (*onboardingTypes.Params, error) {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ¶ms, nil
|
||||
}
|
||||
|
||||
// SetParams sets the x/onboarding module parameters.
|
||||
func (k Keeper) SetParams(ctx sdk.Context, params onboardingTypes.Params) error {
|
||||
return k.Params.Set(ctx, params)
|
||||
}
|
||||
|
||||
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
|
||||
return ctx.Logger().With("module", onboardingTypes.ModuleName)
|
||||
}
|
||||
@@ -100,6 +115,8 @@ func (k Keeper) OnboardParticipant(
|
||||
participant := &onboardingTypes.Participant{
|
||||
CosmosAddress: signerAddress.String(),
|
||||
NitroAddress: nitroAddress,
|
||||
Role: msg.Role,
|
||||
KycId: msg.KycId,
|
||||
}
|
||||
|
||||
if err := k.StoreParticipant(ctx, participant); err != nil {
|
||||
@@ -134,3 +151,35 @@ func (k Keeper) ListParticipants(ctx sdk.Context) ([]*onboardingTypes.Participan
|
||||
|
||||
return participants, nil
|
||||
}
|
||||
|
||||
// GetParticipantByAddress - get participant by cosmos (laconic) address.
|
||||
func (k Keeper) GetParticipantByAddress(ctx sdk.Context, address string) (onboardingTypes.Participant, error) {
|
||||
participant, err := k.Participants.Get(ctx, address)
|
||||
if err != nil {
|
||||
if errors.Is(err, collections.ErrNotFound) {
|
||||
return onboardingTypes.Participant{}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "participant with given address not found.")
|
||||
}
|
||||
return onboardingTypes.Participant{}, err
|
||||
}
|
||||
|
||||
return participant, nil
|
||||
}
|
||||
|
||||
// GetParticipantByNitroAddress - get participant by nitro address.
|
||||
func (k Keeper) GetParticipantByNitroAddress(ctx sdk.Context, nitroAddress string) (onboardingTypes.Participant, error) {
|
||||
var participant onboardingTypes.Participant
|
||||
|
||||
err := k.Participants.Walk(ctx, nil, func(key string, value onboardingTypes.Participant) (bool, error) {
|
||||
if value.NitroAddress == nitroAddress {
|
||||
participant = value
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return onboardingTypes.Participant{}, err
|
||||
}
|
||||
|
||||
return participant, nil
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"git.vdb.to/cerc-io/laconicd/utils"
|
||||
"git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||
@@ -55,3 +57,22 @@ func (ms msgServer) OnboardParticipant(c context.Context, msg *onboarding.MsgOnb
|
||||
|
||||
return &onboarding.MsgOnboardParticipantResponse{}, nil
|
||||
}
|
||||
|
||||
// UpdateParams defines a method to perform updation of module params.
|
||||
func (ms msgServer) UpdateParams(c context.Context, msg *onboarding.MsgUpdateParams) (*onboarding.MsgUpdateParamsResponse, error) {
|
||||
if ms.k.authority != msg.Authority {
|
||||
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
||||
}
|
||||
|
||||
if err := msg.Params.Validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
if err := ms.k.SetParams(ctx, msg.Params); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &onboarding.MsgUpdateParamsResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
|
||||
onboardingtypes "git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||
)
|
||||
@@ -33,3 +35,41 @@ func (qs queryServer) Participants(
|
||||
|
||||
return &onboardingtypes.QueryParticipantsResponse{Participants: resp}, nil
|
||||
}
|
||||
|
||||
// GetParticipantByAddress implements the GetParticipantByAddress query.
|
||||
func (qs queryServer) GetParticipantByAddress(
|
||||
c context.Context,
|
||||
req *onboardingtypes.QueryGetParticipantByAddressRequest,
|
||||
) (*onboardingtypes.QueryGetParticipantByAddressResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
if req.Address == "" {
|
||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cosmos (laconic) address is required")
|
||||
}
|
||||
|
||||
participant, err := qs.k.GetParticipantByAddress(ctx, req.Address)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &onboardingtypes.QueryGetParticipantByAddressResponse{Participant: &participant}, nil
|
||||
}
|
||||
|
||||
// GetParticipantByNitroAddress implements the GetParticipantByNitroAddress query.
|
||||
func (qs queryServer) GetParticipantByNitroAddress(
|
||||
c context.Context,
|
||||
req *onboardingtypes.QueryGetParticipantByNitroAddressRequest,
|
||||
) (*onboardingtypes.QueryGetParticipantByNitroAddressResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
if req.NitroAddress == "" {
|
||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "nitro address is required")
|
||||
}
|
||||
|
||||
participant, err := qs.k.GetParticipantByNitroAddress(ctx, req.NitroAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &onboardingtypes.QueryGetParticipantByNitroAddressResponse{Participant: &participant}, nil
|
||||
}
|
||||
|
||||
@@ -18,6 +18,22 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Short: "List participants",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
||||
},
|
||||
{
|
||||
RpcMethod: "GetParticipantByAddress",
|
||||
Use: "get-by-address [address]",
|
||||
Short: "Get participant by address",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "address"},
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "GetParticipantByNitroAddress",
|
||||
Use: "get-by-nitro-address [nitro_address]",
|
||||
Short: "Get participant by nitro address",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "nitro_address"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// TODO: Use JSON file for input
|
||||
@@ -26,13 +42,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "OnboardParticipant",
|
||||
Use: "enroll",
|
||||
Use: "enroll [eth_payload] [eth_signature] [role] [kyc_id]",
|
||||
Short: "Enroll a testnet validator",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "eth_payload"},
|
||||
{ProtoField: "eth_signature"},
|
||||
{ProtoField: "role"},
|
||||
{ProtoField: "kyc_id"},
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
+21
-1
@@ -1,11 +1,15 @@
|
||||
package onboarding
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
|
||||
var PERMITTED_ROLES = []string{"participant", "validator"}
|
||||
|
||||
var _ sdk.Msg = &MsgOnboardParticipant{}
|
||||
|
||||
func (msg MsgOnboardParticipant) ValidateBasic() error {
|
||||
@@ -18,7 +22,23 @@ func (msg MsgOnboardParticipant) ValidateBasic() error {
|
||||
}
|
||||
|
||||
if len(msg.EthSignature) != 132 {
|
||||
return errorsmod.Wrap(sdkerrors.ErrNoSignatures, "Invalid signature.")
|
||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid signature.")
|
||||
}
|
||||
|
||||
if len(msg.KycId) == 0 {
|
||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Empty KYC ID.")
|
||||
}
|
||||
|
||||
isRoleValid := false
|
||||
for _, v := range PERMITTED_ROLES {
|
||||
if msg.Role == v {
|
||||
isRoleValid = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isRoleValid {
|
||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("Participant role has to be one of: %v", PERMITTED_ROLES))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
+133
-24
@@ -71,8 +71,14 @@ func (m *Params) GetOnboardingEnabled() bool {
|
||||
// Participant defines the data that will be stored for each enrolled
|
||||
// participant
|
||||
type Participant struct {
|
||||
// participant's cosmos (laconic) address
|
||||
CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty" json:"cosmos_address" yaml:"cosmos_address"`
|
||||
NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty" json:"nitro_address" yaml:"nitro_address"`
|
||||
// participant's Nitro address
|
||||
NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty" json:"nitro_address" yaml:"nitro_address"`
|
||||
// participant's role (participant | validator)
|
||||
Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty" json:"role" yaml:"role"`
|
||||
// participant's KYC receipt ID
|
||||
KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty" json:"kyc_id" yaml:"kyc_id"`
|
||||
}
|
||||
|
||||
func (m *Participant) Reset() { *m = Participant{} }
|
||||
@@ -122,6 +128,20 @@ func (m *Participant) GetNitroAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Participant) GetRole() string {
|
||||
if m != nil {
|
||||
return m.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Participant) GetKycId() string {
|
||||
if m != nil {
|
||||
return m.KycId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// EthPayload defines the payload that is signed by the ethereum private key
|
||||
type EthPayload struct {
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" json:"address" yaml:"address"`
|
||||
@@ -186,29 +206,32 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_59afed779274eaf0 = []byte{
|
||||
// 343 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4a, 0xc3, 0x30,
|
||||
0x1c, 0xc7, 0x57, 0x85, 0xa9, 0xd1, 0x09, 0x06, 0x05, 0x15, 0x6c, 0x67, 0xbd, 0x4c, 0xc6, 0x5a,
|
||||
0xc6, 0x0e, 0x82, 0x9e, 0x2c, 0xec, 0x3e, 0x7a, 0xf0, 0xe0, 0x65, 0xa4, 0x7f, 0xac, 0x91, 0x36,
|
||||
0xbf, 0x91, 0x84, 0xe2, 0xde, 0xc2, 0xd7, 0xf1, 0x0d, 0x3c, 0xee, 0xe8, 0xa9, 0xc8, 0xf6, 0x06,
|
||||
0x7d, 0x02, 0x69, 0xb3, 0x6e, 0xeb, 0xf4, 0x96, 0xdf, 0xf7, 0xcf, 0xe7, 0x17, 0x48, 0xd0, 0x8d,
|
||||
0x1f, 0x72, 0xdf, 0x06, 0xe6, 0x01, 0xe1, 0x01, 0x65, 0x91, 0x9d, 0xf6, 0x37, 0x26, 0x6b, 0xc2,
|
||||
0x41, 0x02, 0xc6, 0x45, 0xc8, 0xda, 0x90, 0xd3, 0xfe, 0xe5, 0x69, 0x04, 0x11, 0x94, 0xb6, 0x5d,
|
||||
0x9c, 0x54, 0xd2, 0x9c, 0xa0, 0xe6, 0x88, 0x70, 0x92, 0x08, 0xfc, 0x82, 0xf0, 0xba, 0x30, 0x0e,
|
||||
0x19, 0xf1, 0xe2, 0x30, 0x38, 0xd7, 0xda, 0x5a, 0x67, 0xdf, 0xb9, 0xcb, 0x33, 0x63, 0xf0, 0x26,
|
||||
0x80, 0xdd, 0x9b, 0x7f, 0x33, 0x66, 0x7b, 0x4a, 0x92, 0xf8, 0x5f, 0xc7, 0x3d, 0x59, 0x8b, 0xc3,
|
||||
0xa5, 0xf6, 0xa9, 0xa1, 0xc3, 0x11, 0xe1, 0x92, 0xfa, 0x74, 0x42, 0x98, 0xc4, 0x4f, 0xe8, 0xd8,
|
||||
0x07, 0x91, 0x80, 0x18, 0x93, 0x20, 0xe0, 0xa1, 0x10, 0xe5, 0xce, 0x03, 0xc7, 0xce, 0x33, 0xa3,
|
||||
0xab, 0x76, 0xd6, 0xfd, 0x6a, 0xdf, 0x96, 0xea, 0xb6, 0x94, 0xf0, 0xa8, 0x66, 0xec, 0xa2, 0x16,
|
||||
0xa3, 0x92, 0xc3, 0x0a, 0xbb, 0x53, 0x62, 0x7b, 0x79, 0x66, 0xdc, 0x2a, 0x6c, 0xcd, 0xae, 0xa8,
|
||||
0x75, 0xd1, 0x3d, 0x2a, 0xe7, 0x25, 0xd3, 0x4c, 0x11, 0x1a, 0xca, 0xd7, 0x11, 0x99, 0xc6, 0x40,
|
||||
0x02, 0xfc, 0x80, 0xf6, 0xea, 0x57, 0xbe, 0xce, 0x33, 0xe3, 0x4a, 0xb1, 0xb7, 0xa8, 0x2b, 0x5e,
|
||||
0xd5, 0xc0, 0x5d, 0xb4, 0x9b, 0x88, 0x68, 0x79, 0xa9, 0x8b, 0x3c, 0x33, 0xce, 0x54, 0x31, 0x11,
|
||||
0x51, 0x55, 0x2a, 0x8e, 0x6e, 0x91, 0x72, 0x9c, 0xaf, 0xb9, 0xae, 0xcd, 0xe6, 0xba, 0xf6, 0x33,
|
||||
0xd7, 0xb5, 0x8f, 0x85, 0xde, 0x98, 0x2d, 0xf4, 0xc6, 0xf7, 0x42, 0x6f, 0x3c, 0x77, 0x22, 0x2a,
|
||||
0xad, 0x34, 0xf0, 0x2c, 0x09, 0x76, 0xf1, 0xe8, 0x3d, 0x0a, 0x76, 0x4c, 0x7c, 0x60, 0xd4, 0x0f,
|
||||
0xec, 0xf7, 0x8d, 0x9f, 0xe1, 0x35, 0xcb, 0x07, 0x1f, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0x91,
|
||||
0x47, 0xeb, 0x34, 0x41, 0x02, 0x00, 0x00,
|
||||
// 399 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0xce, 0xd2, 0x40,
|
||||
0x14, 0x85, 0xe9, 0x0f, 0xa2, 0x8e, 0x62, 0xe2, 0x44, 0x23, 0x4a, 0xec, 0x60, 0xdd, 0x60, 0x08,
|
||||
0x9d, 0x10, 0x12, 0x4d, 0x74, 0x65, 0x13, 0x16, 0xee, 0x48, 0x17, 0x2e, 0xdc, 0x90, 0xe9, 0x4c,
|
||||
0xad, 0x23, 0x6d, 0x87, 0xcc, 0x34, 0x8d, 0x7d, 0x0b, 0x9f, 0xc1, 0xa7, 0x71, 0xc9, 0xd2, 0x55,
|
||||
0x63, 0xe0, 0x0d, 0xfa, 0x04, 0xa6, 0x33, 0x14, 0x28, 0xfe, 0xbb, 0x7b, 0xcf, 0x3d, 0xe7, 0xbb,
|
||||
0xd3, 0xe6, 0x82, 0xd7, 0x34, 0x94, 0x14, 0x8b, 0x34, 0x10, 0x44, 0x32, 0x9e, 0x46, 0x38, 0x9f,
|
||||
0x5f, 0x74, 0xee, 0x56, 0x8a, 0x4c, 0x40, 0x58, 0x9b, 0xdc, 0x0b, 0x39, 0x9f, 0xbf, 0x78, 0x12,
|
||||
0x89, 0x48, 0xe8, 0x31, 0xae, 0x2b, 0xe3, 0x74, 0xb6, 0xa0, 0xbf, 0x22, 0x92, 0x24, 0x0a, 0x7e,
|
||||
0x05, 0xf0, 0x1c, 0x58, 0x87, 0x29, 0x09, 0xe2, 0x90, 0x0d, 0xad, 0xb1, 0x35, 0xb9, 0xe7, 0xbd,
|
||||
0xab, 0x4a, 0xb4, 0xf8, 0xae, 0x44, 0xfa, 0xde, 0xf9, 0xdf, 0xe3, 0x8c, 0x0b, 0x92, 0xc4, 0xb7,
|
||||
0x4e, 0xfc, 0xc7, 0x67, 0x71, 0x79, 0xd4, 0x7e, 0xdd, 0x80, 0x07, 0x2b, 0x22, 0x33, 0x4e, 0xf9,
|
||||
0x96, 0xa4, 0x19, 0xfc, 0x0c, 0x1e, 0x51, 0xa1, 0x12, 0xa1, 0xd6, 0x84, 0x31, 0x19, 0x2a, 0xa5,
|
||||
0x77, 0xde, 0xf7, 0x70, 0x55, 0xa2, 0xa9, 0xd9, 0xd9, 0x9e, 0x37, 0xfb, 0xae, 0x54, 0x7f, 0x60,
|
||||
0x84, 0x8f, 0xa6, 0x87, 0x3e, 0x18, 0xa4, 0x3c, 0x93, 0xe2, 0x84, 0xbd, 0xd1, 0xd8, 0x59, 0x55,
|
||||
0xa2, 0x37, 0x06, 0xdb, 0x1a, 0x37, 0xd4, 0xb6, 0xe8, 0x3f, 0xd4, 0x7d, 0xc3, 0xc4, 0xa0, 0x27,
|
||||
0x45, 0x1c, 0x0e, 0xbb, 0x1a, 0x35, 0xaa, 0x4a, 0xf4, 0xcc, 0xa0, 0x6a, 0xb5, 0x21, 0xe8, 0xda,
|
||||
0xd7, 0x46, 0xf8, 0x16, 0xf4, 0x37, 0x05, 0x5d, 0x73, 0x36, 0xec, 0xe9, 0x08, 0xaa, 0x4a, 0x34,
|
||||
0x32, 0x11, 0xa3, 0x37, 0xa1, 0x63, 0xe7, 0xdf, 0xd9, 0x14, 0xf4, 0x13, 0x73, 0x72, 0x00, 0x96,
|
||||
0xd9, 0xb7, 0x15, 0x29, 0x62, 0x41, 0x18, 0xfc, 0x00, 0xee, 0xb6, 0xff, 0xcd, 0xab, 0xaa, 0x44,
|
||||
0x2f, 0x0d, 0xe6, 0xea, 0xf9, 0xa7, 0x87, 0x37, 0x09, 0x38, 0x05, 0xdd, 0x44, 0x45, 0xc7, 0xaf,
|
||||
0x7f, 0x5e, 0x95, 0xe8, 0xa9, 0x09, 0x26, 0x2a, 0x6a, 0x42, 0x75, 0xe9, 0xd7, 0x2e, 0xcf, 0xfb,
|
||||
0xbd, 0xb7, 0xad, 0xdd, 0xde, 0xb6, 0xfe, 0xee, 0x6d, 0xeb, 0xe7, 0xc1, 0xee, 0xec, 0x0e, 0x76,
|
||||
0xe7, 0xcf, 0xc1, 0xee, 0x7c, 0x99, 0x44, 0x3c, 0x73, 0x73, 0x16, 0xb8, 0x99, 0xc0, 0xf5, 0x75,
|
||||
0xcd, 0xb8, 0xc0, 0x31, 0xa1, 0x22, 0xe5, 0x94, 0xe1, 0x1f, 0x17, 0x27, 0x18, 0xf4, 0xf5, 0x65,
|
||||
0x2d, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x87, 0xe5, 0xd5, 0x6b, 0xaa, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||
@@ -264,6 +287,20 @@ func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.KycId) > 0 {
|
||||
i -= len(m.KycId)
|
||||
copy(dAtA[i:], m.KycId)
|
||||
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.KycId)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Role) > 0 {
|
||||
i -= len(m.Role)
|
||||
copy(dAtA[i:], m.Role)
|
||||
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Role)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.NitroAddress) > 0 {
|
||||
i -= len(m.NitroAddress)
|
||||
copy(dAtA[i:], m.NitroAddress)
|
||||
@@ -355,6 +392,14 @@ func (m *Participant) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovOnboarding(uint64(l))
|
||||
}
|
||||
l = len(m.Role)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovOnboarding(uint64(l))
|
||||
}
|
||||
l = len(m.KycId)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovOnboarding(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -544,6 +589,70 @@ func (m *Participant) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
m.NitroAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowOnboarding
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthOnboarding
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthOnboarding
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Role = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowOnboarding
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthOnboarding
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthOnboarding
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.KycId = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipOnboarding(dAtA[iNdEx:])
|
||||
|
||||
+828
-26
@@ -76,7 +76,7 @@ func (m *QueryParticipantsRequest) GetPagination() *query.PageRequest {
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryParticipantsResponse is response type for get the participants
|
||||
// QueryParticipantsResponse is response type for querying the participants
|
||||
type QueryParticipantsResponse struct {
|
||||
Participants []*Participant `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty" json:"participants" yaml:"participants"`
|
||||
// pagination defines the pagination in the response.
|
||||
@@ -130,39 +130,247 @@ func (m *QueryParticipantsResponse) GetPagination() *query.PageResponse {
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryGetParticipantByAddressRequest queries participant by the laconic
|
||||
// address
|
||||
type QueryGetParticipantByAddressRequest struct {
|
||||
// Laconic address
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressRequest) Reset() { *m = QueryGetParticipantByAddressRequest{} }
|
||||
func (m *QueryGetParticipantByAddressRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryGetParticipantByAddressRequest) ProtoMessage() {}
|
||||
func (*QueryGetParticipantByAddressRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_80831d904221d27d, []int{2}
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryGetParticipantByAddressRequest.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 *QueryGetParticipantByAddressRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryGetParticipantByAddressRequest.Merge(m, src)
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryGetParticipantByAddressRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryGetParticipantByAddressRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryGetParticipantByAddressRequest) GetAddress() string {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// QueryGetParticipantByAddressResponse is response type for querying
|
||||
// participant by the laconic address
|
||||
type QueryGetParticipantByAddressResponse struct {
|
||||
// Participant details
|
||||
Participant *Participant `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressResponse) Reset() { *m = QueryGetParticipantByAddressResponse{} }
|
||||
func (m *QueryGetParticipantByAddressResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryGetParticipantByAddressResponse) ProtoMessage() {}
|
||||
func (*QueryGetParticipantByAddressResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_80831d904221d27d, []int{3}
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryGetParticipantByAddressResponse.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 *QueryGetParticipantByAddressResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryGetParticipantByAddressResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryGetParticipantByAddressResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryGetParticipantByAddressResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryGetParticipantByAddressResponse) GetParticipant() *Participant {
|
||||
if m != nil {
|
||||
return m.Participant
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryGetParticipantByNitroAddressRequest queries participant by the nitro
|
||||
// address
|
||||
type QueryGetParticipantByNitroAddressRequest struct {
|
||||
// Nitro address
|
||||
NitroAddress string `protobuf:"bytes,1,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) Reset() {
|
||||
*m = QueryGetParticipantByNitroAddressRequest{}
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryGetParticipantByNitroAddressRequest) ProtoMessage() {}
|
||||
func (*QueryGetParticipantByNitroAddressRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_80831d904221d27d, []int{4}
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.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 *QueryGetParticipantByNitroAddressRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.Merge(m, src)
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryGetParticipantByNitroAddressRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) GetNitroAddress() string {
|
||||
if m != nil {
|
||||
return m.NitroAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// QueryGetParticipantByNitroAddressResponse is response type for querying
|
||||
// participant by the nitro address
|
||||
type QueryGetParticipantByNitroAddressResponse struct {
|
||||
// Participant details
|
||||
Participant *Participant `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) Reset() {
|
||||
*m = QueryGetParticipantByNitroAddressResponse{}
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) String() string {
|
||||
return proto.CompactTextString(m)
|
||||
}
|
||||
func (*QueryGetParticipantByNitroAddressResponse) ProtoMessage() {}
|
||||
func (*QueryGetParticipantByNitroAddressResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_80831d904221d27d, []int{5}
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.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 *QueryGetParticipantByNitroAddressResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryGetParticipantByNitroAddressResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) GetParticipant() *Participant {
|
||||
if m != nil {
|
||||
return m.Participant
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryParticipantsRequest)(nil), "cerc.onboarding.v1.QueryParticipantsRequest")
|
||||
proto.RegisterType((*QueryParticipantsResponse)(nil), "cerc.onboarding.v1.QueryParticipantsResponse")
|
||||
proto.RegisterType((*QueryGetParticipantByAddressRequest)(nil), "cerc.onboarding.v1.QueryGetParticipantByAddressRequest")
|
||||
proto.RegisterType((*QueryGetParticipantByAddressResponse)(nil), "cerc.onboarding.v1.QueryGetParticipantByAddressResponse")
|
||||
proto.RegisterType((*QueryGetParticipantByNitroAddressRequest)(nil), "cerc.onboarding.v1.QueryGetParticipantByNitroAddressRequest")
|
||||
proto.RegisterType((*QueryGetParticipantByNitroAddressResponse)(nil), "cerc.onboarding.v1.QueryGetParticipantByNitroAddressResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cerc/onboarding/v1/query.proto", fileDescriptor_80831d904221d27d) }
|
||||
|
||||
var fileDescriptor_80831d904221d27d = []byte{
|
||||
// 380 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0x6a, 0x1b, 0x31,
|
||||
0x1c, 0xc7, 0x2d, 0x97, 0x76, 0x90, 0x3d, 0x89, 0x0e, 0xae, 0x29, 0xe7, 0xe3, 0x0a, 0xf5, 0xd1,
|
||||
0xd6, 0x12, 0xe7, 0x6e, 0x1d, 0x3d, 0xb4, 0xab, 0xeb, 0xb1, 0x9b, 0xee, 0x2c, 0x84, 0x8a, 0xad,
|
||||
0xdf, 0xf9, 0x24, 0x1f, 0xf5, 0xda, 0x27, 0x28, 0x94, 0xce, 0x7d, 0x9d, 0x8c, 0x86, 0x40, 0xc8,
|
||||
0x14, 0x82, 0x9d, 0x27, 0xc8, 0x13, 0x84, 0x3b, 0x19, 0x2c, 0x27, 0x17, 0x92, 0x4d, 0xe8, 0xf7,
|
||||
0xfb, 0xfe, 0xf9, 0x08, 0xe1, 0x20, 0x13, 0x45, 0xc6, 0x40, 0xa7, 0xc0, 0x8b, 0xb9, 0xd2, 0x92,
|
||||
0x95, 0x09, 0x5b, 0xad, 0x45, 0xb1, 0xa1, 0x79, 0x01, 0x16, 0x08, 0xa9, 0xe6, 0xf4, 0x38, 0xa7,
|
||||
0x65, 0xd2, 0x7f, 0x2d, 0x41, 0x42, 0x3d, 0x66, 0xd5, 0xc9, 0x6d, 0xf6, 0x3f, 0x64, 0x60, 0x96,
|
||||
0x60, 0x58, 0xca, 0x8d, 0x70, 0x16, 0xac, 0x4c, 0x52, 0x61, 0x79, 0xc2, 0x72, 0x2e, 0x95, 0xe6,
|
||||
0x56, 0x81, 0x3e, 0xec, 0xbe, 0x6b, 0x48, 0xf5, 0x32, 0xdc, 0xd2, 0x5b, 0x09, 0x20, 0x17, 0x82,
|
||||
0xf1, 0x5c, 0x31, 0xae, 0x35, 0xd8, 0xda, 0xc1, 0xb8, 0x69, 0x94, 0xe2, 0xde, 0xf7, 0x2a, 0x64,
|
||||
0xca, 0x0b, 0xab, 0x32, 0x95, 0x73, 0x6d, 0xcd, 0x4c, 0xac, 0xd6, 0xc2, 0x58, 0xf2, 0x15, 0xe3,
|
||||
0x63, 0x64, 0x0f, 0x85, 0x28, 0xee, 0x8c, 0xdf, 0x53, 0xd7, 0x8f, 0x56, 0xfd, 0xa8, 0x43, 0x3c,
|
||||
0xf4, 0xa3, 0x53, 0x2e, 0xc5, 0x41, 0x3b, 0xf3, 0x94, 0xd1, 0x05, 0xc2, 0x6f, 0x1a, 0x42, 0x4c,
|
||||
0x0e, 0xda, 0x08, 0x92, 0xe3, 0x6e, 0xee, 0xdd, 0xf7, 0x50, 0xf8, 0x22, 0xee, 0x8c, 0x07, 0xf4,
|
||||
0xe1, 0x8b, 0x51, 0x4f, 0x3f, 0xf9, 0x78, 0x7b, 0x35, 0x18, 0xfe, 0x34, 0xa0, 0xbf, 0x44, 0xbe,
|
||||
0x3c, 0x0a, 0x37, 0x7c, 0xb9, 0xb8, 0x77, 0x37, 0x3b, 0x49, 0x20, 0xdf, 0x4e, 0xb8, 0xda, 0x35,
|
||||
0xd7, 0xf0, 0x49, 0x2e, 0x57, 0xd7, 0x07, 0x1b, 0xff, 0x47, 0xf8, 0x65, 0x0d, 0x46, 0xfe, 0x21,
|
||||
0xdc, 0xf5, 0xe9, 0xc8, 0xa7, 0xa6, 0xfe, 0x8f, 0xbd, 0x74, 0x7f, 0xf4, 0xcc, 0x6d, 0xd7, 0x21,
|
||||
0x8a, 0x7f, 0x9f, 0xdf, 0xfc, 0x6d, 0x47, 0x24, 0x64, 0x0d, 0x1f, 0xc0, 0x47, 0x9d, 0x4c, 0xce,
|
||||
0x76, 0x01, 0xda, 0xee, 0x02, 0x74, 0xbd, 0x0b, 0xd0, 0x9f, 0x7d, 0xd0, 0xda, 0xee, 0x83, 0xd6,
|
||||
0xe5, 0x3e, 0x68, 0xfd, 0x88, 0xa5, 0xb2, 0xb4, 0x9c, 0xa7, 0xd4, 0x42, 0xed, 0x32, 0x52, 0xc0,
|
||||
0x16, 0x3c, 0x03, 0xad, 0xb2, 0x39, 0xfb, 0xe5, 0x79, 0xa6, 0xaf, 0xea, 0x9f, 0xf2, 0xf9, 0x2e,
|
||||
0x00, 0x00, 0xff, 0xff, 0x3b, 0xb7, 0xca, 0x13, 0xe4, 0x02, 0x00, 0x00,
|
||||
// 535 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x40,
|
||||
0x10, 0xce, 0x96, 0x3f, 0xb1, 0x09, 0x97, 0x15, 0x12, 0x21, 0xaa, 0xdc, 0xc8, 0x41, 0xd4, 0x94,
|
||||
0x76, 0x97, 0x98, 0x03, 0x15, 0x02, 0xa1, 0xe6, 0x40, 0x6f, 0x50, 0x7c, 0xe4, 0x82, 0xd6, 0xf6,
|
||||
0xca, 0x5a, 0x94, 0xee, 0xba, 0xde, 0x6d, 0x44, 0x84, 0x7a, 0xe1, 0x09, 0x90, 0x10, 0x2f, 0xc3,
|
||||
0x89, 0x23, 0xc7, 0x4a, 0x08, 0xc4, 0x09, 0xa1, 0x84, 0x27, 0xe0, 0x09, 0x90, 0xd7, 0x86, 0xae,
|
||||
0x8b, 0xf3, 0x03, 0xe2, 0x66, 0xcf, 0xcc, 0x37, 0xdf, 0xf7, 0xcd, 0x8c, 0x0d, 0x9d, 0x88, 0x65,
|
||||
0x11, 0x91, 0x22, 0x94, 0x34, 0x8b, 0xb9, 0x48, 0xc8, 0xa8, 0x4f, 0x0e, 0x0e, 0x59, 0x36, 0xc6,
|
||||
0x69, 0x26, 0xb5, 0x44, 0x28, 0xcf, 0xe3, 0x93, 0x3c, 0x1e, 0xf5, 0x3b, 0x97, 0x13, 0x99, 0x48,
|
||||
0x93, 0x26, 0xf9, 0x53, 0x51, 0xd9, 0xd9, 0x88, 0xa4, 0xda, 0x97, 0x8a, 0x84, 0x54, 0xb1, 0xa2,
|
||||
0x05, 0x19, 0xf5, 0x43, 0xa6, 0x69, 0x9f, 0xa4, 0x34, 0xe1, 0x82, 0x6a, 0x2e, 0x45, 0x59, 0xdb,
|
||||
0xab, 0x61, 0xb5, 0x38, 0x8a, 0xa2, 0xd5, 0x44, 0xca, 0x64, 0xc8, 0x08, 0x4d, 0x39, 0xa1, 0x42,
|
||||
0x48, 0x6d, 0x3a, 0xa8, 0x22, 0xeb, 0x86, 0xb0, 0xfd, 0x24, 0x27, 0xd9, 0xa3, 0x99, 0xe6, 0x11,
|
||||
0x4f, 0xa9, 0xd0, 0x2a, 0x60, 0x07, 0x87, 0x4c, 0x69, 0xf4, 0x10, 0xc2, 0x13, 0xca, 0x36, 0xe8,
|
||||
0x02, 0xaf, 0xe9, 0x5f, 0xc7, 0x85, 0x3e, 0x9c, 0xeb, 0xc3, 0x85, 0xc5, 0x52, 0x1f, 0xde, 0xa3,
|
||||
0x09, 0x2b, 0xb1, 0x81, 0x85, 0x74, 0x3f, 0x03, 0x78, 0xb5, 0x86, 0x44, 0xa5, 0x52, 0x28, 0x86,
|
||||
0x52, 0xd8, 0x4a, 0xad, 0x78, 0x1b, 0x74, 0xcf, 0x78, 0x4d, 0x7f, 0x0d, 0xff, 0x39, 0x31, 0x6c,
|
||||
0xe1, 0x07, 0x37, 0x7f, 0x7c, 0x5d, 0x5b, 0x7f, 0xae, 0xa4, 0xb8, 0xeb, 0xda, 0x70, 0xb7, 0x3b,
|
||||
0xa6, 0xfb, 0xc3, 0x53, 0xb1, 0xa0, 0xc2, 0x80, 0x76, 0x2b, 0xbe, 0x56, 0x8c, 0xaf, 0xf5, 0x85,
|
||||
0xbe, 0x0a, 0xb9, 0x15, 0x63, 0x0f, 0x60, 0xcf, 0xf8, 0xda, 0x65, 0xda, 0x96, 0x36, 0xde, 0x89,
|
||||
0xe3, 0x8c, 0xa9, 0xdf, 0x73, 0x6c, 0xc3, 0x0b, 0xb4, 0x88, 0x98, 0x21, 0x5e, 0x0c, 0x7e, 0xbd,
|
||||
0xba, 0x1c, 0x5e, 0x9b, 0xdf, 0xa0, 0x9c, 0xd1, 0x0e, 0x6c, 0x5a, 0x0e, 0xca, 0x55, 0x2c, 0x1a,
|
||||
0x51, 0x60, 0x63, 0xdc, 0xc7, 0xd0, 0xab, 0xa5, 0x7a, 0xc4, 0x75, 0x26, 0x4f, 0x09, 0xee, 0xc1,
|
||||
0x4b, 0x22, 0x0f, 0x3f, 0xab, 0xca, 0x6e, 0x09, 0xab, 0xd6, 0x15, 0xf0, 0xc6, 0x12, 0x0d, 0xff,
|
||||
0x9b, 0x01, 0xff, 0xdd, 0x59, 0x78, 0xce, 0x10, 0xa2, 0xb7, 0x00, 0xb6, 0xec, 0x53, 0x42, 0x9b,
|
||||
0x75, 0x8d, 0x66, 0x9d, 0x75, 0x67, 0x6b, 0xc9, 0xea, 0x42, 0xba, 0xeb, 0xbd, 0xfa, 0xf8, 0xfd,
|
||||
0xcd, 0x8a, 0x8b, 0xba, 0xa4, 0xe6, 0x6b, 0xab, 0xdc, 0xd5, 0x7b, 0x00, 0xaf, 0xcc, 0xd8, 0x24,
|
||||
0xba, 0x33, 0x93, 0x74, 0xfe, 0xf1, 0x74, 0xb6, 0xff, 0x1e, 0x58, 0x0a, 0xf7, 0x8d, 0xf0, 0x4d,
|
||||
0xb4, 0xb1, 0x48, 0x38, 0x79, 0x59, 0xee, 0xf9, 0x08, 0x7d, 0x02, 0x70, 0x75, 0xde, 0x42, 0xd1,
|
||||
0xbd, 0xa5, 0xe5, 0xd4, 0x1c, 0x56, 0xe7, 0xfe, 0x3f, 0xa2, 0x4b, 0x47, 0xdb, 0xc6, 0x91, 0x8f,
|
||||
0x6e, 0x2d, 0x76, 0x54, 0xb9, 0xdf, 0xa3, 0xc1, 0xe0, 0xc3, 0xc4, 0x01, 0xc7, 0x13, 0x07, 0x7c,
|
||||
0x9b, 0x38, 0xe0, 0xf5, 0xd4, 0x69, 0x1c, 0x4f, 0x9d, 0xc6, 0x97, 0xa9, 0xd3, 0x78, 0xea, 0x25,
|
||||
0x5c, 0xe3, 0x51, 0x1c, 0x62, 0x2d, 0x4d, 0xd7, 0x2d, 0x2e, 0xc9, 0x90, 0x46, 0x52, 0xf0, 0x28,
|
||||
0x26, 0x2f, 0x2c, 0x8e, 0xf0, 0xbc, 0xf9, 0x63, 0xde, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x80,
|
||||
0xc2, 0x03, 0x70, 0xec, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -179,6 +387,10 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
type QueryClient interface {
|
||||
// Participants queries Participants list
|
||||
Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error)
|
||||
// GetParticipantByAddress queries a participant by cosmos (laconic) address
|
||||
GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error)
|
||||
// GetParticipantByNitroAddress queries a participant by nitro address
|
||||
GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
@@ -198,10 +410,32 @@ func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error) {
|
||||
out := new(QueryGetParticipantByAddressResponse)
|
||||
err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Query/GetParticipantByAddress", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error) {
|
||||
out := new(QueryGetParticipantByNitroAddressResponse)
|
||||
err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
type QueryServer interface {
|
||||
// Participants queries Participants list
|
||||
Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error)
|
||||
// GetParticipantByAddress queries a participant by cosmos (laconic) address
|
||||
GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error)
|
||||
// GetParticipantByNitroAddress queries a participant by nitro address
|
||||
GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||
@@ -211,6 +445,12 @@ type UnimplementedQueryServer struct {
|
||||
func (*UnimplementedQueryServer) Participants(ctx context.Context, req *QueryParticipantsRequest) (*QueryParticipantsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) GetParticipantByAddress(ctx context.Context, req *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByAddress not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) GetParticipantByNitroAddress(ctx context.Context, req *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByNitroAddress not implemented")
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||
s.RegisterService(&_Query_serviceDesc, srv)
|
||||
@@ -234,6 +474,42 @@ func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_GetParticipantByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryGetParticipantByAddressRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).GetParticipantByAddress(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cerc.onboarding.v1.Query/GetParticipantByAddress",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).GetParticipantByAddress(ctx, req.(*QueryGetParticipantByAddressRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_GetParticipantByNitroAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryGetParticipantByNitroAddressRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, req.(*QueryGetParticipantByNitroAddressRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cerc.onboarding.v1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
@@ -242,6 +518,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Participants",
|
||||
Handler: _Query_Participants_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetParticipantByAddress",
|
||||
Handler: _Query_GetParticipantByAddress_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetParticipantByNitroAddress",
|
||||
Handler: _Query_GetParticipantByNitroAddress_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/onboarding/v1/query.proto",
|
||||
@@ -331,6 +615,136 @@ func (m *QueryParticipantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressRequest) 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 *QueryGetParticipantByAddressRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Address) > 0 {
|
||||
i -= len(m.Address)
|
||||
copy(dAtA[i:], m.Address)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Address)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressResponse) 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 *QueryGetParticipantByAddressResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Participant != nil {
|
||||
{
|
||||
size, err := m.Participant.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) 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 *QueryGetParticipantByNitroAddressRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.NitroAddress) > 0 {
|
||||
i -= len(m.NitroAddress)
|
||||
copy(dAtA[i:], m.NitroAddress)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.NitroAddress)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) 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 *QueryGetParticipantByNitroAddressResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Participant != nil {
|
||||
{
|
||||
size, err := m.Participant.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovQuery(v)
|
||||
base := offset
|
||||
@@ -374,6 +788,58 @@ func (m *QueryParticipantsResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Address)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByAddressResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Participant != nil {
|
||||
l = m.Participant.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.NitroAddress)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Participant != nil {
|
||||
l = m.Participant.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovQuery(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -586,6 +1052,342 @@ func (m *QueryParticipantsResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressRequest) 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 ErrIntOverflowQuery
|
||||
}
|
||||
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: QueryGetParticipantByAddressRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryGetParticipantByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Address = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryGetParticipantByAddressResponse) 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 ErrIntOverflowQuery
|
||||
}
|
||||
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: QueryGetParticipantByAddressResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryGetParticipantByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Participant", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Participant == nil {
|
||||
m.Participant = &Participant{}
|
||||
}
|
||||
if err := m.Participant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressRequest) 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 ErrIntOverflowQuery
|
||||
}
|
||||
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: QueryGetParticipantByNitroAddressRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field NitroAddress", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.NitroAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryGetParticipantByNitroAddressResponse) 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 ErrIntOverflowQuery
|
||||
}
|
||||
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: QueryGetParticipantByNitroAddressResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Participant", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Participant == nil {
|
||||
m.Participant = &Participant{}
|
||||
}
|
||||
if err := m.Participant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipQuery(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -69,6 +69,114 @@ func local_request_Query_Participants_0(ctx context.Context, marshaler runtime.M
|
||||
|
||||
}
|
||||
|
||||
func request_Query_GetParticipantByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryGetParticipantByAddressRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["address"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
|
||||
}
|
||||
|
||||
protoReq.Address, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetParticipantByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_GetParticipantByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryGetParticipantByAddressRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["address"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
|
||||
}
|
||||
|
||||
protoReq.Address, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetParticipantByAddress(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Query_GetParticipantByNitroAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryGetParticipantByNitroAddressRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["nitro_address"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nitro_address")
|
||||
}
|
||||
|
||||
protoReq.NitroAddress, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nitro_address", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetParticipantByNitroAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_GetParticipantByNitroAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryGetParticipantByNitroAddressRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["nitro_address"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nitro_address")
|
||||
}
|
||||
|
||||
protoReq.NitroAddress, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nitro_address", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetParticipantByNitroAddress(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// 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.
|
||||
@@ -98,6 +206,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_GetParticipantByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_GetParticipantByAddress_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_GetParticipantByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_GetParticipantByNitroAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_GetParticipantByNitroAddress_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_GetParticipantByNitroAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -159,13 +313,61 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_GetParticipantByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_GetParticipantByAddress_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_GetParticipantByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_GetParticipantByNitroAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_GetParticipantByNitroAddress_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_GetParticipantByNitroAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Query_Participants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "onboarding", "v1", "participants"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_GetParticipantByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cerc", "onboarding", "v1", "participants", "address"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_GetParticipantByNitroAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cerc", "onboarding", "v1", "participants", "nitro_address"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Query_Participants_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_GetParticipantByAddress_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_GetParticipantByNitroAddress_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
+526
-24
@@ -6,6 +6,7 @@ package onboarding
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
_ "github.com/cosmos/cosmos-proto"
|
||||
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||
@@ -36,6 +37,8 @@ type MsgOnboardParticipant struct {
|
||||
Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
|
||||
EthPayload EthPayload `protobuf:"bytes,2,opt,name=eth_payload,json=ethPayload,proto3" json:"eth_payload"`
|
||||
EthSignature string `protobuf:"bytes,3,opt,name=eth_signature,json=ethSignature,proto3" json:"eth_signature,omitempty"`
|
||||
Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"`
|
||||
KycId string `protobuf:"bytes,5,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MsgOnboardParticipant) Reset() { *m = MsgOnboardParticipant{} }
|
||||
@@ -92,6 +95,20 @@ func (m *MsgOnboardParticipant) GetEthSignature() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgOnboardParticipant) GetRole() string {
|
||||
if m != nil {
|
||||
return m.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgOnboardParticipant) GetKycId() string {
|
||||
if m != nil {
|
||||
return m.KycId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
|
||||
// type.
|
||||
type MsgOnboardParticipantResponse struct {
|
||||
@@ -130,38 +147,145 @@ func (m *MsgOnboardParticipantResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgOnboardParticipantResponse proto.InternalMessageInfo
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
type MsgUpdateParams struct {
|
||||
// authority is the address that controls the module (defaults to x/gov unless
|
||||
// overwritten).
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the x/bond parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6bfde34a550e231e, []int{2}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6bfde34a550e231e, []int{3}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgOnboardParticipant)(nil), "cerc.onboarding.v1.MsgOnboardParticipant")
|
||||
proto.RegisterType((*MsgOnboardParticipantResponse)(nil), "cerc.onboarding.v1.MsgOnboardParticipantResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "cerc.onboarding.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cerc.onboarding.v1.MsgUpdateParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cerc/onboarding/v1/tx.proto", fileDescriptor_6bfde34a550e231e) }
|
||||
|
||||
var fileDescriptor_6bfde34a550e231e = []byte{
|
||||
// 370 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0x32, 0x41,
|
||||
0x18, 0xc7, 0x77, 0xf4, 0x7d, 0x5f, 0x78, 0xc7, 0x82, 0x58, 0x8a, 0x64, 0xab, 0x55, 0xd6, 0x43,
|
||||
0x2a, 0xb4, 0x83, 0x76, 0xeb, 0x28, 0x78, 0x94, 0xc4, 0x6e, 0x5d, 0x64, 0xdc, 0x1d, 0xc6, 0x01,
|
||||
0x9d, 0x67, 0xd9, 0x99, 0xc4, 0x6e, 0xe1, 0x27, 0x08, 0xfa, 0x08, 0x7d, 0x01, 0xe9, 0xd2, 0x57,
|
||||
0xf0, 0x28, 0x74, 0xe9, 0x14, 0xa1, 0x81, 0x5f, 0x23, 0x5c, 0x35, 0x17, 0xda, 0xa0, 0xdb, 0xcc,
|
||||
0xff, 0xf9, 0xf3, 0xff, 0x3d, 0x7f, 0x1e, 0x7c, 0xe4, 0xb1, 0xd0, 0x23, 0x20, 0x3b, 0x40, 0x43,
|
||||
0x5f, 0x48, 0x4e, 0x06, 0x15, 0xa2, 0x87, 0x6e, 0x10, 0x82, 0x06, 0xd3, 0x5c, 0x0e, 0xdd, 0xed,
|
||||
0xd0, 0x1d, 0x54, 0xac, 0x43, 0x0f, 0x54, 0x1f, 0x14, 0xe9, 0xab, 0xc8, 0xdb, 0x57, 0x7c, 0x65,
|
||||
0xb6, 0x8e, 0x39, 0x00, 0xef, 0x31, 0x42, 0x03, 0x41, 0xa8, 0x94, 0xa0, 0xa9, 0x16, 0x20, 0xd5,
|
||||
0x7a, 0xba, 0xcf, 0x81, 0x43, 0xf4, 0x24, 0xcb, 0xd7, 0x5a, 0x2d, 0x24, 0xd0, 0x63, 0xb8, 0xc8,
|
||||
0xe4, 0x3c, 0x23, 0x7c, 0xd0, 0x50, 0xfc, 0x72, 0xa5, 0x37, 0x69, 0xa8, 0x85, 0x27, 0x02, 0x2a,
|
||||
0xb5, 0x99, 0xc7, 0x99, 0x60, 0xfb, 0xcd, 0xa2, 0x3c, 0x2a, 0xfe, 0x6f, 0xc5, 0x25, 0xb3, 0x8e,
|
||||
0x33, 0x4c, 0x77, 0xdb, 0x01, 0xbd, 0xed, 0x01, 0xf5, 0xb3, 0xa9, 0x3c, 0x2a, 0x66, 0xaa, 0xb6,
|
||||
0xfb, 0xbd, 0x97, 0x5b, 0xd7, 0xdd, 0xe6, 0xca, 0x55, 0xfb, 0x33, 0x79, 0xcb, 0x19, 0x2d, 0xcc,
|
||||
0xbe, 0x14, 0xb3, 0x80, 0x77, 0x97, 0x31, 0x4a, 0x70, 0x49, 0xf5, 0x4d, 0xc8, 0xb2, 0xe9, 0x08,
|
||||
0xb5, 0xc3, 0x74, 0xf7, 0x6a, 0xa3, 0x5d, 0xec, 0x8d, 0x16, 0xe3, 0x72, 0x9c, 0xee, 0xe4, 0xf0,
|
||||
0x49, 0xe2, 0xe2, 0x2d, 0xa6, 0x02, 0x90, 0x8a, 0x55, 0x9f, 0x10, 0x4e, 0x37, 0x14, 0x37, 0x1f,
|
||||
0x11, 0x36, 0x13, 0xfa, 0x95, 0x92, 0x16, 0x4d, 0x4c, 0xb4, 0x2a, 0xbf, 0xb6, 0x6e, 0xe0, 0x0e,
|
||||
0x19, 0xbd, 0x7c, 0x3c, 0xa4, 0x4a, 0xce, 0x29, 0xf9, 0xf9, 0x0a, 0xed, 0x58, 0x1d, 0xeb, 0xef,
|
||||
0xdd, 0x62, 0x5c, 0x46, 0xb5, 0xda, 0x64, 0x66, 0xa3, 0xe9, 0xcc, 0x46, 0xef, 0x33, 0x1b, 0xdd,
|
||||
0xcf, 0x6d, 0x63, 0x3a, 0xb7, 0x8d, 0xd7, 0xb9, 0x6d, 0x5c, 0x17, 0xb9, 0xd0, 0xee, 0xc0, 0xef,
|
||||
0xb8, 0x1a, 0xa2, 0xcc, 0x33, 0x01, 0xa4, 0x47, 0x3d, 0x90, 0xc2, 0xf3, 0xc9, 0x30, 0x46, 0xe8,
|
||||
0xfc, 0x8b, 0x4e, 0x7b, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x28, 0x7c, 0x8d, 0x55, 0x7f, 0x02,
|
||||
// 514 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6a, 0x1b, 0x31,
|
||||
0x18, 0xb5, 0x1c, 0xdb, 0x10, 0x39, 0xfd, 0x41, 0x24, 0x64, 0x32, 0x6d, 0x27, 0xc6, 0x5e, 0xd4,
|
||||
0x49, 0xc9, 0x08, 0xa7, 0x50, 0x4a, 0x76, 0x35, 0x64, 0xd1, 0x85, 0xa9, 0x71, 0xe8, 0xa6, 0x1b,
|
||||
0x57, 0x9e, 0x11, 0xb2, 0x88, 0x2d, 0x0d, 0x92, 0x62, 0xe2, 0x5d, 0xc9, 0x09, 0x0a, 0xe9, 0x0d,
|
||||
0x7a, 0x81, 0x2c, 0x7a, 0x88, 0x2c, 0x43, 0xbb, 0xe9, 0xaa, 0x14, 0xbb, 0x90, 0x6b, 0x94, 0x19,
|
||||
0x8d, 0xe3, 0x69, 0x33, 0x81, 0xec, 0xbe, 0xf9, 0xde, 0xd3, 0xf7, 0xde, 0xf7, 0x46, 0x82, 0x4f,
|
||||
0x02, 0xaa, 0x02, 0x2c, 0xc5, 0x40, 0x12, 0x15, 0x72, 0xc1, 0xf0, 0xa4, 0x85, 0xcd, 0xa9, 0x1f,
|
||||
0x29, 0x69, 0x24, 0x42, 0x31, 0xe8, 0x2f, 0x41, 0x7f, 0xd2, 0x72, 0x37, 0x03, 0xa9, 0xc7, 0x52,
|
||||
0xe3, 0xb1, 0x4e, 0xb8, 0x63, 0xcd, 0x2c, 0xd9, 0x7d, 0xca, 0xa4, 0x64, 0x23, 0x8a, 0x49, 0xc4,
|
||||
0x31, 0x11, 0x42, 0x1a, 0x62, 0xb8, 0x14, 0x3a, 0x45, 0xd7, 0x99, 0x64, 0x32, 0x29, 0x71, 0x5c,
|
||||
0xa5, 0xdd, 0x46, 0x8e, 0x7a, 0x46, 0xce, 0x92, 0xb6, 0xac, 0x62, 0xdf, 0x9e, 0xb6, 0x1f, 0x16,
|
||||
0xaa, 0xcf, 0x00, 0xdc, 0xe8, 0x68, 0xf6, 0xce, 0x1e, 0xe9, 0x12, 0x65, 0x78, 0xc0, 0x23, 0x22,
|
||||
0x0c, 0xaa, 0xc1, 0x6a, 0xb4, 0xfc, 0x74, 0x40, 0x0d, 0x34, 0x57, 0x7b, 0xd9, 0x16, 0x3a, 0x84,
|
||||
0x55, 0x6a, 0x86, 0xfd, 0x88, 0x4c, 0x47, 0x92, 0x84, 0x4e, 0xb1, 0x06, 0x9a, 0xd5, 0x7d, 0xcf,
|
||||
0xbf, 0xbd, 0xb2, 0x7f, 0x68, 0x86, 0x5d, 0xcb, 0x6a, 0x97, 0x2e, 0x7f, 0x6d, 0x17, 0x7a, 0x90,
|
||||
0xde, 0x74, 0x50, 0x03, 0x3e, 0x88, 0xc7, 0x68, 0xce, 0x04, 0x31, 0x27, 0x8a, 0x3a, 0x2b, 0x89,
|
||||
0xd4, 0x1a, 0x35, 0xc3, 0xa3, 0x45, 0x0f, 0x21, 0x58, 0x52, 0x72, 0x44, 0x9d, 0x52, 0x82, 0x25,
|
||||
0x35, 0xda, 0x80, 0x95, 0xe3, 0x69, 0xd0, 0xe7, 0xa1, 0x53, 0x4e, 0xba, 0xe5, 0xe3, 0x69, 0xf0,
|
||||
0x36, 0x3c, 0x78, 0x7c, 0x76, 0x7d, 0xb1, 0x9b, 0x35, 0x5a, 0xdf, 0x86, 0xcf, 0x72, 0x77, 0xec,
|
||||
0x51, 0x1d, 0x49, 0xa1, 0x69, 0xfd, 0x1c, 0xc0, 0x47, 0x1d, 0xcd, 0xde, 0x47, 0x21, 0x31, 0xb4,
|
||||
0x4b, 0x14, 0x19, 0x6b, 0xf4, 0x0a, 0xae, 0x92, 0x13, 0x33, 0x94, 0x8a, 0x9b, 0xa9, 0xdd, 0xbe,
|
||||
0xed, 0x7c, 0xff, 0xb6, 0xb7, 0x9e, 0xc6, 0xf7, 0x26, 0x0c, 0x15, 0xd5, 0xfa, 0xc8, 0x28, 0x2e,
|
||||
0x58, 0x6f, 0x49, 0x45, 0xaf, 0x61, 0x25, 0x4a, 0x26, 0xa4, 0x81, 0xb8, 0x79, 0x81, 0x58, 0x8d,
|
||||
0x34, 0x8c, 0x94, 0x7f, 0xf0, 0x30, 0x36, 0xbe, 0x9c, 0x54, 0xdf, 0x82, 0x9b, 0xff, 0x99, 0x5a,
|
||||
0x18, 0xde, 0xff, 0x52, 0x84, 0x2b, 0x1d, 0xcd, 0xd0, 0x57, 0x00, 0x51, 0xce, 0xbf, 0xdb, 0xc9,
|
||||
0xd3, 0xcc, 0x8d, 0xc0, 0x6d, 0xdd, 0x9b, 0x7a, 0x93, 0x16, 0x3e, 0xfb, 0xf1, 0xe7, 0xbc, 0xb8,
|
||||
0x53, 0x7f, 0x8e, 0xef, 0xbe, 0x7c, 0xfd, 0xec, 0x45, 0xf9, 0x08, 0xd7, 0xfe, 0x89, 0xb6, 0x71,
|
||||
0x87, 0x66, 0x96, 0xe4, 0xbe, 0xb8, 0x07, 0x69, 0x61, 0xc9, 0x2d, 0x7f, 0xba, 0xbe, 0xd8, 0x05,
|
||||
0xed, 0xf6, 0xe5, 0xcc, 0x03, 0x57, 0x33, 0x0f, 0xfc, 0x9e, 0x79, 0xe0, 0xf3, 0xdc, 0x2b, 0x5c,
|
||||
0xcd, 0xbd, 0xc2, 0xcf, 0xb9, 0x57, 0xf8, 0xd0, 0x64, 0xdc, 0xf8, 0x93, 0x70, 0xe0, 0xc7, 0x0f,
|
||||
0x80, 0xaa, 0x60, 0x8f, 0x4b, 0x3c, 0x22, 0x81, 0x14, 0x3c, 0x08, 0xf1, 0x69, 0x66, 0x87, 0x41,
|
||||
0x25, 0x79, 0x18, 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xed, 0xd0, 0x2e, 0xd8, 0x03,
|
||||
0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -179,6 +303,9 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
type MsgClient interface {
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -198,10 +325,22 @@ func (c *msgClient) OnboardParticipant(ctx context.Context, in *MsgOnboardPartic
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error)
|
||||
// UpdateParams defines an operation for updating the x/staking module
|
||||
// parameters.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -211,6 +350,9 @@ type UnimplementedMsgServer struct {
|
||||
func (*UnimplementedMsgServer) OnboardParticipant(ctx context.Context, req *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnboardParticipant not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@@ -234,6 +376,24 @@ func _Msg_OnboardParticipant_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cerc.onboarding.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cerc.onboarding.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
@@ -242,6 +402,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "OnboardParticipant",
|
||||
Handler: _Msg_OnboardParticipant_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cerc/onboarding/v1/tx.proto",
|
||||
@@ -267,6 +431,20 @@ func (m *MsgOnboardParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.KycId) > 0 {
|
||||
i -= len(m.KycId)
|
||||
copy(dAtA[i:], m.KycId)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.KycId)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.Role) > 0 {
|
||||
i -= len(m.Role)
|
||||
copy(dAtA[i:], m.Role)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Role)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.EthSignature) > 0 {
|
||||
i -= len(m.EthSignature)
|
||||
copy(dAtA[i:], m.EthSignature)
|
||||
@@ -317,6 +495,69 @@ func (m *MsgOnboardParticipantResponse) MarshalToSizedBuffer(dAtA []byte) (int,
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTx(v)
|
||||
base := offset
|
||||
@@ -344,6 +585,14 @@ func (m *MsgOnboardParticipant) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = len(m.Role)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = len(m.KycId)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -356,6 +605,30 @@ func (m *MsgOnboardParticipantResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -488,6 +761,70 @@ func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
m.EthSignature = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Role = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.KycId = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
@@ -559,6 +896,171 @@ func (m *MsgOnboardParticipantResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParams) 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 ErrIntOverflowTx
|
||||
}
|
||||
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: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx
|
||||
}
|
||||
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: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -11,21 +11,21 @@ import (
|
||||
// Default parameter values.
|
||||
var (
|
||||
// DefaultRecordRent is the default record rent for 1 time period (see expiry time).
|
||||
DefaultRecordRent = sdkmath.NewInt(1000000)
|
||||
DefaultRecordRent = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
|
||||
// DefaultRecordExpiryTime is the default record expiry time (1 year).
|
||||
DefaultRecordExpiryTime = time.Hour * 24 * 365
|
||||
|
||||
DefaultAuthorityRent = sdkmath.NewInt(1000000)
|
||||
DefaultAuthorityRent = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultAuthorityExpiryTime = time.Hour * 24 * 365
|
||||
DefaultAuthorityGracePeriod = time.Hour * 24 * 2
|
||||
|
||||
DefaultAuthorityAuctionEnabled = false
|
||||
DefaultCommitsDuration = time.Hour * 24
|
||||
DefaultRevealsDuration = time.Hour * 24
|
||||
DefaultCommitFee = sdkmath.NewInt(1000000)
|
||||
DefaultRevealFee = sdkmath.NewInt(1000000)
|
||||
DefaultMinimumBid = sdkmath.NewInt(5000000)
|
||||
DefaultCommitFee = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultRevealFee = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultMinimumBid = sdkmath.NewInt(5000000) // 5 * 10^6 alnt
|
||||
)
|
||||
|
||||
// NewParams creates a new Params instance
|
||||
|
||||
Reference in New Issue
Block a user