forked from cerc-io/laconicd
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07297a27d1 | ||
|
|
d3a06319ce | ||
|
|
973bf51573 | ||
|
|
aee4758538 | ||
|
|
c3854c30cf | ||
|
|
65957d6199 | ||
|
|
c807a9db80 | ||
|
|
3a551bce99 | ||
|
|
6f75370b17 | ||
|
|
52e8d322fa | ||
|
|
df43322ef3 | ||
|
|
94ba057807 | ||
|
|
a01a5d24d1 | ||
|
|
debfb82205 | ||
|
|
3c5cd002e1 | ||
|
|
b5a76a920e | ||
|
|
f176a5889e | ||
|
|
5e7d5fc47c | ||
|
|
c162396298 | ||
|
|
7a88c82816 | ||
|
|
9fab3f8326 | ||
|
|
ec6e2f3776 | ||
|
|
eb20f77e83 | ||
|
|
43b675cc0a | ||
|
|
b2be09e0e4 | ||
|
|
456491a4f2 | ||
|
|
d36f54543d | ||
|
|
a8a59ad0c1 | ||
|
|
f23f691646 | ||
|
|
8c14d578f7 | ||
|
|
582c83543c | ||
|
|
a21e9ea387 | ||
|
|
7369264f0a |
+19
-17
@@ -8,20 +8,22 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
golangci:
|
# TODO: Handle CI error: "::error::golangci-lint exit with code 137" and uncomment lint job
|
||||||
name: Run golangci-lint
|
|
||||||
runs-on: ubuntu-latest
|
# golangci:
|
||||||
timeout-minutes: 10
|
# name: Run golangci-lint
|
||||||
steps:
|
# runs-on: ubuntu-latest
|
||||||
# Required: setup-go, for all versions v3.0.0+ of golangci-lint
|
# timeout-minutes: 10
|
||||||
- uses: actions/setup-go@v3
|
# steps:
|
||||||
with:
|
# # Required: setup-go, for all versions v3.0.0+ of golangci-lint
|
||||||
go-version: 1.21
|
# - uses: actions/setup-go@v3
|
||||||
check-latest: true
|
# with:
|
||||||
- uses: actions/checkout@v3
|
# go-version: 1.21
|
||||||
- uses: golangci/golangci-lint-action@v3.3.1
|
# check-latest: true
|
||||||
with:
|
# - uses: actions/checkout@v3
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# - uses: golangci/golangci-lint-action@v3.3.1
|
||||||
version: latest
|
# with:
|
||||||
args: --timeout 10m
|
# # Required: the version of golangci-lint is required and must be specified without patch version
|
||||||
github-token: ${{ secrets.github_token }}
|
# version: v1.51
|
||||||
|
# args: --timeout 10m
|
||||||
|
# github-token: ${{ secrets.github_token }}
|
||||||
|
|||||||
+3
-3
@@ -7,7 +7,7 @@ on:
|
|||||||
- release/**
|
- release/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sdk_tests_auctions:
|
sdk_tests_authority_auctions:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -35,6 +35,6 @@ jobs:
|
|||||||
TEST_AUCTION_ENABLED: true
|
TEST_AUCTION_ENABLED: true
|
||||||
run: docker compose up -d
|
run: docker compose up -d
|
||||||
|
|
||||||
- name: Run auction tests
|
- name: Run authority auction tests
|
||||||
working-directory: tests/sdk_tests
|
working-directory: tests/sdk_tests
|
||||||
run: ./run-tests.sh test:auctions
|
run: ./run-tests.sh test:authority-auctions
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
run:
|
||||||
|
tests: false
|
||||||
|
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
||||||
|
# timeout: 5m
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- bodyclose
|
||||||
|
- dogsled
|
||||||
|
- errcheck
|
||||||
|
- goconst
|
||||||
|
- gocritic
|
||||||
|
# - revive # overly sensitive var-naming detection
|
||||||
|
- gosec
|
||||||
|
- gosimple
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- lll
|
||||||
|
- misspell
|
||||||
|
- nakedret
|
||||||
|
- prealloc
|
||||||
|
- exportloopref
|
||||||
|
- staticcheck
|
||||||
|
- stylecheck
|
||||||
|
- typecheck
|
||||||
|
- unconvert
|
||||||
|
- unparam
|
||||||
|
- unused
|
||||||
|
- asciicheck
|
||||||
|
- exportloopref
|
||||||
|
- gofumpt
|
||||||
|
- gomodguard
|
||||||
|
- whitespace
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
- path: _test\.go
|
||||||
|
linters:
|
||||||
|
- gosec
|
||||||
|
- linters:
|
||||||
|
- lll
|
||||||
|
source: "https://"
|
||||||
|
- linters:
|
||||||
|
- stylecheck
|
||||||
|
text: "ST1003:"
|
||||||
|
max-same-issues: 50
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
lll:
|
||||||
|
line-length: 150
|
||||||
|
dogsled:
|
||||||
|
max-blank-identifiers: 3
|
||||||
|
golint:
|
||||||
|
min-confidence: 0
|
||||||
|
maligned:
|
||||||
|
suggest-new: true
|
||||||
|
misspell:
|
||||||
|
locale: US
|
||||||
|
gofumpt:
|
||||||
|
lang-version: "1.21"
|
||||||
|
gomodguard:
|
||||||
|
blocked:
|
||||||
|
versions: # List of blocked module version constraints
|
||||||
|
- https://github.com/etcd-io/etcd: # Blocked module with version constraint
|
||||||
|
version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
|
||||||
|
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
|
||||||
|
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
|
||||||
|
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
|
||||||
|
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
|
||||||
+4
-1
@@ -19,12 +19,15 @@ FROM ubuntu:22.04
|
|||||||
# Install ca-certificates, jq, curl, bash, and other necessary packages
|
# Install ca-certificates, jq, curl, bash, and other necessary packages
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
jq curl netcat bash \
|
jq curl netcat bash bc \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy over binary from the builder
|
# Copy over binary from the builder
|
||||||
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
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 /
|
WORKDIR /
|
||||||
|
|
||||||
# Run laconicd by default
|
# Run laconicd by default
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
md_Module protoreflect.MessageDescriptor
|
md_Module protoreflect.MessageDescriptor
|
||||||
|
fd_Module_authority protoreflect.FieldDescriptor
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
file_cerc_auction_module_v1_module_proto_init()
|
file_cerc_auction_module_v1_module_proto_init()
|
||||||
md_Module = File_cerc_auction_module_v1_module_proto.Messages().ByName("Module")
|
md_Module = File_cerc_auction_module_v1_module_proto.Messages().ByName("Module")
|
||||||
|
fd_Module_authority = md_Module.Fields().ByName("authority")
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
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
|
// While iterating, mutating operations may only be performed
|
||||||
// on the current field descriptor.
|
// on the current field descriptor.
|
||||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
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.
|
// 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.
|
// a repeated field is populated if it is non-empty.
|
||||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
return x.Authority != ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.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.
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
x.Authority = ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.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.
|
// of the value; to obtain a mutable reference, use Mutable.
|
||||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch descriptor.FullName() {
|
switch descriptor.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
value := x.Authority
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
default:
|
default:
|
||||||
if descriptor.IsExtension() {
|
if descriptor.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.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.
|
// Set is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
x.Authority = value.Interface().(string)
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.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.
|
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
panic(fmt.Errorf("field authority of message cerc.auction.module.v1.Module is not mutable"))
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.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.
|
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.auction.module.v1.Module.authority":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.module.v1.Module"))
|
||||||
@@ -256,6 +277,10 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|||||||
var n int
|
var n int
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
l = len(x.Authority)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
if x.unknownFields != nil {
|
if x.unknownFields != nil {
|
||||||
n += len(x.unknownFields)
|
n += len(x.unknownFields)
|
||||||
}
|
}
|
||||||
@@ -285,6 +310,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|||||||
i -= len(x.unknownFields)
|
i -= len(x.unknownFields)
|
||||||
copy(dAtA[i:], 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 {
|
if input.Buf != nil {
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
} else {
|
} 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)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
@@ -388,6 +452,10 @@ type Module struct {
|
|||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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() {
|
func (x *Module) Reset() {
|
||||||
@@ -410,6 +478,13 @@ func (*Module) Descriptor() ([]byte, []int) {
|
|||||||
return file_cerc_auction_module_v1_module_proto_rawDescGZIP(), []int{0}
|
return file_cerc_auction_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Module) GetAuthority() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Authority
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_cerc_auction_module_v1_module_proto protoreflect.FileDescriptor
|
var File_cerc_auction_module_v1_module_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_cerc_auction_module_v1_module_proto_rawDesc = []byte{
|
var file_cerc_auction_module_v1_module_proto_rawDesc = []byte{
|
||||||
@@ -419,25 +494,27 @@ var file_cerc_auction_module_v1_module_proto_rawDesc = []byte{
|
|||||||
0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63,
|
0x69, 0x6f, 0x6e, 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,
|
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,
|
0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||||
0x37, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2d, 0xba, 0xc0, 0x96, 0xda, 0x01,
|
0x55, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74,
|
||||||
0x27, 0x0a, 0x25, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65,
|
0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75,
|
||||||
0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78,
|
0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x2d, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x27, 0x0a,
|
||||||
0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xe5, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d,
|
0x25, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63,
|
||||||
0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f,
|
0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78, 0x2f, 0x61,
|
||||||
0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50,
|
0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xe5, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e,
|
0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e,
|
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f,
|
||||||
0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63,
|
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d,
|
0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63,
|
||||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x4d, 0xaa, 0x02, 0x16,
|
0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69,
|
||||||
0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64,
|
0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64,
|
||||||
0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75,
|
0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x4d, 0xaa, 0x02, 0x16, 0x43, 0x65,
|
||||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2,
|
0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
0x02, 0x22, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d,
|
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74,
|
||||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22,
|
||||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63,
|
0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31,
|
0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69,
|
||||||
|
0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+2453
-180
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,8 @@ const (
|
|||||||
Msg_CreateAuction_FullMethodName = "/cerc.auction.v1.Msg/CreateAuction"
|
Msg_CreateAuction_FullMethodName = "/cerc.auction.v1.Msg/CreateAuction"
|
||||||
Msg_CommitBid_FullMethodName = "/cerc.auction.v1.Msg/CommitBid"
|
Msg_CommitBid_FullMethodName = "/cerc.auction.v1.Msg/CommitBid"
|
||||||
Msg_RevealBid_FullMethodName = "/cerc.auction.v1.Msg/RevealBid"
|
Msg_RevealBid_FullMethodName = "/cerc.auction.v1.Msg/RevealBid"
|
||||||
|
Msg_UpdateParams_FullMethodName = "/cerc.auction.v1.Msg/UpdateParams"
|
||||||
|
Msg_ReleaseFunds_FullMethodName = "/cerc.auction.v1.Msg/ReleaseFunds"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
// MsgClient is the client API for Msg service.
|
||||||
@@ -34,6 +36,11 @@ type MsgClient interface {
|
|||||||
CommitBid(ctx context.Context, in *MsgCommitBid, opts ...grpc.CallOption) (*MsgCommitBidResponse, error)
|
CommitBid(ctx context.Context, in *MsgCommitBid, opts ...grpc.CallOption) (*MsgCommitBidResponse, error)
|
||||||
// RevealBid is the command for revealing a bid
|
// RevealBid is the command for revealing a bid
|
||||||
RevealBid(ctx context.Context, in *MsgRevealBid, opts ...grpc.CallOption) (*MsgRevealBidResponse, error)
|
RevealBid(ctx context.Context, in *MsgRevealBid, opts ...grpc.CallOption) (*MsgRevealBidResponse, error)
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
|
// ReleaseFunds is the command for paying the winners of provider auctions
|
||||||
|
ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type msgClient struct {
|
type msgClient struct {
|
||||||
@@ -71,6 +78,24 @@ func (c *msgClient) RevealBid(ctx context.Context, in *MsgRevealBid, opts ...grp
|
|||||||
return out, nil
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error) {
|
||||||
|
out := new(MsgReleaseFundsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_ReleaseFunds_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// MsgServer is the server API for Msg service.
|
// MsgServer is the server API for Msg service.
|
||||||
// All implementations must embed UnimplementedMsgServer
|
// All implementations must embed UnimplementedMsgServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@@ -81,6 +106,11 @@ type MsgServer interface {
|
|||||||
CommitBid(context.Context, *MsgCommitBid) (*MsgCommitBidResponse, error)
|
CommitBid(context.Context, *MsgCommitBid) (*MsgCommitBidResponse, error)
|
||||||
// RevealBid is the command for revealing a bid
|
// RevealBid is the command for revealing a bid
|
||||||
RevealBid(context.Context, *MsgRevealBid) (*MsgRevealBidResponse, error)
|
RevealBid(context.Context, *MsgRevealBid) (*MsgRevealBidResponse, error)
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
|
// ReleaseFunds is the command for paying the winners of provider auctions
|
||||||
|
ReleaseFunds(context.Context, *MsgReleaseFunds) (*MsgReleaseFundsResponse, error)
|
||||||
mustEmbedUnimplementedMsgServer()
|
mustEmbedUnimplementedMsgServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +127,12 @@ func (UnimplementedMsgServer) CommitBid(context.Context, *MsgCommitBid) (*MsgCom
|
|||||||
func (UnimplementedMsgServer) RevealBid(context.Context, *MsgRevealBid) (*MsgRevealBidResponse, error) {
|
func (UnimplementedMsgServer) RevealBid(context.Context, *MsgRevealBid) (*MsgRevealBidResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method RevealBid not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method RevealBid not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMsgServer) ReleaseFunds(context.Context, *MsgReleaseFunds) (*MsgReleaseFundsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ReleaseFunds not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||||
@@ -164,6 +200,42 @@ func _Msg_RevealBid_Handler(srv interface{}, ctx context.Context, dec func(inter
|
|||||||
return interceptor(ctx, in, info, handler)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_ReleaseFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgReleaseFunds)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).ReleaseFunds(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_ReleaseFunds_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).ReleaseFunds(ctx, req.(*MsgReleaseFunds))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -183,6 +255,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "RevealBid",
|
MethodName: "RevealBid",
|
||||||
Handler: _Msg_RevealBid_Handler,
|
Handler: _Msg_RevealBid_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ReleaseFunds",
|
||||||
|
Handler: _Msg_ReleaseFunds_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cerc/auction/v1/tx.proto",
|
Metadata: "cerc/auction/v1/tx.proto",
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
md_Module protoreflect.MessageDescriptor
|
md_Module protoreflect.MessageDescriptor
|
||||||
|
fd_Module_authority protoreflect.FieldDescriptor
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
file_cerc_bond_module_v1_module_proto_init()
|
file_cerc_bond_module_v1_module_proto_init()
|
||||||
md_Module = File_cerc_bond_module_v1_module_proto.Messages().ByName("Module")
|
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)
|
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
|
// While iterating, mutating operations may only be performed
|
||||||
// on the current field descriptor.
|
// on the current field descriptor.
|
||||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
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.
|
// 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.
|
// a repeated field is populated if it is non-empty.
|
||||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.bond.module.v1.Module.authority":
|
||||||
|
return x.Authority != ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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.
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.bond.module.v1.Module.authority":
|
||||||
|
x.Authority = ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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.
|
// of the value; to obtain a mutable reference, use Mutable.
|
||||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch descriptor.FullName() {
|
switch descriptor.FullName() {
|
||||||
|
case "cerc.bond.module.v1.Module.authority":
|
||||||
|
value := x.Authority
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
default:
|
default:
|
||||||
if descriptor.IsExtension() {
|
if descriptor.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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.
|
// Set is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.bond.module.v1.Module.authority":
|
||||||
|
x.Authority = value.Interface().(string)
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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.
|
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
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:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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.
|
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.bond.module.v1.Module.authority":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.bond.module.v1.Module"))
|
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 n int
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
l = len(x.Authority)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
if x.unknownFields != nil {
|
if x.unknownFields != nil {
|
||||||
n += len(x.unknownFields)
|
n += len(x.unknownFields)
|
||||||
}
|
}
|
||||||
@@ -285,6 +310,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|||||||
i -= len(x.unknownFields)
|
i -= len(x.unknownFields)
|
||||||
copy(dAtA[i:], 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 {
|
if input.Buf != nil {
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
} else {
|
} 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)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
@@ -388,6 +452,10 @@ type Module struct {
|
|||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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() {
|
func (x *Module) Reset() {
|
||||||
@@ -410,6 +478,13 @@ func (*Module) Descriptor() ([]byte, []int) {
|
|||||||
return file_cerc_bond_module_v1_module_proto_rawDescGZIP(), []int{0}
|
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 protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_cerc_bond_module_v1_module_proto_rawDesc = []byte{
|
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,
|
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,
|
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,
|
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, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x06, 0x4d, 0x6f, 0x64,
|
||||||
0x75, 0x6c, 0x65, 0x3a, 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74,
|
0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79,
|
||||||
0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
|
||||||
0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78, 0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x42,
|
0x79, 0x3a, 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, 0x2e, 0x76,
|
||||||
0xd3, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x62, 0x6f, 0x6e,
|
0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61,
|
||||||
0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64,
|
0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78, 0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x42, 0xd3, 0x01,
|
||||||
0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e,
|
0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x62, 0x6f, 0x6e, 0x64, 0x2e,
|
||||||
0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c,
|
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63,
|
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64,
|
||||||
0x2f, 0x62, 0x6f, 0x6e, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b,
|
0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63,
|
||||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02,
|
0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x62,
|
||||||
0x13, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
0x6f, 0x6e, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f,
|
||||||
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64,
|
0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02, 0x13, 0x43,
|
||||||
0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x65, 0x72,
|
0x65, 0x72, 0x63, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e,
|
||||||
0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31,
|
0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d,
|
||||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43,
|
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x65, 0x72, 0x63, 0x5c,
|
||||||
0x65, 0x72, 0x63, 0x3a, 0x3a, 0x42, 0x6f, 0x6e, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
0x42, 0x6f, 0x6e, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47,
|
||||||
0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
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_RefillBond_FullMethodName = "/cerc.bond.v1.Msg/RefillBond"
|
||||||
Msg_WithdrawBond_FullMethodName = "/cerc.bond.v1.Msg/WithdrawBond"
|
Msg_WithdrawBond_FullMethodName = "/cerc.bond.v1.Msg/WithdrawBond"
|
||||||
Msg_CancelBond_FullMethodName = "/cerc.bond.v1.Msg/CancelBond"
|
Msg_CancelBond_FullMethodName = "/cerc.bond.v1.Msg/CancelBond"
|
||||||
|
Msg_UpdateParams_FullMethodName = "/cerc.bond.v1.Msg/UpdateParams"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
// 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)
|
WithdrawBond(ctx context.Context, in *MsgWithdrawBond, opts ...grpc.CallOption) (*MsgWithdrawBondResponse, error)
|
||||||
// CancelBond defines a method for cancelling a bond.
|
// CancelBond defines a method for cancelling a bond.
|
||||||
CancelBond(ctx context.Context, in *MsgCancelBond, opts ...grpc.CallOption) (*MsgCancelBondResponse, error)
|
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 {
|
type msgClient struct {
|
||||||
@@ -83,6 +87,15 @@ func (c *msgClient) CancelBond(ctx context.Context, in *MsgCancelBond, opts ...g
|
|||||||
return out, nil
|
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.
|
// MsgServer is the server API for Msg service.
|
||||||
// All implementations must embed UnimplementedMsgServer
|
// All implementations must embed UnimplementedMsgServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@@ -95,6 +108,9 @@ type MsgServer interface {
|
|||||||
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
||||||
// CancelBond defines a method for cancelling a bond.
|
// CancelBond defines a method for cancelling a bond.
|
||||||
CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error)
|
CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error)
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
mustEmbedUnimplementedMsgServer()
|
mustEmbedUnimplementedMsgServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +130,9 @@ func (UnimplementedMsgServer) WithdrawBond(context.Context, *MsgWithdrawBond) (*
|
|||||||
func (UnimplementedMsgServer) CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error) {
|
func (UnimplementedMsgServer) CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CancelBond not implemented")
|
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() {}
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
// 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)
|
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.
|
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -222,6 +259,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "CancelBond",
|
MethodName: "CancelBond",
|
||||||
Handler: _Msg_CancelBond_Handler,
|
Handler: _Msg_CancelBond_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cerc/bond/v1/tx.proto",
|
Metadata: "cerc/bond/v1/tx.proto",
|
||||||
|
|||||||
@@ -0,0 +1,581 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package modulev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
|
||||||
|
fmt "fmt"
|
||||||
|
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
io "io"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
md_Module protoreflect.MessageDescriptor
|
||||||
|
fd_Module_authority protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_init()
|
||||||
|
md_Module = File_cerc_onboarding_module_v1_module_proto.Messages().ByName("Module")
|
||||||
|
fd_Module_authority = md_Module.Fields().ByName("authority")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
||||||
|
|
||||||
|
type fastReflection_Module Module
|
||||||
|
|
||||||
|
func (x *Module) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_Module)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_cerc_onboarding_module_v1_module_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _fastReflection_Module_messageType fastReflection_Module_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_Module_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_Module)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Module_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Module)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Module
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Module
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type returns the message type, which encapsulates both Go and protobuf
|
||||||
|
// type information. If the Go type information is not needed,
|
||||||
|
// it is recommended that the message descriptor be used instead.
|
||||||
|
func (x *fastReflection_Module) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_Module_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_Module) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Module)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*Module)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Range iterates over every populated field in an undefined order,
|
||||||
|
// calling f for each field descriptor and value encountered.
|
||||||
|
// Range returns immediately if f returns false.
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
// Some fields have the property of nullability where it is possible to
|
||||||
|
// distinguish between the default value of a field and whether the field
|
||||||
|
// was explicitly populated with the default value. Singular message fields,
|
||||||
|
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||||
|
// fields are populated only if explicitly set.
|
||||||
|
//
|
||||||
|
// In other cases (aside from the nullable cases above),
|
||||||
|
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||||
|
// a repeated field is populated if it is non-empty.
|
||||||
|
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.module.v1.Module.authority":
|
||||||
|
return x.Authority != ""
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear clears the field such that a subsequent Has call reports false.
|
||||||
|
//
|
||||||
|
// Clearing an extension field clears both the extension type and value
|
||||||
|
// associated with the given field number.
|
||||||
|
//
|
||||||
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.module.v1.Module.authority":
|
||||||
|
x.Authority = ""
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves the value for a field.
|
||||||
|
//
|
||||||
|
// For unpopulated scalars, it returns the default value, where
|
||||||
|
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||||
|
// For unpopulated composite types, it returns an empty, read-only view
|
||||||
|
// 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.onboarding.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.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", descriptor.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set stores the value for a field.
|
||||||
|
//
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||||
|
// When setting a composite type, it is unspecified whether the stored value
|
||||||
|
// aliases the source's memory in any way. If the composite value is an
|
||||||
|
// empty, read-only value, then it panics.
|
||||||
|
//
|
||||||
|
// 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.onboarding.module.v1.Module.authority":
|
||||||
|
x.Authority = value.Interface().(string)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mutable returns a mutable reference to a composite type.
|
||||||
|
//
|
||||||
|
// If the field is unpopulated, it may allocate a composite value.
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType
|
||||||
|
// if not already stored.
|
||||||
|
// It panics if the field does not contain a composite type.
|
||||||
|
//
|
||||||
|
// 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.onboarding.module.v1.Module.authority":
|
||||||
|
panic(fmt.Errorf("field authority of message cerc.onboarding.module.v1.Module is not mutable"))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewField returns a new value that is assignable to the field
|
||||||
|
// for the given descriptor. For scalars, this returns the default value.
|
||||||
|
// 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.onboarding.module.v1.Module.authority":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WhichOneof reports which field within the oneof is populated,
|
||||||
|
// returning nil if none are populated.
|
||||||
|
// It panics if the oneof descriptor does not belong to this message.
|
||||||
|
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.module.v1.Module", d.FullName()))
|
||||||
|
}
|
||||||
|
panic("unreachable")
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUnknown retrieves the entire list of unknown fields.
|
||||||
|
// The caller may only mutate the contents of the RawFields
|
||||||
|
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||||
|
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
|
||||||
|
return x.unknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUnknown stores an entire list of unknown fields.
|
||||||
|
// The raw fields must be syntactically valid according to the wire format.
|
||||||
|
// An implementation may panic if this is not the case.
|
||||||
|
// Once stored, the caller must not mutate the content of the RawFields.
|
||||||
|
// An empty RawFields may be passed to clear the fields.
|
||||||
|
//
|
||||||
|
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
|
||||||
|
x.unknownFields = fields
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsValid reports whether the message is valid.
|
||||||
|
//
|
||||||
|
// An invalid message is an empty, read-only value.
|
||||||
|
//
|
||||||
|
// An invalid message often corresponds to a nil pointer of the concrete
|
||||||
|
// message type, but the details are implementation dependent.
|
||||||
|
// Validity is not part of the protobuf data model, and may not
|
||||||
|
// be preserved in marshaling or other operations.
|
||||||
|
func (x *fastReflection_Module) IsValid() bool {
|
||||||
|
return x != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||||
|
// This method may return nil.
|
||||||
|
//
|
||||||
|
// The returned methods type is identical to
|
||||||
|
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||||
|
// Consult the protoiface package documentation for details.
|
||||||
|
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*Module)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options := runtime.SizeInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: n,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*Module)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.MarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
size := options.Size(x)
|
||||||
|
dAtA := make([]byte, size)
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if x.unknownFields != nil {
|
||||||
|
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] = 0xa
|
||||||
|
}
|
||||||
|
if input.Buf != nil {
|
||||||
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
|
} else {
|
||||||
|
input.Buf = dAtA
|
||||||
|
}
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*Module)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.UnmarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Flags: input.Flags,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.UnmarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
dAtA := input.Buf
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire 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++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
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:])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if !options.DiscardUnknown {
|
||||||
|
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||||
|
}
|
||||||
|
return &protoiface.Methods{
|
||||||
|
NoUnkeyedLiterals: struct{}{},
|
||||||
|
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||||
|
Size: size,
|
||||||
|
Marshal: marshal,
|
||||||
|
Unmarshal: unmarshal,
|
||||||
|
Merge: nil,
|
||||||
|
CheckInitialized: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: cerc/onboarding/module/v1/module.proto
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Module is the app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
type Module struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) Reset() {
|
||||||
|
*x = Module{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_cerc_onboarding_module_v1_module_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Module) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Module) Descriptor() ([]byte, []int) {
|
||||||
|
return file_cerc_onboarding_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) GetAuthority() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Authority
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_cerc_onboarding_module_v1_module_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_cerc_onboarding_module_v1_module_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x26, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e,
|
||||||
|
0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
|
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f,
|
||||||
|
0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 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, 0x58, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12,
|
||||||
|
0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x30, 0xba,
|
||||||
|
0xc0, 0x96, 0xda, 0x01, 0x2a, 0x0a, 0x28, 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, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x42,
|
||||||
|
0xf7, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62,
|
||||||
|
0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 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, 0x42, 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, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
|
0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x4d, 0xaa, 0x02, 0x19, 0x43, 0x65, 0x72,
|
||||||
|
0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x6f, 0x64,
|
||||||
|
0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e,
|
||||||
|
0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c,
|
||||||
|
0x56, 0x31, 0xe2, 0x02, 0x25, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72,
|
||||||
|
0x64, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47,
|
||||||
|
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x43, 0x65, 0x72,
|
||||||
|
0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d,
|
||||||
|
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_rawDescOnce sync.Once
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_rawDescData = file_cerc_onboarding_module_v1_module_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_cerc_onboarding_module_v1_module_proto_rawDescGZIP() []byte {
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_rawDescOnce.Do(func() {
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_module_v1_module_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_cerc_onboarding_module_v1_module_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_cerc_onboarding_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_cerc_onboarding_module_v1_module_proto_goTypes = []interface{}{
|
||||||
|
(*Module)(nil), // 0: cerc.onboarding.module.v1.Module
|
||||||
|
}
|
||||||
|
var file_cerc_onboarding_module_v1_module_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_cerc_onboarding_module_v1_module_proto_init() }
|
||||||
|
func file_cerc_onboarding_module_v1_module_proto_init() {
|
||||||
|
if File_cerc_onboarding_module_v1_module_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Module); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_cerc_onboarding_module_v1_module_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_cerc_onboarding_module_v1_module_proto_goTypes,
|
||||||
|
DependencyIndexes: file_cerc_onboarding_module_v1_module_proto_depIdxs,
|
||||||
|
MessageInfos: file_cerc_onboarding_module_v1_module_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_cerc_onboarding_module_v1_module_proto = out.File
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_rawDesc = nil
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_goTypes = nil
|
||||||
|
file_cerc_onboarding_module_v1_module_proto_depIdxs = nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,750 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package onboardingv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
io "io"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ protoreflect.List = (*_GenesisState_2_list)(nil)
|
||||||
|
|
||||||
|
type _GenesisState_2_list struct {
|
||||||
|
list *[]*Participant
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) Len() int {
|
||||||
|
if x.list == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return len(*x.list)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) Get(i int) protoreflect.Value {
|
||||||
|
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.Message()
|
||||||
|
concreteValue := valueUnwrapped.Interface().(*Participant)
|
||||||
|
(*x.list)[i] = concreteValue
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) Append(value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.Message()
|
||||||
|
concreteValue := valueUnwrapped.Interface().(*Participant)
|
||||||
|
*x.list = append(*x.list, concreteValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value {
|
||||||
|
v := new(Participant)
|
||||||
|
*x.list = append(*x.list, v)
|
||||||
|
return protoreflect.ValueOfMessage(v.ProtoReflect())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) Truncate(n int) {
|
||||||
|
for i := n; i < len(*x.list); i++ {
|
||||||
|
(*x.list)[i] = nil
|
||||||
|
}
|
||||||
|
*x.list = (*x.list)[:n]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) NewElement() protoreflect.Value {
|
||||||
|
v := new(Participant)
|
||||||
|
return protoreflect.ValueOfMessage(v.ProtoReflect())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_GenesisState_2_list) IsValid() bool {
|
||||||
|
return x.list != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
md_GenesisState protoreflect.MessageDescriptor
|
||||||
|
fd_GenesisState_params protoreflect.FieldDescriptor
|
||||||
|
fd_GenesisState_participants protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_init()
|
||||||
|
md_GenesisState = File_cerc_onboarding_v1_genesis_proto.Messages().ByName("GenesisState")
|
||||||
|
fd_GenesisState_params = md_GenesisState.Fields().ByName("params")
|
||||||
|
fd_GenesisState_participants = md_GenesisState.Fields().ByName("participants")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_GenesisState)(nil)
|
||||||
|
|
||||||
|
type fastReflection_GenesisState GenesisState
|
||||||
|
|
||||||
|
func (x *GenesisState) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_GenesisState)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GenesisState) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_cerc_onboarding_v1_genesis_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_GenesisState_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_GenesisState)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_GenesisState_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_GenesisState)
|
||||||
|
}
|
||||||
|
func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_GenesisState
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_GenesisState
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type returns the message type, which encapsulates both Go and protobuf
|
||||||
|
// type information. If the Go type information is not needed,
|
||||||
|
// it is recommended that the message descriptor be used instead.
|
||||||
|
func (x *fastReflection_GenesisState) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_GenesisState_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_GenesisState) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_GenesisState)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*GenesisState)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Range iterates over every populated field in an undefined order,
|
||||||
|
// calling f for each field descriptor and value encountered.
|
||||||
|
// Range returns immediately if f returns false.
|
||||||
|
// While iterating, mutating operations may only be performed
|
||||||
|
// on the current field descriptor.
|
||||||
|
func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||||
|
if x.Params != nil {
|
||||||
|
value := protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||||
|
if !f(fd_GenesisState_params, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(x.Participants) != 0 {
|
||||||
|
value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Participants})
|
||||||
|
if !f(fd_GenesisState_participants, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Has reports whether a field is populated.
|
||||||
|
//
|
||||||
|
// Some fields have the property of nullability where it is possible to
|
||||||
|
// distinguish between the default value of a field and whether the field
|
||||||
|
// was explicitly populated with the default value. Singular message fields,
|
||||||
|
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||||
|
// fields are populated only if explicitly set.
|
||||||
|
//
|
||||||
|
// In other cases (aside from the nullable cases above),
|
||||||
|
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||||
|
// a repeated field is populated if it is non-empty.
|
||||||
|
func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
return x.Params != nil
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
return len(x.Participants) != 0
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear clears the field such that a subsequent Has call reports false.
|
||||||
|
//
|
||||||
|
// Clearing an extension field clears both the extension type and value
|
||||||
|
// associated with the given field number.
|
||||||
|
//
|
||||||
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
x.Params = nil
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
x.Participants = nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves the value for a field.
|
||||||
|
//
|
||||||
|
// For unpopulated scalars, it returns the default value, where
|
||||||
|
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||||
|
// For unpopulated composite types, it returns an empty, read-only view
|
||||||
|
// of the value; to obtain a mutable reference, use Mutable.
|
||||||
|
func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch descriptor.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
value := x.Params
|
||||||
|
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
if len(x.Participants) == 0 {
|
||||||
|
return protoreflect.ValueOfList(&_GenesisState_2_list{})
|
||||||
|
}
|
||||||
|
listValue := &_GenesisState_2_list{list: &x.Participants}
|
||||||
|
return protoreflect.ValueOfList(listValue)
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", descriptor.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set stores the value for a field.
|
||||||
|
//
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||||
|
// When setting a composite type, it is unspecified whether the stored value
|
||||||
|
// aliases the source's memory in any way. If the composite value is an
|
||||||
|
// empty, read-only value, then it panics.
|
||||||
|
//
|
||||||
|
// Set is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
x.Params = value.Message().Interface().(*Params)
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
lv := value.List()
|
||||||
|
clv := lv.(*_GenesisState_2_list)
|
||||||
|
x.Participants = *clv.list
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mutable returns a mutable reference to a composite type.
|
||||||
|
//
|
||||||
|
// If the field is unpopulated, it may allocate a composite value.
|
||||||
|
// For a field belonging to a oneof, it implicitly clears any other field
|
||||||
|
// that may be currently set within the same oneof.
|
||||||
|
// For extension fields, it implicitly stores the provided ExtensionType
|
||||||
|
// if not already stored.
|
||||||
|
// It panics if the field does not contain a composite type.
|
||||||
|
//
|
||||||
|
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
if x.Params == nil {
|
||||||
|
x.Params = new(Params)
|
||||||
|
}
|
||||||
|
return protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
if x.Participants == nil {
|
||||||
|
x.Participants = []*Participant{}
|
||||||
|
}
|
||||||
|
value := &_GenesisState_2_list{list: &x.Participants}
|
||||||
|
return protoreflect.ValueOfList(value)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewField returns a new value that is assignable to the field
|
||||||
|
// for the given descriptor. For scalars, this returns the default value.
|
||||||
|
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||||
|
func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "cerc.onboarding.v1.GenesisState.params":
|
||||||
|
m := new(Params)
|
||||||
|
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||||
|
case "cerc.onboarding.v1.GenesisState.participants":
|
||||||
|
list := []*Participant{}
|
||||||
|
return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list})
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WhichOneof reports which field within the oneof is populated,
|
||||||
|
// returning nil if none are populated.
|
||||||
|
// It panics if the oneof descriptor does not belong to this message.
|
||||||
|
func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.GenesisState", d.FullName()))
|
||||||
|
}
|
||||||
|
panic("unreachable")
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUnknown retrieves the entire list of unknown fields.
|
||||||
|
// The caller may only mutate the contents of the RawFields
|
||||||
|
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||||
|
func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields {
|
||||||
|
return x.unknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUnknown stores an entire list of unknown fields.
|
||||||
|
// The raw fields must be syntactically valid according to the wire format.
|
||||||
|
// An implementation may panic if this is not the case.
|
||||||
|
// Once stored, the caller must not mutate the content of the RawFields.
|
||||||
|
// An empty RawFields may be passed to clear the fields.
|
||||||
|
//
|
||||||
|
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||||
|
func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) {
|
||||||
|
x.unknownFields = fields
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsValid reports whether the message is valid.
|
||||||
|
//
|
||||||
|
// An invalid message is an empty, read-only value.
|
||||||
|
//
|
||||||
|
// An invalid message often corresponds to a nil pointer of the concrete
|
||||||
|
// message type, but the details are implementation dependent.
|
||||||
|
// Validity is not part of the protobuf data model, and may not
|
||||||
|
// be preserved in marshaling or other operations.
|
||||||
|
func (x *fastReflection_GenesisState) IsValid() bool {
|
||||||
|
return x != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||||
|
// This method may return nil.
|
||||||
|
//
|
||||||
|
// The returned methods type is identical to
|
||||||
|
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||||
|
// Consult the protoiface package documentation for details.
|
||||||
|
func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*GenesisState)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options := runtime.SizeInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
var n int
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if x.Params != nil {
|
||||||
|
l = options.Size(x.Params)
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
if len(x.Participants) > 0 {
|
||||||
|
for _, e := range x.Participants {
|
||||||
|
l = options.Size(e)
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.unknownFields != nil {
|
||||||
|
n += len(x.unknownFields)
|
||||||
|
}
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: n,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*GenesisState)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.MarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
size := options.Size(x)
|
||||||
|
dAtA := make([]byte, size)
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if x.unknownFields != nil {
|
||||||
|
i -= len(x.unknownFields)
|
||||||
|
copy(dAtA[i:], x.unknownFields)
|
||||||
|
}
|
||||||
|
if len(x.Participants) > 0 {
|
||||||
|
for iNdEx := len(x.Participants) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
encoded, err := options.Marshal(x.Participants[iNdEx])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, err
|
||||||
|
}
|
||||||
|
i -= len(encoded)
|
||||||
|
copy(dAtA[i:], encoded)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Params != nil {
|
||||||
|
encoded, err := options.Marshal(x.Params)
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, err
|
||||||
|
}
|
||||||
|
i -= len(encoded)
|
||||||
|
copy(dAtA[i:], encoded)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
if input.Buf != nil {
|
||||||
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
|
} else {
|
||||||
|
input.Buf = dAtA
|
||||||
|
}
|
||||||
|
return protoiface.MarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Buf: input.Buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||||
|
x := input.Message.Interface().(*GenesisState)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.UnmarshalOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Flags: input.Flags,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
options := runtime.UnmarshalInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
dAtA := input.Buf
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire 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++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
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++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
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
|
||||||
|
}
|
||||||
|
if x.Params == nil {
|
||||||
|
x.Params = &Params{}
|
||||||
|
}
|
||||||
|
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
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++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
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.Participants = append(x.Participants, &Participant{})
|
||||||
|
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Participants[len(x.Participants)-1]); err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if !options.DiscardUnknown {
|
||||||
|
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||||
|
}
|
||||||
|
return &protoiface.Methods{
|
||||||
|
NoUnkeyedLiterals: struct{}{},
|
||||||
|
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||||
|
Size: size,
|
||||||
|
Marshal: marshal,
|
||||||
|
Unmarshal: unmarshal,
|
||||||
|
Merge: nil,
|
||||||
|
CheckInitialized: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: cerc/onboarding/v1/genesis.proto
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
// GenesisState defines the onboarding module's genesis state.
|
||||||
|
type GenesisState struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// params defines all the parameters of the module.
|
||||||
|
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||||
|
// participants defines all the participants
|
||||||
|
Participants []*Participant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GenesisState) Reset() {
|
||||||
|
*x = GenesisState{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_cerc_onboarding_v1_genesis_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GenesisState) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GenesisState) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GenesisState) Descriptor() ([]byte, []int) {
|
||||||
|
return file_cerc_onboarding_v1_genesis_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GenesisState) GetParams() *Params {
|
||||||
|
if x != nil {
|
||||||
|
return x.Params
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GenesisState) GetParticipants() []*Participant {
|
||||||
|
if x != nil {
|
||||||
|
return x.Participants
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_cerc_onboarding_v1_genesis_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_cerc_onboarding_v1_genesis_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x20, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e,
|
||||||
|
0x67, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64,
|
||||||
|
0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x65,
|
||||||
|
0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31,
|
||||||
|
0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61,
|
||||||
|
0x74, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72,
|
||||||
|
0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04,
|
||||||
|
0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x49, 0x0a, 0x0c,
|
||||||
|
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
|
||||||
|
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72,
|
||||||
|
0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
|
||||||
|
0x61, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69,
|
||||||
|
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0xd1, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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_cerc_onboarding_v1_genesis_proto_rawDescOnce sync.Once
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_rawDescData = file_cerc_onboarding_v1_genesis_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_cerc_onboarding_v1_genesis_proto_rawDescGZIP() []byte {
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_rawDescOnce.Do(func() {
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_v1_genesis_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_cerc_onboarding_v1_genesis_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_cerc_onboarding_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_cerc_onboarding_v1_genesis_proto_goTypes = []interface{}{
|
||||||
|
(*GenesisState)(nil), // 0: cerc.onboarding.v1.GenesisState
|
||||||
|
(*Params)(nil), // 1: cerc.onboarding.v1.Params
|
||||||
|
(*Participant)(nil), // 2: cerc.onboarding.v1.Participant
|
||||||
|
}
|
||||||
|
var file_cerc_onboarding_v1_genesis_proto_depIdxs = []int32{
|
||||||
|
1, // 0: cerc.onboarding.v1.GenesisState.params:type_name -> cerc.onboarding.v1.Params
|
||||||
|
2, // 1: cerc.onboarding.v1.GenesisState.participants:type_name -> cerc.onboarding.v1.Participant
|
||||||
|
2, // [2:2] is the sub-list for method output_type
|
||||||
|
2, // [2:2] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_cerc_onboarding_v1_genesis_proto_init() }
|
||||||
|
func file_cerc_onboarding_v1_genesis_proto_init() {
|
||||||
|
if File_cerc_onboarding_v1_genesis_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_cerc_onboarding_v1_onboarding_proto_init()
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*GenesisState); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_cerc_onboarding_v1_genesis_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_cerc_onboarding_v1_genesis_proto_goTypes,
|
||||||
|
DependencyIndexes: file_cerc_onboarding_v1_genesis_proto_depIdxs,
|
||||||
|
MessageInfos: file_cerc_onboarding_v1_genesis_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_cerc_onboarding_v1_genesis_proto = out.File
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_rawDesc = nil
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_goTypes = nil
|
||||||
|
file_cerc_onboarding_v1_genesis_proto_depIdxs = nil
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,189 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: cerc/onboarding/v1/query.proto
|
||||||
|
|
||||||
|
package onboardingv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
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.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
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 {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||||
|
return &queryClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error) {
|
||||||
|
out := new(QueryParticipantsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Query_Participants_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
||||||
|
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.
|
||||||
|
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeQueryServer interface {
|
||||||
|
mustEmbedUnimplementedQueryServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||||
|
s.RegisterService(&Query_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParticipantsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Participants(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Query_Participants_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Participants(ctx, req.(*QueryParticipantsRequest))
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
var Query_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "cerc.onboarding.v1.Query",
|
||||||
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
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",
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,111 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: cerc/onboarding/v1/tx.proto
|
||||||
|
|
||||||
|
package onboardingv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
Msg_OnboardParticipant_FullMethodName = "/cerc.onboarding.v1.Msg/OnboardParticipant"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MsgClient is the client API for Msg service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type MsgClient interface {
|
||||||
|
// OnboardParticipant defines a method for enrolling a new validator.
|
||||||
|
OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type msgClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||||
|
return &msgClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error) {
|
||||||
|
out := new(MsgOnboardParticipantResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_OnboardParticipant_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)
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedMsgServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMsgServer) OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method OnboardParticipant not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
|
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeMsgServer interface {
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||||
|
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_OnboardParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgOnboardParticipant)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).OnboardParticipant(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_OnboardParticipant_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).OnboardParticipant(ctx, req.(*MsgOnboardParticipant))
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "cerc.onboarding.v1.Msg",
|
||||||
|
HandlerType: (*MsgServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "OnboardParticipant",
|
||||||
|
Handler: _Msg_OnboardParticipant_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "cerc/onboarding/v1/tx.proto",
|
||||||
|
}
|
||||||
@@ -14,12 +14,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
md_Module protoreflect.MessageDescriptor
|
md_Module protoreflect.MessageDescriptor
|
||||||
|
fd_Module_authority protoreflect.FieldDescriptor
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
file_cerc_registry_module_v1_module_proto_init()
|
file_cerc_registry_module_v1_module_proto_init()
|
||||||
md_Module = File_cerc_registry_module_v1_module_proto.Messages().ByName("Module")
|
md_Module = File_cerc_registry_module_v1_module_proto.Messages().ByName("Module")
|
||||||
|
fd_Module_authority = md_Module.Fields().ByName("authority")
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
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
|
// While iterating, mutating operations may only be performed
|
||||||
// on the current field descriptor.
|
// on the current field descriptor.
|
||||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
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.
|
// 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.
|
// a repeated field is populated if it is non-empty.
|
||||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
return x.Authority != ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.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.
|
// Clear is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
x.Authority = ""
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.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.
|
// of the value; to obtain a mutable reference, use Mutable.
|
||||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch descriptor.FullName() {
|
switch descriptor.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
value := x.Authority
|
||||||
|
return protoreflect.ValueOfString(value)
|
||||||
default:
|
default:
|
||||||
if descriptor.IsExtension() {
|
if descriptor.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.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.
|
// Set is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
x.Authority = value.Interface().(string)
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.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.
|
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
panic(fmt.Errorf("field authority of message cerc.registry.module.v1.Module is not mutable"))
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.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.
|
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
switch fd.FullName() {
|
switch fd.FullName() {
|
||||||
|
case "cerc.registry.module.v1.Module.authority":
|
||||||
|
return protoreflect.ValueOfString("")
|
||||||
default:
|
default:
|
||||||
if fd.IsExtension() {
|
if fd.IsExtension() {
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.registry.module.v1.Module"))
|
||||||
@@ -256,6 +277,10 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|||||||
var n int
|
var n int
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
l = len(x.Authority)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
if x.unknownFields != nil {
|
if x.unknownFields != nil {
|
||||||
n += len(x.unknownFields)
|
n += len(x.unknownFields)
|
||||||
}
|
}
|
||||||
@@ -285,6 +310,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|||||||
i -= len(x.unknownFields)
|
i -= len(x.unknownFields)
|
||||||
copy(dAtA[i:], 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 {
|
if input.Buf != nil {
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
input.Buf = append(input.Buf, dAtA...)
|
||||||
} else {
|
} 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)
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
@@ -388,6 +452,10 @@ type Module struct {
|
|||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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() {
|
func (x *Module) Reset() {
|
||||||
@@ -410,6 +478,13 @@ func (*Module) Descriptor() ([]byte, []int) {
|
|||||||
return file_cerc_registry_module_v1_module_proto_rawDescGZIP(), []int{0}
|
return file_cerc_registry_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Module) GetAuthority() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Authority
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_cerc_registry_module_v1_module_proto protoreflect.FileDescriptor
|
var File_cerc_registry_module_v1_module_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_cerc_registry_module_v1_module_proto_rawDesc = []byte{
|
var file_cerc_registry_module_v1_module_proto_rawDesc = []byte{
|
||||||
@@ -419,26 +494,27 @@ var file_cerc_registry_module_v1_module_proto_rawDesc = []byte{
|
|||||||
0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a,
|
0x69, 0x73, 0x74, 0x72, 0x79, 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,
|
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,
|
0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x22, 0x38, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2e, 0xba, 0xc0, 0x96,
|
0x6f, 0x22, 0x56, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61,
|
||||||
0xda, 0x01, 0x28, 0x0a, 0x26, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f,
|
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
||||||
0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64,
|
0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x2e, 0xba, 0xc0, 0x96, 0xda, 0x01,
|
||||||
0x2f, 0x78, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x42, 0xeb, 0x01, 0x0a, 0x1b,
|
0x28, 0x0a, 0x26, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65,
|
||||||
0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72,
|
0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x78,
|
||||||
0x79, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64,
|
0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x42, 0xeb, 0x01, 0x0a, 0x1b, 0x63, 0x6f,
|
||||||
0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x2e,
|
0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e,
|
||||||
0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c,
|
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63,
|
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64,
|
||||||
0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63,
|
||||||
0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43,
|
0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x72,
|
||||||
0x52, 0x4d, 0xaa, 0x02, 0x17, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
|
0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76,
|
||||||
0x72, 0x79, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x43,
|
0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x52, 0x4d,
|
||||||
0x65, 0x72, 0x63, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d, 0x6f, 0x64,
|
0xaa, 0x02, 0x17, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
|
||||||
0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x52, 0x65,
|
0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x43, 0x65, 0x72,
|
||||||
0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31,
|
0x63, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43,
|
0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x52, 0x65, 0x67, 0x69,
|
||||||
0x65, 0x72, 0x63, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x4d,
|
0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47,
|
||||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x65, 0x72,
|
||||||
0x33,
|
0x63, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x4d, 0x6f, 0x64,
|
||||||
|
0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+1363
-235
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@ const (
|
|||||||
Query_LookupLrn_FullMethodName = "/cerc.registry.v1.Query/LookupLrn"
|
Query_LookupLrn_FullMethodName = "/cerc.registry.v1.Query/LookupLrn"
|
||||||
Query_ResolveLrn_FullMethodName = "/cerc.registry.v1.Query/ResolveLrn"
|
Query_ResolveLrn_FullMethodName = "/cerc.registry.v1.Query/ResolveLrn"
|
||||||
Query_GetRegistryModuleBalance_FullMethodName = "/cerc.registry.v1.Query/GetRegistryModuleBalance"
|
Query_GetRegistryModuleBalance_FullMethodName = "/cerc.registry.v1.Query/GetRegistryModuleBalance"
|
||||||
|
Query_Authorities_FullMethodName = "/cerc.registry.v1.Query/Authorities"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QueryClient is the client API for Query service.
|
// QueryClient is the client API for Query service.
|
||||||
@@ -52,6 +53,8 @@ type QueryClient interface {
|
|||||||
ResolveLrn(ctx context.Context, in *QueryResolveLrnRequest, opts ...grpc.CallOption) (*QueryResolveLrnResponse, error)
|
ResolveLrn(ctx context.Context, in *QueryResolveLrnRequest, opts ...grpc.CallOption) (*QueryResolveLrnResponse, error)
|
||||||
// Get registry module balance
|
// Get registry module balance
|
||||||
GetRegistryModuleBalance(ctx context.Context, in *QueryGetRegistryModuleBalanceRequest, opts ...grpc.CallOption) (*QueryGetRegistryModuleBalanceResponse, error)
|
GetRegistryModuleBalance(ctx context.Context, in *QueryGetRegistryModuleBalanceRequest, opts ...grpc.CallOption) (*QueryGetRegistryModuleBalanceResponse, error)
|
||||||
|
// Authorities queries all authorities
|
||||||
|
Authorities(ctx context.Context, in *QueryAuthoritiesRequest, opts ...grpc.CallOption) (*QueryAuthoritiesResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type queryClient struct {
|
type queryClient struct {
|
||||||
@@ -143,6 +146,15 @@ func (c *queryClient) GetRegistryModuleBalance(ctx context.Context, in *QueryGet
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Authorities(ctx context.Context, in *QueryAuthoritiesRequest, opts ...grpc.CallOption) (*QueryAuthoritiesResponse, error) {
|
||||||
|
out := new(QueryAuthoritiesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Query_Authorities_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// QueryServer is the server API for Query service.
|
// QueryServer is the server API for Query service.
|
||||||
// All implementations must embed UnimplementedQueryServer
|
// All implementations must embed UnimplementedQueryServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@@ -165,6 +177,8 @@ type QueryServer interface {
|
|||||||
ResolveLrn(context.Context, *QueryResolveLrnRequest) (*QueryResolveLrnResponse, error)
|
ResolveLrn(context.Context, *QueryResolveLrnRequest) (*QueryResolveLrnResponse, error)
|
||||||
// Get registry module balance
|
// Get registry module balance
|
||||||
GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error)
|
GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error)
|
||||||
|
// Authorities queries all authorities
|
||||||
|
Authorities(context.Context, *QueryAuthoritiesRequest) (*QueryAuthoritiesResponse, error)
|
||||||
mustEmbedUnimplementedQueryServer()
|
mustEmbedUnimplementedQueryServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,6 +213,9 @@ func (UnimplementedQueryServer) ResolveLrn(context.Context, *QueryResolveLrnRequ
|
|||||||
func (UnimplementedQueryServer) GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error) {
|
func (UnimplementedQueryServer) GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetRegistryModuleBalance not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetRegistryModuleBalance not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedQueryServer) Authorities(context.Context, *QueryAuthoritiesRequest) (*QueryAuthoritiesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Authorities not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||||
|
|
||||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||||
@@ -374,6 +391,24 @@ func _Query_GetRegistryModuleBalance_Handler(srv interface{}, ctx context.Contex
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Query_Authorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryAuthoritiesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Authorities(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Query_Authorities_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Authorities(ctx, req.(*QueryAuthoritiesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -417,6 +452,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetRegistryModuleBalance",
|
MethodName: "GetRegistryModuleBalance",
|
||||||
Handler: _Query_GetRegistryModuleBalance_Handler,
|
Handler: _Query_GetRegistryModuleBalance_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Authorities",
|
||||||
|
Handler: _Query_Authorities_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cerc/registry/v1/query.proto",
|
Metadata: "cerc/registry/v1/query.proto",
|
||||||
|
|||||||
+1222
-240
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ const (
|
|||||||
Msg_DeleteName_FullMethodName = "/cerc.registry.v1.Msg/DeleteName"
|
Msg_DeleteName_FullMethodName = "/cerc.registry.v1.Msg/DeleteName"
|
||||||
Msg_ReserveAuthority_FullMethodName = "/cerc.registry.v1.Msg/ReserveAuthority"
|
Msg_ReserveAuthority_FullMethodName = "/cerc.registry.v1.Msg/ReserveAuthority"
|
||||||
Msg_SetAuthorityBond_FullMethodName = "/cerc.registry.v1.Msg/SetAuthorityBond"
|
Msg_SetAuthorityBond_FullMethodName = "/cerc.registry.v1.Msg/SetAuthorityBond"
|
||||||
|
Msg_UpdateParams_FullMethodName = "/cerc.registry.v1.Msg/UpdateParams"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
// MsgClient is the client API for Msg service.
|
||||||
@@ -55,6 +56,9 @@ type MsgClient interface {
|
|||||||
ReserveAuthority(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error)
|
ReserveAuthority(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error)
|
||||||
// SetAuthorityBond
|
// SetAuthorityBond
|
||||||
SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, error)
|
SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, 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 {
|
type msgClient struct {
|
||||||
@@ -155,6 +159,15 @@ func (c *msgClient) SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBon
|
|||||||
return out, nil
|
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.
|
// MsgServer is the server API for Msg service.
|
||||||
// All implementations must embed UnimplementedMsgServer
|
// All implementations must embed UnimplementedMsgServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@@ -179,6 +192,9 @@ type MsgServer interface {
|
|||||||
ReserveAuthority(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error)
|
ReserveAuthority(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error)
|
||||||
// SetAuthorityBond
|
// SetAuthorityBond
|
||||||
SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error)
|
SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error)
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
mustEmbedUnimplementedMsgServer()
|
mustEmbedUnimplementedMsgServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,6 +232,9 @@ func (UnimplementedMsgServer) ReserveAuthority(context.Context, *MsgReserveAutho
|
|||||||
func (UnimplementedMsgServer) SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error) {
|
func (UnimplementedMsgServer) SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SetAuthorityBond not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method SetAuthorityBond not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||||
@@ -409,6 +428,24 @@ func _Msg_SetAuthorityBond_Handler(srv interface{}, ctx context.Context, dec fun
|
|||||||
return interceptor(ctx, in, info, handler)
|
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.
|
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -456,6 +493,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "SetAuthorityBond",
|
MethodName: "SetAuthorityBond",
|
||||||
Handler: _Msg_SetAuthorityBond_Handler,
|
Handler: _Msg_SetAuthorityBond_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cerc/registry/v1/tx.proto",
|
Metadata: "cerc/registry/v1/tx.proto",
|
||||||
|
|||||||
+35
-15
@@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
auctionkeeper "git.vdb.to/cerc-io/laconicd/x/auction/keeper"
|
auctionkeeper "git.vdb.to/cerc-io/laconicd/x/auction/keeper"
|
||||||
bondkeeper "git.vdb.to/cerc-io/laconicd/x/bond/keeper"
|
bondkeeper "git.vdb.to/cerc-io/laconicd/x/bond/keeper"
|
||||||
|
onboardingkeeper "git.vdb.to/cerc-io/laconicd/x/onboarding/keeper"
|
||||||
registrykeeper "git.vdb.to/cerc-io/laconicd/x/registry/keeper"
|
registrykeeper "git.vdb.to/cerc-io/laconicd/x/registry/keeper"
|
||||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
@@ -33,20 +34,28 @@ import (
|
|||||||
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
|
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
|
||||||
"github.com/cosmos/cosmos-sdk/x/genutil"
|
"github.com/cosmos/cosmos-sdk/x/genutil"
|
||||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
|
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
|
||||||
|
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
|
||||||
|
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
|
|
||||||
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
|
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
|
||||||
_ "git.vdb.to/cerc-io/laconicd/x/auction/module" // import for side-effects
|
_ "git.vdb.to/cerc-io/laconicd/x/auction/module" // import for side-effects
|
||||||
_ "git.vdb.to/cerc-io/laconicd/x/bond/module" // import for side-effects
|
_ "git.vdb.to/cerc-io/laconicd/x/bond/module" // import for side-effects
|
||||||
_ "git.vdb.to/cerc-io/laconicd/x/registry/module" // import for side-effects
|
_ "git.vdb.to/cerc-io/laconicd/x/onboarding/module" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects
|
_ "git.vdb.to/cerc-io/laconicd/x/registry/module" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
|
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
|
||||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // 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
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultNodeHome default home directories for the application daemon
|
// DefaultNodeHome default home directories for the application daemon
|
||||||
@@ -74,14 +83,17 @@ type LaconicApp struct {
|
|||||||
AccountKeeper authkeeper.AccountKeeper
|
AccountKeeper authkeeper.AccountKeeper
|
||||||
BankKeeper bankkeeper.Keeper
|
BankKeeper bankkeeper.Keeper
|
||||||
StakingKeeper *stakingkeeper.Keeper
|
StakingKeeper *stakingkeeper.Keeper
|
||||||
|
SlashingKeeper slashingkeeper.Keeper
|
||||||
DistrKeeper distrkeeper.Keeper
|
DistrKeeper distrkeeper.Keeper
|
||||||
|
GovKeeper *govkeeper.Keeper
|
||||||
CrisisKeeper *crisiskeeper.Keeper
|
CrisisKeeper *crisiskeeper.Keeper
|
||||||
ConsensusParamsKeeper consensuskeeper.Keeper
|
ConsensusParamsKeeper consensuskeeper.Keeper
|
||||||
|
|
||||||
// laconic keepers
|
// laconic keepers
|
||||||
AuctionKeeper *auctionkeeper.Keeper // (Use * as per ProvideModule implementation)
|
AuctionKeeper *auctionkeeper.Keeper // (Use * as per ProvideModule implementation)
|
||||||
BondKeeper *bondkeeper.Keeper
|
BondKeeper *bondkeeper.Keeper
|
||||||
RegistryKeeper registrykeeper.Keeper
|
RegistryKeeper registrykeeper.Keeper
|
||||||
|
OnboardingKeeper *onboardingkeeper.Keeper
|
||||||
|
|
||||||
// simulation manager
|
// simulation manager
|
||||||
sm *module.SimulationManager
|
sm *module.SimulationManager
|
||||||
@@ -104,6 +116,11 @@ func AppConfig() depinject.Config {
|
|||||||
// supply custom module basics
|
// supply custom module basics
|
||||||
map[string]module.AppModuleBasic{
|
map[string]module.AppModuleBasic{
|
||||||
genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
|
genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
|
||||||
|
govtypes.ModuleName: gov.NewAppModuleBasic(
|
||||||
|
[]govclient.ProposalHandler{
|
||||||
|
paramsclient.ProposalHandler,
|
||||||
|
},
|
||||||
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -139,12 +156,15 @@ func NewLaconicApp(
|
|||||||
&app.AccountKeeper,
|
&app.AccountKeeper,
|
||||||
&app.BankKeeper,
|
&app.BankKeeper,
|
||||||
&app.StakingKeeper,
|
&app.StakingKeeper,
|
||||||
|
&app.SlashingKeeper,
|
||||||
&app.DistrKeeper,
|
&app.DistrKeeper,
|
||||||
|
&app.GovKeeper,
|
||||||
&app.CrisisKeeper,
|
&app.CrisisKeeper,
|
||||||
&app.ConsensusParamsKeeper,
|
&app.ConsensusParamsKeeper,
|
||||||
&app.AuctionKeeper,
|
&app.AuctionKeeper,
|
||||||
&app.BondKeeper,
|
&app.BondKeeper,
|
||||||
&app.RegistryKeeper,
|
&app.RegistryKeeper,
|
||||||
|
&app.OnboardingKeeper,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-3
@@ -6,11 +6,11 @@ modules:
|
|||||||
# During begin block slashing happens after distr.BeginBlocker so that
|
# 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.
|
# 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
|
# NOTE: staking module is required if HistoricalEntries param > 0
|
||||||
begin_blockers: [distribution, staking]
|
begin_blockers: [distribution, slashing, staking]
|
||||||
end_blockers: [crisis, staking, auction, registry]
|
end_blockers: [crisis, gov, 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 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.
|
# 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]
|
init_genesis: [auth, bank, distribution, staking, slashing, gov, crisis, genutil, auction, bond, registry, onboarding]
|
||||||
override_store_keys:
|
override_store_keys:
|
||||||
- module_name: auth
|
- module_name: auth
|
||||||
kv_store_key: acc
|
kv_store_key: acc
|
||||||
@@ -25,6 +25,8 @@ modules:
|
|||||||
permissions: [burner, staking]
|
permissions: [burner, staking]
|
||||||
- account: not_bonded_tokens_pool
|
- account: not_bonded_tokens_pool
|
||||||
permissions: [burner, staking]
|
permissions: [burner, staking]
|
||||||
|
- account: gov
|
||||||
|
permissions: [burner]
|
||||||
- account: auction
|
- account: auction
|
||||||
- account: auction_burn
|
- account: auction_burn
|
||||||
- account: bond
|
- account: bond
|
||||||
@@ -39,6 +41,9 @@ modules:
|
|||||||
- name: staking
|
- name: staking
|
||||||
config:
|
config:
|
||||||
"@type": cosmos.staking.module.v1.Module
|
"@type": cosmos.staking.module.v1.Module
|
||||||
|
- name: slashing
|
||||||
|
config:
|
||||||
|
"@type": cosmos.slashing.module.v1.Module
|
||||||
- name: distribution
|
- name: distribution
|
||||||
config:
|
config:
|
||||||
"@type": cosmos.distribution.module.v1.Module
|
"@type": cosmos.distribution.module.v1.Module
|
||||||
@@ -51,6 +56,9 @@ modules:
|
|||||||
- name: tx
|
- name: tx
|
||||||
config:
|
config:
|
||||||
"@type": cosmos.tx.config.v1.Config
|
"@type": cosmos.tx.config.v1.Config
|
||||||
|
- name: gov
|
||||||
|
config:
|
||||||
|
"@type": cosmos.gov.module.v1.Module
|
||||||
- name: crisis
|
- name: crisis
|
||||||
config:
|
config:
|
||||||
"@type": cosmos.crisis.module.v1.Module
|
"@type": cosmos.crisis.module.v1.Module
|
||||||
@@ -63,3 +71,6 @@ modules:
|
|||||||
- name: registry
|
- name: registry
|
||||||
config:
|
config:
|
||||||
"@type": cerc.registry.module.v1.Module
|
"@type": cerc.registry.module.v1.Module
|
||||||
|
- name: onboarding
|
||||||
|
config:
|
||||||
|
"@type": cerc.onboarding.module.v1.Module
|
||||||
|
|||||||
+20
-1
@@ -10,6 +10,7 @@ import (
|
|||||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
)
|
)
|
||||||
@@ -51,7 +52,7 @@ func (app *LaconicApp) ExportAppStateAndValidators(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prepare for fresh start at zero height
|
// prepare for fresh start at zero height
|
||||||
// NOTE zero height genesis is a temporary feature, which will be deprecated in favour of export at a block height
|
// NOTE zero height genesis is a temporary feature, which will be deprecated in favor of export at a block height
|
||||||
func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
|
func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
|
||||||
applyAllowedAddrs := false
|
applyAllowedAddrs := false
|
||||||
|
|
||||||
@@ -221,4 +222,22 @@ func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handle slashing state. */
|
||||||
|
|
||||||
|
// reset start height on signing infos
|
||||||
|
err = app.SlashingKeeper.IterateValidatorSigningInfos(
|
||||||
|
ctx,
|
||||||
|
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
|
||||||
|
info.StartHeight = 0
|
||||||
|
err = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CoinUnit = "photon"
|
CoinUnit = "lnt"
|
||||||
|
BaseCoinUnit = "alnt"
|
||||||
|
LntExponent = 18
|
||||||
|
|
||||||
DefaultBondDenom = CoinUnit
|
DefaultBondDenom = BaseCoinUnit
|
||||||
|
|
||||||
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
|
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
|
||||||
Bech32PrefixAccAddr = "laconic"
|
Bech32PrefixAccAddr = "laconic"
|
||||||
@@ -41,6 +43,11 @@ func RegisterDenoms() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LntExponent))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetAddressPrefixes() {
|
func SetAddressPrefixes() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||||
"github.com/cosmos/cosmos-sdk/server"
|
"github.com/cosmos/cosmos-sdk/server"
|
||||||
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
|
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/types/module"
|
"github.com/cosmos/cosmos-sdk/types/module"
|
||||||
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||||
@@ -98,7 +100,7 @@ func NewRootCmd() *cobra.Command {
|
|||||||
|
|
||||||
// overwrite the minimum gas price from the app configuration
|
// overwrite the minimum gas price from the app configuration
|
||||||
srvCfg := serverconfig.DefaultConfig()
|
srvCfg := serverconfig.DefaultConfig()
|
||||||
srvCfg.MinGasPrices = "0photon"
|
srvCfg.MinGasPrices = fmt.Sprintf("0%s", sdk.DefaultBondDenom)
|
||||||
|
|
||||||
// overwrite the block timeout
|
// overwrite the block timeout
|
||||||
cmtCfg := cmtcfg.DefaultConfig()
|
cmtCfg := cmtcfg.DefaultConfig()
|
||||||
@@ -140,7 +142,8 @@ func ProvideClientContext(
|
|||||||
// Read the config again to overwrite the default values with the values from the config file
|
// Read the config again to overwrite the default values with the values from the config file
|
||||||
clientCtx, _ = config.ReadFromClientConfig(clientCtx)
|
clientCtx, _ = config.ReadFromClientConfig(clientCtx)
|
||||||
|
|
||||||
// Workaround: Unset clientCtx.HomeDir and clientCtx.KeyringDir from depinject clientCtx as they are given precedence over the CLI args (--home flag) in some commands
|
// Workaround: Unset clientCtx.HomeDir and clientCtx.KeyringDir from depinject clientCtx as they are given precedence over
|
||||||
|
// the CLI args (--home flag) in some commands
|
||||||
// TODO: Implement proper fix
|
// TODO: Implement proper fix
|
||||||
clientCtx.HomeDir = ""
|
clientCtx.HomeDir = ""
|
||||||
clientCtx.KeyringDir = ""
|
clientCtx.KeyringDir = ""
|
||||||
|
|||||||
@@ -13,70 +13,73 @@ replace (
|
|||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cosmossdk.io/api v0.7.2
|
cosmossdk.io/api v0.7.5
|
||||||
cosmossdk.io/client/v2 v2.0.0-beta.1
|
cosmossdk.io/client/v2 v2.0.0-beta.1
|
||||||
cosmossdk.io/collections v0.4.0
|
cosmossdk.io/collections v0.4.0
|
||||||
cosmossdk.io/core v0.11.0
|
cosmossdk.io/core v0.11.1
|
||||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
cosmossdk.io/depinject v1.0.0
|
||||||
cosmossdk.io/errors v1.0.1
|
cosmossdk.io/errors v1.0.1
|
||||||
cosmossdk.io/log v1.3.0
|
cosmossdk.io/log v1.4.1
|
||||||
cosmossdk.io/math v1.2.0
|
cosmossdk.io/math v1.3.0
|
||||||
cosmossdk.io/store v1.0.2
|
cosmossdk.io/store v1.1.1
|
||||||
cosmossdk.io/tools/confix v0.1.0
|
cosmossdk.io/tools/confix v0.1.0
|
||||||
github.com/99designs/gqlgen v0.17.22
|
github.com/99designs/gqlgen v0.17.22
|
||||||
github.com/cometbft/cometbft v0.38.2
|
github.com/cometbft/cometbft v0.38.12
|
||||||
github.com/cosmos/cosmos-db v1.0.0
|
github.com/cosmos/cosmos-db v1.0.2
|
||||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
github.com/cosmos/cosmos-proto v1.0.0-beta.5
|
||||||
github.com/cosmos/cosmos-sdk v0.50.3
|
github.com/cosmos/cosmos-sdk v0.50.10
|
||||||
github.com/cosmos/go-bip39 v1.0.0
|
github.com/cosmos/go-bip39 v1.0.0
|
||||||
github.com/cosmos/gogoproto v1.4.11
|
github.com/cosmos/gogoproto v1.7.0
|
||||||
github.com/deckarep/golang-set v1.8.0
|
github.com/deckarep/golang-set v1.8.0
|
||||||
|
github.com/ethereum/go-ethereum v1.14.5
|
||||||
github.com/gibson042/canonicaljson-go v1.0.3
|
github.com/gibson042/canonicaljson-go v1.0.3
|
||||||
github.com/go-chi/chi/v5 v5.0.8
|
github.com/go-chi/chi/v5 v5.0.8
|
||||||
github.com/golang/protobuf v1.5.3
|
github.com/golang/protobuf v1.5.4
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||||
github.com/ipfs/go-cid v0.4.1
|
github.com/ipfs/go-cid v0.4.1
|
||||||
github.com/ipld/go-ipld-prime v0.21.0
|
github.com/ipld/go-ipld-prime v0.21.0
|
||||||
github.com/rs/cors v1.8.3
|
github.com/rs/cors v1.11.1
|
||||||
github.com/spf13/cobra v1.8.0
|
github.com/spf13/cobra v1.8.1
|
||||||
github.com/spf13/viper v1.17.0
|
github.com/spf13/viper v1.19.0
|
||||||
github.com/stretchr/testify v1.8.4
|
github.com/statechannels/go-nitro v0.1.2
|
||||||
|
github.com/stretchr/testify v1.9.0
|
||||||
github.com/vektah/gqlparser/v2 v2.5.11
|
github.com/vektah/gqlparser/v2 v2.5.11
|
||||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
golang.org/x/sync v0.8.0
|
||||||
golang.org/x/sync v0.6.0
|
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
|
google.golang.org/grpc v1.64.1
|
||||||
google.golang.org/grpc v1.60.1
|
google.golang.org/protobuf v1.34.2
|
||||||
google.golang.org/protobuf v1.32.0
|
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cosmossdk.io/x/tx v0.13.0 // indirect
|
cosmossdk.io/x/tx v0.13.5 // indirect
|
||||||
filippo.io/edwards25519 v1.0.0 // indirect
|
filippo.io/edwards25519 v1.0.0 // indirect
|
||||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||||
github.com/99designs/keyring v1.2.1 // indirect
|
github.com/99designs/keyring v1.2.1 // indirect
|
||||||
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
|
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
|
||||||
github.com/DataDog/zstd v1.5.5 // indirect
|
github.com/DataDog/zstd v1.5.5 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
|
||||||
github.com/agnivade/levenshtein v1.1.1 // indirect
|
github.com/agnivade/levenshtein v1.1.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.10.0 // 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/btcec/v2 v2.3.4 // indirect
|
||||||
|
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
|
||||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||||
github.com/cespare/xxhash v1.1.0 // indirect
|
github.com/cespare/xxhash v1.1.0 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
|
github.com/chzyer/readline v1.5.1 // indirect
|
||||||
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
|
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
|
||||||
github.com/cockroachdb/errors v1.11.1 // indirect
|
github.com/cockroachdb/errors v1.11.3 // indirect
|
||||||
|
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
|
||||||
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
||||||
github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6 // indirect
|
github.com/cockroachdb/pebble v1.1.1 // indirect
|
||||||
github.com/cockroachdb/redact v1.1.5 // indirect
|
github.com/cockroachdb/redact v1.1.5 // indirect
|
||||||
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
|
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
|
||||||
github.com/cometbft/cometbft-db v0.9.1 // indirect
|
github.com/cometbft/cometbft-db v0.11.0 // indirect
|
||||||
github.com/cosmos/btcutil v1.0.5 // indirect
|
github.com/cosmos/btcutil v1.0.5 // indirect
|
||||||
github.com/cosmos/gogogateway v1.2.0 // indirect
|
github.com/cosmos/gogogateway v1.2.0 // indirect
|
||||||
github.com/cosmos/iavl v1.0.0 // indirect
|
github.com/cosmos/iavl v1.2.0 // indirect
|
||||||
github.com/cosmos/ics23/go v0.10.0 // indirect
|
github.com/cosmos/ics23/go v0.11.0 // indirect
|
||||||
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
|
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
|
||||||
github.com/creachadair/atomicfile v0.3.1 // indirect
|
github.com/creachadair/atomicfile v0.3.1 // indirect
|
||||||
github.com/creachadair/tomledit v0.0.24 // indirect
|
github.com/creachadair/tomledit v0.0.24 // indirect
|
||||||
@@ -88,12 +91,12 @@ require (
|
|||||||
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
||||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
|
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
|
||||||
github.com/emicklei/dot v1.6.0 // indirect
|
github.com/emicklei/dot v1.6.1 // indirect
|
||||||
github.com/fatih/color v1.15.0 // indirect
|
github.com/fatih/color v1.16.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/getsentry/sentry-go v0.25.0 // indirect
|
github.com/getsentry/sentry-go v0.27.0 // indirect
|
||||||
github.com/go-kit/kit v0.12.0 // indirect
|
github.com/go-kit/kit v0.12.0 // indirect
|
||||||
github.com/go-kit/log v0.2.1 // indirect
|
github.com/go-kit/log v0.2.1 // indirect
|
||||||
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||||
@@ -108,65 +111,68 @@ require (
|
|||||||
github.com/google/orderedcode v0.0.1 // indirect
|
github.com/google/orderedcode v0.0.1 // indirect
|
||||||
github.com/gorilla/handlers v1.5.1 // indirect
|
github.com/gorilla/handlers v1.5.1 // indirect
|
||||||
github.com/gorilla/mux v1.8.0 // indirect
|
github.com/gorilla/mux v1.8.0 // indirect
|
||||||
github.com/gorilla/websocket v1.5.0 // indirect
|
github.com/gorilla/websocket v1.5.3 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||||
github.com/hashicorp/go-metrics v0.5.1 // indirect
|
github.com/hashicorp/go-metrics v0.5.3 // indirect
|
||||||
github.com/hashicorp/go-plugin v1.5.2 // indirect
|
github.com/hashicorp/go-plugin v1.5.2 // indirect
|
||||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||||
|
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/hashicorp/yamux v0.1.1 // indirect
|
github.com/hashicorp/yamux v0.1.1 // indirect
|
||||||
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
|
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
|
||||||
|
github.com/holiman/uint256 v1.2.4 // indirect
|
||||||
github.com/huandu/skiplist v1.2.0 // indirect
|
github.com/huandu/skiplist v1.2.0 // indirect
|
||||||
github.com/iancoleman/strcase v0.3.0 // indirect
|
github.com/iancoleman/strcase v0.3.0 // indirect
|
||||||
github.com/improbable-eng/grpc-web v0.15.0 // indirect
|
github.com/improbable-eng/grpc-web v0.15.0 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.4 // indirect
|
github.com/klauspost/compress v1.17.9 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||||
github.com/kr/pretty v0.3.1 // indirect
|
github.com/kr/pretty v0.3.1 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/lib/pq v1.10.7 // indirect
|
github.com/lib/pq v1.10.7 // indirect
|
||||||
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
github.com/linxGnu/grocksdb v1.8.14 // indirect
|
||||||
github.com/linxGnu/grocksdb v1.8.6 // indirect
|
|
||||||
github.com/magiconair/properties v1.8.7 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
|
github.com/manifoldco/promptui v0.9.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
|
|
||||||
github.com/minio/highwayhash v1.0.2 // indirect
|
github.com/minio/highwayhash v1.0.2 // indirect
|
||||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||||
github.com/mtibben/percent v0.2.1 // indirect
|
github.com/mtibben/percent v0.2.1 // indirect
|
||||||
github.com/multiformats/go-base32 v0.0.3 // indirect
|
github.com/multiformats/go-base32 v0.1.0 // indirect
|
||||||
github.com/multiformats/go-base36 v0.1.0 // indirect
|
github.com/multiformats/go-base36 v0.2.0 // indirect
|
||||||
github.com/multiformats/go-multibase v0.0.3 // indirect
|
github.com/multiformats/go-multibase v0.2.0 // indirect
|
||||||
github.com/multiformats/go-multihash v0.2.3 // indirect
|
github.com/multiformats/go-multihash v0.2.3 // indirect
|
||||||
github.com/multiformats/go-varint v0.0.6 // indirect
|
github.com/multiformats/go-varint v0.0.7 // indirect
|
||||||
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
|
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
|
||||||
github.com/oklog/run v1.1.0 // indirect
|
github.com/oklog/run v1.1.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||||
github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect
|
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/polydawn/refmt v0.89.0 // indirect
|
github.com/polydawn/refmt v0.89.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.17.0 // indirect
|
github.com/prometheus/client_golang v1.20.1 // indirect
|
||||||
github.com/prometheus/client_model v0.5.0 // indirect
|
github.com/prometheus/client_model v0.6.1 // indirect
|
||||||
github.com/prometheus/common v0.45.0 // indirect
|
github.com/prometheus/common v0.55.0 // indirect
|
||||||
github.com/prometheus/procfs v0.12.0 // indirect
|
github.com/prometheus/procfs v0.15.1 // indirect
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
github.com/rogpeppe/go-internal v1.12.0 // indirect
|
||||||
github.com/rs/zerolog v1.31.0 // indirect
|
github.com/rs/zerolog v1.33.0 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||||
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
github.com/spf13/afero v1.10.0 // indirect
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
github.com/spf13/cast v1.5.1 // indirect
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
||||||
@@ -174,20 +180,22 @@ require (
|
|||||||
github.com/tidwall/btree v1.7.0 // indirect
|
github.com/tidwall/btree v1.7.0 // indirect
|
||||||
github.com/zondax/hid v0.9.2 // indirect
|
github.com/zondax/hid v0.9.2 // indirect
|
||||||
github.com/zondax/ledger-go v0.14.3 // indirect
|
github.com/zondax/ledger-go v0.14.3 // indirect
|
||||||
go.etcd.io/bbolt v1.3.8 // indirect
|
go.etcd.io/bbolt v1.3.10 // indirect
|
||||||
go.uber.org/multierr v1.10.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/crypto v0.18.0 // indirect
|
golang.org/x/crypto v0.26.0 // indirect
|
||||||
golang.org/x/net v0.20.0 // indirect
|
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
|
||||||
golang.org/x/sys v0.16.0 // indirect
|
golang.org/x/net v0.28.0 // indirect
|
||||||
golang.org/x/term v0.16.0 // indirect
|
golang.org/x/sys v0.24.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/term v0.23.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
|
golang.org/x/text v0.17.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
|
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
gotest.tools/v3 v3.5.1 // indirect
|
gotest.tools/v3 v3.5.1 // indirect
|
||||||
lukechampine.com/blake3 v1.1.6 // indirect
|
lukechampine.com/blake3 v1.2.1 // indirect
|
||||||
nhooyr.io/websocket v1.8.6 // indirect
|
nhooyr.io/websocket v1.8.6 // indirect
|
||||||
pgregory.net/rapid v1.1.0 // indirect
|
pgregory.net/rapid v1.1.0 // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace github.com/statechannels/go-nitro v0.1.2 => github.com/cerc-io/go-nitro v0.1.3-ts-port-0.1.10
|
||||||
|
|||||||
+54
-19
@@ -1,6 +1,30 @@
|
|||||||
# cerc-io laconic gql
|
# cerc-io laconic gql
|
||||||
|
|
||||||
> Browser : http://localhost:9473 for gql
|
> Browser : <http://localhost:9473> for gql
|
||||||
|
|
||||||
|
## Run gqlgen
|
||||||
|
|
||||||
|
On having some change in the GQL schema (for example: adding a new query) update the [schema.graphql](./cerc-io/laconicd/schema.graphql) file as required and run the following:
|
||||||
|
|
||||||
|
- Generate GQL bindings:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install gqlgen if not present
|
||||||
|
go get github.com/99designs/gqlgen@v0.17.22
|
||||||
|
|
||||||
|
# Generate bindings
|
||||||
|
cd gql
|
||||||
|
go run github.com/99designs/gqlgen generate
|
||||||
|
```
|
||||||
|
|
||||||
|
- Implement the required resolver method(s)
|
||||||
|
|
||||||
|
- Regenerate GQL bindings:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Generate bindings
|
||||||
|
go run github.com/99designs/gqlgen generate
|
||||||
|
```
|
||||||
|
|
||||||
## Start server
|
## Start server
|
||||||
|
|
||||||
@@ -20,15 +44,15 @@ Basic node status:
|
|||||||
moniker
|
moniker
|
||||||
}
|
}
|
||||||
sync {
|
sync {
|
||||||
latest_block_height
|
latestBlockHeight
|
||||||
catching_up
|
catchingUp
|
||||||
}
|
}
|
||||||
num_peers
|
numPeers
|
||||||
peers {
|
peers {
|
||||||
is_outbound
|
isOutbound
|
||||||
remote_ip
|
remoteIp
|
||||||
}
|
}
|
||||||
disk_usage
|
diskUsage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -45,32 +69,32 @@ Full node status:
|
|||||||
moniker
|
moniker
|
||||||
}
|
}
|
||||||
sync {
|
sync {
|
||||||
latest_block_hash
|
latestBlockHash
|
||||||
latest_block_time
|
latestBlockTime
|
||||||
latest_block_height
|
latestBlockHeight
|
||||||
catching_up
|
catchingUp
|
||||||
}
|
}
|
||||||
validator {
|
validator {
|
||||||
address
|
address
|
||||||
voting_power
|
votingPower
|
||||||
proposer_priority
|
proposerPriority
|
||||||
}
|
}
|
||||||
validators {
|
validators {
|
||||||
address
|
address
|
||||||
voting_power
|
votingPower
|
||||||
proposer_priority
|
proposerPriority
|
||||||
}
|
}
|
||||||
num_peers
|
numPeers
|
||||||
peers {
|
peers {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
network
|
network
|
||||||
moniker
|
moniker
|
||||||
}
|
}
|
||||||
is_outbound
|
isOutbound
|
||||||
remote_ip
|
remoteIp
|
||||||
}
|
}
|
||||||
disk_usage
|
diskUsage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -351,3 +375,14 @@ Resolve Names
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Query participants:
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
{
|
||||||
|
getParticipants {
|
||||||
|
cosmosAddress
|
||||||
|
nitroAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ type Account {
|
|||||||
balance: [Coin!] # Current balance for each coin type.
|
balance: [Coin!] # Current balance for each coin type.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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.
|
# Value describes a DAG-JSON compatible value.
|
||||||
union Value =
|
union Value =
|
||||||
BooleanValue
|
BooleanValue
|
||||||
@@ -106,24 +113,24 @@ type NodeInfo {
|
|||||||
|
|
||||||
# Node sync status.
|
# Node sync status.
|
||||||
type SyncInfo {
|
type SyncInfo {
|
||||||
latest_block_hash: String!
|
latestBlockHash: String!
|
||||||
latest_block_height: String!
|
latestBlockHeight: String!
|
||||||
latest_block_time: String!
|
latestBlockTime: String!
|
||||||
catching_up: Boolean!
|
catchingUp: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
# Validator set info (https://docs.tendermint.com/master/rpc/#/Info/validators).
|
# Validator set info (https://docs.tendermint.com/master/rpc/#/Info/validators).
|
||||||
type ValidatorInfo {
|
type ValidatorInfo {
|
||||||
address: String!
|
address: String!
|
||||||
voting_power: String!
|
votingPower: String!
|
||||||
proposer_priority: String
|
proposerPriority: String
|
||||||
}
|
}
|
||||||
|
|
||||||
# Network/peer info (https://docs.tendermint.com/master/rpc/#/Info/net_info).
|
# Network/peer info (https://docs.tendermint.com/master/rpc/#/Info/net_info).
|
||||||
type PeerInfo {
|
type PeerInfo {
|
||||||
node: NodeInfo!
|
node: NodeInfo!
|
||||||
is_outbound: Boolean!
|
isOutbound: Boolean!
|
||||||
remote_ip: String!
|
remoteIp: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
# Vulcanize laconic status.
|
# Vulcanize laconic status.
|
||||||
@@ -133,9 +140,9 @@ type Status {
|
|||||||
sync: SyncInfo!
|
sync: SyncInfo!
|
||||||
validator: ValidatorInfo
|
validator: ValidatorInfo
|
||||||
validators: [ValidatorInfo]!
|
validators: [ValidatorInfo]!
|
||||||
num_peers: String!
|
numPeers: String!
|
||||||
peers: [PeerInfo]
|
peers: [PeerInfo]
|
||||||
disk_usage: String!
|
diskUsage: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
# An auction bid.
|
# An auction bid.
|
||||||
@@ -161,10 +168,14 @@ type Auction {
|
|||||||
commitFee: Coin! # Fee required to bid/participate in the auction.
|
commitFee: Coin! # Fee required to bid/participate in the auction.
|
||||||
revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid).
|
revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid).
|
||||||
minimumBid: Coin! # Minimum bid amount.
|
minimumBid: Coin! # Minimum bid amount.
|
||||||
winnerAddress: String! # Winner address.
|
winnerAddresses: [String!]! # Winner address.
|
||||||
winnerBid: Coin! # The winning bid amount.
|
winnerBids: [Coin!]! # The winning bid amount.
|
||||||
winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid).
|
winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid).
|
||||||
bids: [AuctionBid] # Bids make in the auction.
|
maxPrice: Coin! # Max bid amount for service provider auction.
|
||||||
|
kind: String! # Auction kind.
|
||||||
|
numProviders: Int # Number of service providers
|
||||||
|
fundsReleased: Boolean! # Whether funds have been released to providers
|
||||||
|
bids: [AuctionBid!]! # Bids made in the auction.
|
||||||
}
|
}
|
||||||
|
|
||||||
# Record defines the basic properties of an entity in the graph database.
|
# Record defines the basic properties of an entity in the graph database.
|
||||||
@@ -190,6 +201,11 @@ type AuthorityRecord {
|
|||||||
auction: Auction # Authority auction.
|
auction: Auction # Authority auction.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Authority {
|
||||||
|
name: String!
|
||||||
|
entry: AuthorityRecord!
|
||||||
|
}
|
||||||
|
|
||||||
# Name record entry, created at a particular height.
|
# Name record entry, created at a particular height.
|
||||||
type NameRecordEntry {
|
type NameRecordEntry {
|
||||||
id: String! # Target record ID.
|
id: String! # Target record ID.
|
||||||
@@ -215,7 +231,7 @@ type Query {
|
|||||||
getBondsByIds(ids: [String!]): [Bond]
|
getBondsByIds(ids: [String!]): [Bond]
|
||||||
|
|
||||||
# Query bonds.
|
# Query bonds.
|
||||||
queryBonds(attributes: [KeyValueInput!]): [Bond]
|
queryBonds: [Bond]
|
||||||
|
|
||||||
# Query bonds by owner.
|
# Query bonds by owner.
|
||||||
queryBondsByOwner(ownerAddresses: [String!]): [OwnerBonds]
|
queryBondsByOwner(ownerAddresses: [String!]): [OwnerBonds]
|
||||||
@@ -234,12 +250,21 @@ type Query {
|
|||||||
|
|
||||||
# Whether to query all records, not just named ones (false by default).
|
# Whether to query all records, not just named ones (false by default).
|
||||||
all: Boolean
|
all: Boolean
|
||||||
|
|
||||||
|
# Pagination limit
|
||||||
|
limit: Int
|
||||||
|
|
||||||
|
# Pagination offset
|
||||||
|
offset: Int
|
||||||
): [Record]
|
): [Record]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Naming API.
|
# Naming API.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Get authorities list.
|
||||||
|
getAuthorities(owner: String): [Authority]!
|
||||||
|
|
||||||
# Lookup authority information.
|
# Lookup authority information.
|
||||||
lookupAuthorities(names: [String!]): [AuthorityRecord]!
|
lookupAuthorities(names: [String!]): [AuthorityRecord]!
|
||||||
|
|
||||||
@@ -255,4 +280,9 @@ type Query {
|
|||||||
|
|
||||||
# Get auctions by IDs.
|
# Get auctions by IDs.
|
||||||
getAuctionsByIds(ids: [String!]): [Auction]
|
getAuctionsByIds(ids: [String!]): [Auction]
|
||||||
|
|
||||||
|
# Query participants.
|
||||||
|
getParticipants: [Participant]!
|
||||||
|
getParticipantByAddress(address: String!): Participant!
|
||||||
|
getParticipantByNitroAddress(nitroAddress: String!): Participant!
|
||||||
}
|
}
|
||||||
|
|||||||
+1511
-219
File diff suppressed because it is too large
Load Diff
+39
-23
@@ -26,19 +26,23 @@ type Attribute struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Auction struct {
|
type Auction struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
OwnerAddress string `json:"ownerAddress"`
|
OwnerAddress string `json:"ownerAddress"`
|
||||||
CreateTime string `json:"createTime"`
|
CreateTime string `json:"createTime"`
|
||||||
CommitsEndTime string `json:"commitsEndTime"`
|
CommitsEndTime string `json:"commitsEndTime"`
|
||||||
RevealsEndTime string `json:"revealsEndTime"`
|
RevealsEndTime string `json:"revealsEndTime"`
|
||||||
CommitFee *Coin `json:"commitFee"`
|
CommitFee *Coin `json:"commitFee"`
|
||||||
RevealFee *Coin `json:"revealFee"`
|
RevealFee *Coin `json:"revealFee"`
|
||||||
MinimumBid *Coin `json:"minimumBid"`
|
MinimumBid *Coin `json:"minimumBid"`
|
||||||
WinnerAddress string `json:"winnerAddress"`
|
WinnerAddresses []string `json:"winnerAddresses"`
|
||||||
WinnerBid *Coin `json:"winnerBid"`
|
WinnerBids []*Coin `json:"winnerBids"`
|
||||||
WinnerPrice *Coin `json:"winnerPrice"`
|
WinnerPrice *Coin `json:"winnerPrice"`
|
||||||
Bids []*AuctionBid `json:"bids"`
|
MaxPrice *Coin `json:"maxPrice"`
|
||||||
|
Kind string `json:"kind"`
|
||||||
|
NumProviders *int `json:"numProviders"`
|
||||||
|
FundsReleased bool `json:"fundsReleased"`
|
||||||
|
Bids []*AuctionBid `json:"bids"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuctionBid struct {
|
type AuctionBid struct {
|
||||||
@@ -52,6 +56,11 @@ type AuctionBid struct {
|
|||||||
BidAmount *Coin `json:"bidAmount"`
|
BidAmount *Coin `json:"bidAmount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Authority struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Entry *AuthorityRecord `json:"entry"`
|
||||||
|
}
|
||||||
|
|
||||||
type AuthorityRecord struct {
|
type AuthorityRecord struct {
|
||||||
OwnerAddress string `json:"ownerAddress"`
|
OwnerAddress string `json:"ownerAddress"`
|
||||||
OwnerPublicKey string `json:"ownerPublicKey"`
|
OwnerPublicKey string `json:"ownerPublicKey"`
|
||||||
@@ -135,10 +144,17 @@ type OwnerBonds struct {
|
|||||||
Bonds []*Bond `json:"bonds"`
|
Bonds []*Bond `json:"bonds"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Participant struct {
|
||||||
|
CosmosAddress string `json:"cosmosAddress"`
|
||||||
|
NitroAddress string `json:"nitroAddress"`
|
||||||
|
Role string `json:"role"`
|
||||||
|
KycID string `json:"kycId"`
|
||||||
|
}
|
||||||
|
|
||||||
type PeerInfo struct {
|
type PeerInfo struct {
|
||||||
Node *NodeInfo `json:"node"`
|
Node *NodeInfo `json:"node"`
|
||||||
IsOutbound bool `json:"is_outbound"`
|
IsOutbound bool `json:"isOutbound"`
|
||||||
RemoteIP string `json:"remote_ip"`
|
RemoteIP string `json:"remoteIp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Record struct {
|
type Record struct {
|
||||||
@@ -158,9 +174,9 @@ type Status struct {
|
|||||||
Sync *SyncInfo `json:"sync"`
|
Sync *SyncInfo `json:"sync"`
|
||||||
Validator *ValidatorInfo `json:"validator"`
|
Validator *ValidatorInfo `json:"validator"`
|
||||||
Validators []*ValidatorInfo `json:"validators"`
|
Validators []*ValidatorInfo `json:"validators"`
|
||||||
NumPeers string `json:"num_peers"`
|
NumPeers string `json:"numPeers"`
|
||||||
Peers []*PeerInfo `json:"peers"`
|
Peers []*PeerInfo `json:"peers"`
|
||||||
DiskUsage string `json:"disk_usage"`
|
DiskUsage string `json:"diskUsage"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringValue struct {
|
type StringValue struct {
|
||||||
@@ -170,16 +186,16 @@ type StringValue struct {
|
|||||||
func (StringValue) IsValue() {}
|
func (StringValue) IsValue() {}
|
||||||
|
|
||||||
type SyncInfo struct {
|
type SyncInfo struct {
|
||||||
LatestBlockHash string `json:"latest_block_hash"`
|
LatestBlockHash string `json:"latestBlockHash"`
|
||||||
LatestBlockHeight string `json:"latest_block_height"`
|
LatestBlockHeight string `json:"latestBlockHeight"`
|
||||||
LatestBlockTime string `json:"latest_block_time"`
|
LatestBlockTime string `json:"latestBlockTime"`
|
||||||
CatchingUp bool `json:"catching_up"`
|
CatchingUp bool `json:"catchingUp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValidatorInfo struct {
|
type ValidatorInfo struct {
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
VotingPower string `json:"voting_power"`
|
VotingPower string `json:"votingPower"`
|
||||||
ProposerPriority *string `json:"proposer_priority"`
|
ProposerPriority *string `json:"proposerPriority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValueInput struct {
|
type ValueInput struct {
|
||||||
|
|||||||
+119
-21
@@ -8,11 +8,13 @@ import (
|
|||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
types "github.com/cosmos/cosmos-sdk/types"
|
types "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
|
||||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
bondtypes "git.vdb.to/cerc-io/laconicd/x/bond"
|
bondtypes "git.vdb.to/cerc-io/laconicd/x/bond"
|
||||||
|
onboardingTypes "git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
registrytypes "git.vdb.to/cerc-io/laconicd/x/registry"
|
registrytypes "git.vdb.to/cerc-io/laconicd/x/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,6 +24,9 @@ const DefaultLogNumLines = 50
|
|||||||
// MaxLogNumLines is the max number of log lines that can be tailed.
|
// MaxLogNumLines is the max number of log lines that can be tailed.
|
||||||
const MaxLogNumLines = 1000
|
const MaxLogNumLines = 1000
|
||||||
|
|
||||||
|
// Whether to use default page limit when pagination args are not passed.
|
||||||
|
const UseDefaultPagination = false
|
||||||
|
|
||||||
type Resolver struct {
|
type Resolver struct {
|
||||||
ctx client.Context
|
ctx client.Context
|
||||||
logFile string
|
logFile string
|
||||||
@@ -34,6 +39,36 @@ func (r *Resolver) Query() QueryResolver {
|
|||||||
|
|
||||||
type queryResolver struct{ *Resolver }
|
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) {
|
func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) {
|
||||||
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
||||||
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
||||||
@@ -51,29 +86,11 @@ func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([
|
|||||||
}
|
}
|
||||||
|
|
||||||
nameAuthority := res.GetNameAuthority()
|
nameAuthority := res.GetNameAuthority()
|
||||||
gqlNameAuthorityRecord, err := GetGQLNameAuthorityRecord(&nameAuthority)
|
gqlNameAuthorityRecord, err := getAuthorityRecord(nameAuthority, auctionQueryClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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)
|
gqlResponse = append(gqlResponse, gqlNameAuthorityRecord)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,14 +140,34 @@ func (q queryResolver) LookupNames(ctx context.Context, names []string) ([]*Name
|
|||||||
return gqlResponse, nil
|
return gqlResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error) {
|
func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool, limit *int, offset *int) ([]*Record, error) {
|
||||||
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
|
||||||
|
|
||||||
|
var pagination *query.PageRequest
|
||||||
|
|
||||||
|
// Use defaults only if limit and offset not provided
|
||||||
|
// and UseDefaultPagination is true
|
||||||
|
if limit == nil && offset == nil {
|
||||||
|
if UseDefaultPagination {
|
||||||
|
pagination = &query.PageRequest{}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pagination = &query.PageRequest{}
|
||||||
|
|
||||||
|
if limit != nil {
|
||||||
|
pagination.Limit = uint64(*limit)
|
||||||
|
}
|
||||||
|
if offset != nil {
|
||||||
|
pagination.Offset = uint64(*offset)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res, err := nsQueryClient.Records(
|
res, err := nsQueryClient.Records(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
®istrytypes.QueryRecordsRequest{
|
®istrytypes.QueryRecordsRequest{
|
||||||
Attributes: toRPCAttributes(attributes),
|
Attributes: toRPCAttributes(attributes),
|
||||||
All: (all != nil && *all),
|
All: (all != nil && *all),
|
||||||
|
Pagination: pagination,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -283,7 +320,7 @@ func (q *queryResolver) GetBond(ctx context.Context, id string) (*Bond, error) {
|
|||||||
return getGQLBond(bondResp.GetBond())
|
return getGQLBond(bondResp.GetBond())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q queryResolver) QueryBonds(ctx context.Context, attributes []*KeyValueInput) ([]*Bond, error) {
|
func (q queryResolver) QueryBonds(ctx context.Context) ([]*Bond, error) {
|
||||||
bondQueryClient := bondtypes.NewQueryClient(q.ctx)
|
bondQueryClient := bondtypes.NewQueryClient(q.ctx)
|
||||||
bonds, err := bondQueryClient.Bonds(context.Background(), &bondtypes.QueryBondsRequest{})
|
bonds, err := bondQueryClient.Bonds(context.Background(), &bondtypes.QueryBondsRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -359,3 +396,64 @@ func (q queryResolver) GetAuctionsByIds(ctx context.Context, ids []string) ([]*A
|
|||||||
|
|
||||||
return gqlAuctionResponse, nil
|
return gqlAuctionResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, error) {
|
||||||
|
onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx)
|
||||||
|
participantResp, err := onboardingQueryClient.Participants(context.Background(), &onboardingTypes.QueryParticipantsRequest{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
participants := make([]*Participant, len(participantResp.GetParticipants()))
|
||||||
|
for i, p := range participantResp.Participants {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|||||||
+7
-1
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"cosmossdk.io/log"
|
"cosmossdk.io/log"
|
||||||
"github.com/99designs/gqlgen/graphql/handler"
|
"github.com/99designs/gqlgen/graphql/handler"
|
||||||
@@ -54,7 +55,12 @@ func Server(ctx context.Context, clientCtx client.Context, logger log.Logger) er
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
logger.Info(fmt.Sprintf("Connect to GraphQL playground url: http://localhost:%s", port))
|
logger.Info(fmt.Sprintf("Connect to GraphQL playground url: http://localhost:%s", port))
|
||||||
errCh <- http.ListenAndServe(":"+port, router)
|
server := &http.Server{
|
||||||
|
Addr: ":" + port,
|
||||||
|
Handler: router,
|
||||||
|
ReadHeaderTimeout: 3 * time.Second,
|
||||||
|
}
|
||||||
|
errCh <- server.ListenAndServe()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|||||||
+2
-1
@@ -39,7 +39,8 @@ func getStatusInfo(client client.Context) (*NodeInfo, *SyncInfo, *ValidatorInfo,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNetInfo(client client.Context) (string, []*PeerInfo, error) {
|
// nolint: all
|
||||||
|
func getNetInfo(_ client.Context) (string, []*PeerInfo, error) {
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
|
||||||
// nodeClient, err := client.GetNode()
|
// nodeClient, err := client.GetNode()
|
||||||
|
|||||||
+45
-12
@@ -232,19 +232,25 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
numProviders := int(auction.NumProviders)
|
||||||
|
|
||||||
gqlAuction := Auction{
|
gqlAuction := Auction{
|
||||||
ID: auction.Id,
|
ID: auction.Id,
|
||||||
Status: auction.Status,
|
Status: auction.Status,
|
||||||
OwnerAddress: auction.OwnerAddress,
|
OwnerAddress: auction.OwnerAddress,
|
||||||
CreateTime: auction.GetCreateTime(),
|
CreateTime: auction.GetCreateTime(),
|
||||||
CommitsEndTime: auction.GetCommitsEndTime(),
|
CommitsEndTime: auction.GetCommitsEndTime(),
|
||||||
RevealsEndTime: auction.GetRevealsEndTime(),
|
RevealsEndTime: auction.GetRevealsEndTime(),
|
||||||
CommitFee: getGQLCoin(auction.CommitFee),
|
CommitFee: getGQLCoin(auction.CommitFee),
|
||||||
RevealFee: getGQLCoin(auction.RevealFee),
|
RevealFee: getGQLCoin(auction.RevealFee),
|
||||||
MinimumBid: getGQLCoin(auction.MinimumBid),
|
MinimumBid: getGQLCoin(auction.MinimumBid),
|
||||||
WinnerAddress: auction.WinnerAddress,
|
WinnerAddresses: auction.WinnerAddresses,
|
||||||
WinnerBid: getGQLCoin(auction.WinningBid),
|
WinnerBids: getGQLCoins(auction.WinningBids),
|
||||||
WinnerPrice: getGQLCoin(auction.WinningPrice),
|
WinnerPrice: getGQLCoin(auction.WinningPrice),
|
||||||
|
MaxPrice: getGQLCoin(auction.MaxPrice),
|
||||||
|
Kind: auction.Kind,
|
||||||
|
NumProviders: &numProviders,
|
||||||
|
FundsReleased: auction.FundsReleased,
|
||||||
}
|
}
|
||||||
|
|
||||||
auctionBids := make([]*AuctionBid, len(bids))
|
auctionBids := make([]*AuctionBid, len(bids))
|
||||||
@@ -303,3 +309,30 @@ func toRPCAttributes(attrs []*KeyValueInput) []*registrytypes.QueryRecordsReques
|
|||||||
|
|
||||||
return kvPairs
|
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) = {
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
go_import : "git.vdb.to/cerc-io/laconicd/x/auction"
|
go_import : "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// authority defines the custom module authority. If not set, defaults to the
|
||||||
|
// governance module.
|
||||||
|
string authority = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,76 +3,44 @@ syntax = "proto3";
|
|||||||
package cerc.auction.v1;
|
package cerc.auction.v1;
|
||||||
|
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
import "google/protobuf/duration.proto";
|
|
||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
import "cosmos/base/v1beta1/coin.proto";
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
|
||||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||||
|
|
||||||
// Params defines the auction module parameters
|
// Params defines the auction module parameters
|
||||||
message Params {
|
message Params {}
|
||||||
// Write custom stringer method
|
|
||||||
option (gogoproto.goproto_stringer) = false;
|
|
||||||
|
|
||||||
// Duration of the commits phase in seconds
|
|
||||||
google.protobuf.Duration commits_duration = 1 [
|
|
||||||
(gogoproto.nullable) = false,
|
|
||||||
(gogoproto.stdduration) = true,
|
|
||||||
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
|
|
||||||
];
|
|
||||||
|
|
||||||
// Duration of the reveals phase in seconds
|
|
||||||
google.protobuf.Duration reveals_duration = 2 [
|
|
||||||
(gogoproto.nullable) = false,
|
|
||||||
(gogoproto.stdduration) = true,
|
|
||||||
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
|
|
||||||
];
|
|
||||||
|
|
||||||
// Commit fees
|
|
||||||
cosmos.base.v1beta1.Coin commit_fee = 3 [
|
|
||||||
(gogoproto.nullable) = false,
|
|
||||||
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
||||||
];
|
|
||||||
|
|
||||||
// Reveal fees
|
|
||||||
cosmos.base.v1beta1.Coin reveal_fee = 4 [
|
|
||||||
(gogoproto.nullable) = false,
|
|
||||||
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
||||||
];
|
|
||||||
|
|
||||||
// Minimum acceptable bid amount
|
|
||||||
cosmos.base.v1beta1.Coin minimum_bid = 5 [
|
|
||||||
(gogoproto.nullable) = false,
|
|
||||||
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auction represents a sealed-bid on-chain auction
|
// Auction represents a sealed-bid on-chain auction
|
||||||
message Auction {
|
message Auction {
|
||||||
option (gogoproto.goproto_getters) = false;
|
option (gogoproto.goproto_getters) = false;
|
||||||
|
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string status = 2;
|
|
||||||
|
// Auction kind (vickrey | provider)
|
||||||
|
string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ];
|
||||||
|
|
||||||
|
string status = 3;
|
||||||
|
|
||||||
// Address of the creator of the auction
|
// Address of the creator of the auction
|
||||||
string owner_address = 3;
|
string owner_address = 4;
|
||||||
|
|
||||||
// Timestamp at which the auction was created
|
// Timestamp at which the auction was created
|
||||||
google.protobuf.Timestamp create_time = 4 [
|
google.protobuf.Timestamp create_time = 5 [
|
||||||
(gogoproto.stdtime) = true,
|
(gogoproto.stdtime) = true,
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
|
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Timestamp at which the commits phase concluded
|
// Timestamp at which the commits phase concluded
|
||||||
google.protobuf.Timestamp commits_end_time = 5 [
|
google.protobuf.Timestamp commits_end_time = 6 [
|
||||||
(gogoproto.stdtime) = true,
|
(gogoproto.stdtime) = true,
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
|
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Timestamp at which the reveals phase concluded
|
// Timestamp at which the reveals phase concluded
|
||||||
google.protobuf.Timestamp reveals_end_time = 6 [
|
google.protobuf.Timestamp reveals_end_time = 7 [
|
||||||
(gogoproto.stdtime) = true,
|
(gogoproto.stdtime) = true,
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
|
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
|
||||||
@@ -80,35 +48,58 @@ message Auction {
|
|||||||
|
|
||||||
// Commit and reveal fees must both be paid when committing a bid
|
// Commit and reveal fees must both be paid when committing a bid
|
||||||
// Reveal fee is returned only if the bid is revealed
|
// Reveal fee is returned only if the bid is revealed
|
||||||
cosmos.base.v1beta1.Coin commit_fee = 7 [
|
cosmos.base.v1beta1.Coin commit_fee = 8 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
||||||
];
|
];
|
||||||
cosmos.base.v1beta1.Coin reveal_fee = 8 [
|
cosmos.base.v1beta1.Coin reveal_fee = 9 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Minimum acceptable bid amount for a valid commit
|
// Minimum acceptable bid amount for a valid commit
|
||||||
cosmos.base.v1beta1.Coin minimum_bid = 9 [
|
// Only applicable in vickrey auctions
|
||||||
|
cosmos.base.v1beta1.Coin minimum_bid = 10 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Address of the winner
|
// Addresses of the winners
|
||||||
string winner_address = 10;
|
// (single winner for vickrey auction)
|
||||||
|
// (multiple winners for provider auctions)
|
||||||
|
repeated string winner_addresses = 11;
|
||||||
|
|
||||||
// Winning bid, i.e., the highest bid
|
// Winning bids, i.e. the best bids
|
||||||
cosmos.base.v1beta1.Coin winning_bid = 11 [
|
repeated cosmos.base.v1beta1.Coin winning_bids = 12 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\""
|
(gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Amount the winner pays, i.e. the second highest auction
|
// Auction winning price
|
||||||
cosmos.base.v1beta1.Coin winning_price = 12 [
|
// vickrey auction: second highest bid, paid by the winner
|
||||||
|
// provider auction: higest bid amongst winning_bids, paid by auction creator
|
||||||
|
// to each winner
|
||||||
|
cosmos.base.v1beta1.Coin winning_price = 13 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
|
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Maximum acceptable bid amount for a valid commit
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
cosmos.base.v1beta1.Coin max_price = 14 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\""
|
||||||
|
];
|
||||||
|
|
||||||
|
// Number of desired providers (num of auction winners)
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
int32 num_providers = 15;
|
||||||
|
|
||||||
|
// Whether funds have been released to providers
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
bool funds_released = 16
|
||||||
|
[ (gogoproto.moretags) =
|
||||||
|
"json:\"funds_released\" yaml:\"funds_released\"" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auctions represent all the auctions in the module
|
// Auctions represent all the auctions in the module
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import "gogoproto/gogo.proto";
|
|||||||
import "google/api/annotations.proto";
|
import "google/api/annotations.proto";
|
||||||
import "google/protobuf/duration.proto";
|
import "google/protobuf/duration.proto";
|
||||||
import "cosmos/base/v1beta1/coin.proto";
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
import "cerc/auction/v1/auction.proto";
|
import "cerc/auction/v1/auction.proto";
|
||||||
|
|
||||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||||
@@ -29,6 +30,15 @@ service Msg {
|
|||||||
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) {
|
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) {
|
||||||
option (google.api.http).post = "/cerc/auction/v1/reveal_bid";
|
option (google.api.http).post = "/cerc/auction/v1/reveal_bid";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||||
|
|
||||||
|
// ReleaseFunds is the command for paying the winners of provider auctions
|
||||||
|
rpc ReleaseFunds(MsgReleaseFunds) returns (MsgReleaseFundsResponse) {
|
||||||
|
option (google.api.http).post = "/cerc/auction/v1/release_funds";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsgCreateAuction defines a create auction message
|
// MsgCreateAuction defines a create auction message
|
||||||
@@ -36,41 +46,56 @@ message MsgCreateAuction {
|
|||||||
option (gogoproto.goproto_getters) = false;
|
option (gogoproto.goproto_getters) = false;
|
||||||
option (cosmos.msg.v1.signer) = "signer";
|
option (cosmos.msg.v1.signer) = "signer";
|
||||||
|
|
||||||
|
// Address of the signer
|
||||||
|
string signer = 1
|
||||||
|
[ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ];
|
||||||
|
|
||||||
|
// Auction kind (vickrey | provider)
|
||||||
|
string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ];
|
||||||
|
|
||||||
// Duration of the commits phase in seconds
|
// Duration of the commits phase in seconds
|
||||||
google.protobuf.Duration commits_duration = 1 [
|
google.protobuf.Duration commits_duration = 3 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.stdduration) = true,
|
(gogoproto.stdduration) = true,
|
||||||
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
|
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Duration of the reveals phase in seconds
|
// Duration of the reveals phase in seconds
|
||||||
google.protobuf.Duration reveals_duration = 2 [
|
google.protobuf.Duration reveals_duration = 4 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.stdduration) = true,
|
(gogoproto.stdduration) = true,
|
||||||
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
|
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Commit fees
|
// Commit fees
|
||||||
cosmos.base.v1beta1.Coin commit_fee = 3 [
|
cosmos.base.v1beta1.Coin commit_fee = 5 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Reveal fees
|
// Reveal fees
|
||||||
cosmos.base.v1beta1.Coin reveal_fee = 4 [
|
cosmos.base.v1beta1.Coin reveal_fee = 6 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Minimum acceptable bid amount
|
// Minimum acceptable bid amount
|
||||||
cosmos.base.v1beta1.Coin minimum_bid = 5 [
|
// Only applicable in vickrey auctions
|
||||||
|
cosmos.base.v1beta1.Coin minimum_bid = 7 [
|
||||||
(gogoproto.nullable) = false,
|
(gogoproto.nullable) = false,
|
||||||
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
||||||
];
|
];
|
||||||
|
|
||||||
// Address of the signer
|
// Maximum acceptable bid amount
|
||||||
string signer = 6
|
// Only applicable in provider auctions
|
||||||
[ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ];
|
cosmos.base.v1beta1.Coin max_price = 8 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\""
|
||||||
|
];
|
||||||
|
|
||||||
|
// Number of desired providers (num of auction winners)
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
int32 num_providers = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsgCreateAuctionResponse returns the details of the created auction
|
// MsgCreateAuctionResponse returns the details of the created auction
|
||||||
@@ -134,3 +159,45 @@ message MsgRevealBidResponse {
|
|||||||
Auction auction = 1
|
Auction auction = 1
|
||||||
[ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ];
|
[ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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/auction 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 {};
|
||||||
|
|
||||||
|
// ReleaseFunds defines the message to pay the winners of provider auctions
|
||||||
|
message MsgReleaseFunds {
|
||||||
|
option (gogoproto.goproto_getters) = false;
|
||||||
|
option (cosmos.msg.v1.signer) = "signer";
|
||||||
|
|
||||||
|
// Auction id
|
||||||
|
string auction_id = 1
|
||||||
|
[ (gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\"" ];
|
||||||
|
|
||||||
|
// Address of the signer
|
||||||
|
string signer = 2
|
||||||
|
[ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgReleaseFundsResponse returns the state of the auction after releasing the
|
||||||
|
// funds
|
||||||
|
message MsgReleaseFundsResponse {
|
||||||
|
option (gogoproto.goproto_getters) = false;
|
||||||
|
|
||||||
|
// Auction details
|
||||||
|
Auction auction = 1
|
||||||
|
[ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ];
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,4 +10,8 @@ message Module {
|
|||||||
option (cosmos.app.v1alpha1.module) = {
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
go_import : "git.vdb.to/cerc-io/laconicd/x/bond"
|
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 "gogoproto/gogo.proto";
|
||||||
import "google/api/annotations.proto";
|
import "google/api/annotations.proto";
|
||||||
import "cosmos/base/v1beta1/coin.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";
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||||
|
|
||||||
@@ -32,6 +34,10 @@ service Msg {
|
|||||||
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
|
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
|
||||||
option (google.api.http).post = "/cerc/bond/v1/cancel_bond";
|
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.
|
// MsgCreateBond defines a SDK message for creating a new bond.
|
||||||
@@ -91,3 +97,21 @@ message MsgCancelBond {
|
|||||||
|
|
||||||
// MsgCancelBondResponse defines the Msg/CancelBond response type.
|
// MsgCancelBondResponse defines the Msg/CancelBond response type.
|
||||||
message MsgCancelBondResponse {}
|
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 {};
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cerc.onboarding.module.v1;
|
||||||
|
|
||||||
|
import "cosmos/app/v1alpha1/module.proto";
|
||||||
|
|
||||||
|
// Module is the app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
message Module {
|
||||||
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
|
go_import : "git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
|
};
|
||||||
|
|
||||||
|
string authority = 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cerc.onboarding.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cerc/onboarding/v1/onboarding.proto";
|
||||||
|
|
||||||
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||||
|
|
||||||
|
// GenesisState defines the onboarding module's genesis state.
|
||||||
|
message GenesisState {
|
||||||
|
// params defines all the parameters of the module.
|
||||||
|
Params params = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
// participants defines all the participants
|
||||||
|
repeated Participant participants = 2 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cerc.onboarding.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
|
||||||
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||||
|
|
||||||
|
// Params defines the parameters of the onboarding module.
|
||||||
|
message Params {
|
||||||
|
bool onboarding_enabled = 1
|
||||||
|
[ (gogoproto.moretags) =
|
||||||
|
"json:\"onboarding_enabled\" yaml:\"onboarding_enabled\"" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
[ (gogoproto.moretags) = "json:\"address\" yaml:\"address\"" ];
|
||||||
|
|
||||||
|
string msg = 2 [ (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" ];
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cerc.onboarding.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||||
|
import "cerc/onboarding/v1/onboarding.proto";
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
|
||||||
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||||
|
|
||||||
|
// Query defines the gRPC querier service for onboarding module
|
||||||
|
service Query {
|
||||||
|
// Participants queries Participants list
|
||||||
|
rpc Participants(QueryParticipantsRequest)
|
||||||
|
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
|
||||||
|
message QueryParticipantsRequest {
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParticipantsResponse is response type for querying the participants
|
||||||
|
message QueryParticipantsResponse {
|
||||||
|
repeated Participant participants = 1
|
||||||
|
[ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ];
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cerc.onboarding.v1;
|
||||||
|
|
||||||
|
import "cosmos/msg/v1/msg.proto";
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cerc/onboarding/v1/onboarding.proto";
|
||||||
|
|
||||||
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||||
|
|
||||||
|
// Msg defines the onboarding Msg service.
|
||||||
|
service Msg {
|
||||||
|
option (cosmos.msg.v1.service) = true;
|
||||||
|
|
||||||
|
// OnboardParticipant defines a method for enrolling a new validator.
|
||||||
|
rpc OnboardParticipant(MsgOnboardParticipant)
|
||||||
|
returns (MsgOnboardParticipantResponse) {
|
||||||
|
option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgOnboardParticipant defines a SDK message for enrolling a new validator.
|
||||||
|
message MsgOnboardParticipant {
|
||||||
|
option (cosmos.msg.v1.signer) = "participant";
|
||||||
|
|
||||||
|
// Participant is the msg sender
|
||||||
|
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 {}
|
||||||
@@ -10,4 +10,8 @@ message Module {
|
|||||||
option (cosmos.app.v1alpha1.module) = {
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
go_import : "git.vdb.to/cerc-io/laconicd/x/registry"
|
go_import : "git.vdb.to/cerc-io/laconicd/x/registry"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// authority defines the custom module authority. If not set, defaults to the
|
||||||
|
// governance module.
|
||||||
|
string authority = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ service Query {
|
|||||||
returns (QueryGetRegistryModuleBalanceResponse) {
|
returns (QueryGetRegistryModuleBalanceResponse) {
|
||||||
option (google.api.http).get = "/cerc/registry/v1/balance";
|
option (google.api.http).get = "/cerc/registry/v1/balance";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Authorities queries all authorities
|
||||||
|
rpc Authorities(QueryAuthoritiesRequest) returns (QueryAuthoritiesResponse) {
|
||||||
|
option (google.api.http).get = "/cerc/registry/v1/authorities";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryParamsRequest is request type for registry params
|
// QueryParamsRequest is request type for registry params
|
||||||
@@ -152,6 +157,16 @@ message QueryWhoisResponse {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QueryAuthoritiesRequest is request type to get all authorities
|
||||||
|
message QueryAuthoritiesRequest { string owner = 1; }
|
||||||
|
|
||||||
|
// QueryAuthoritiesResponse is response type for authorities request
|
||||||
|
message QueryAuthoritiesResponse {
|
||||||
|
repeated AuthorityEntry authorities = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// QueryLookupLrnRequest is request type for LookupLrn
|
// QueryLookupLrnRequest is request type for LookupLrn
|
||||||
message QueryLookupLrnRequest { string lrn = 1; }
|
message QueryLookupLrnRequest { string lrn = 1; }
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import "google/api/annotations.proto";
|
|||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
import "cosmos/msg/v1/msg.proto";
|
import "cosmos/msg/v1/msg.proto";
|
||||||
import "cerc/registry/v1/registry.proto";
|
import "cerc/registry/v1/registry.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
|
||||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
||||||
|
|
||||||
@@ -66,6 +67,10 @@ service Msg {
|
|||||||
returns (MsgSetAuthorityBondResponse) {
|
returns (MsgSetAuthorityBondResponse) {
|
||||||
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
|
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateParams defines an operation for updating the x/staking module
|
||||||
|
// parameters.
|
||||||
|
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsgSetRecord
|
// MsgSetRecord
|
||||||
@@ -203,3 +208,21 @@ message MsgReassociateRecords {
|
|||||||
|
|
||||||
// MsgReassociateRecordsResponse
|
// MsgReassociateRecordsResponse
|
||||||
message MsgReassociateRecordsResponse {}
|
message MsgReassociateRecordsResponse {}
|
||||||
|
|
||||||
|
// 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/registry 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 {}
|
||||||
|
|||||||
+51
-10
@@ -1,12 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
KEY="alice"
|
KEY="alice"
|
||||||
CHAINID="laconic_9000-1"
|
CHAINID=${CHAINID:-"laconic_9000-1"}
|
||||||
MONIKER="localtestnet"
|
MONIKER=${MONIKER:-"localtestnet"}
|
||||||
KEYRING="test"
|
KEYRING=${KEYRING:-"test"}
|
||||||
LOGLEVEL="${LOGLEVEL:-info}"
|
DENOM=${DENOM:-"alnt"}
|
||||||
|
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"}
|
||||||
|
MIN_GAS_PRICE=${MIN_GAS_PRICE:-"0.001"}
|
||||||
|
LOGLEVEL=${LOGLEVEL:-"info"}
|
||||||
|
|
||||||
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
input_genesis_file=${GENESIS_FILE}
|
||||||
|
|
||||||
|
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data" ]; then
|
||||||
# validate dependencies are installed
|
# validate dependencies are installed
|
||||||
command -v jq > /dev/null 2>&1 || {
|
command -v jq > /dev/null 2>&1 || {
|
||||||
echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"
|
echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"
|
||||||
@@ -26,8 +31,13 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
|||||||
# if $KEY exists it should be deleted
|
# if $KEY exists it should be deleted
|
||||||
laconicd keys add $KEY --keyring-backend $KEYRING
|
laconicd keys add $KEY --keyring-backend $KEYRING
|
||||||
|
|
||||||
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
# Set moniker and chain-id
|
||||||
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() {
|
update_genesis() {
|
||||||
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
|
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
|
||||||
@@ -52,6 +62,32 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
|||||||
update_genesis '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"'
|
update_genesis '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$ONBOARDING_ENABLED" == "true" ]]; then
|
||||||
|
echo "Enabling onboarding."
|
||||||
|
|
||||||
|
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 (?)
|
# increase block time (?)
|
||||||
update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"'
|
update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"'
|
||||||
|
|
||||||
@@ -65,6 +101,9 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
|||||||
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Run this to allow requests from any origin
|
||||||
|
sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $HOME/.laconicd/config/config.toml
|
||||||
|
|
||||||
# Enable telemetry (prometheus metrics: http://localhost:1317/metrics?format=prometheus)
|
# Enable telemetry (prometheus metrics: http://localhost:1317/metrics?format=prometheus)
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
sed -i '' 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml
|
sed -i '' 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml
|
||||||
@@ -77,10 +116,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Allocate genesis accounts (cosmos formatted addresses)
|
# 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
|
# 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
|
# Collect genesis tx
|
||||||
laconicd genesis collect-gentxs
|
laconicd genesis collect-gentxs
|
||||||
@@ -95,7 +136,7 @@ fi
|
|||||||
laconicd start \
|
laconicd start \
|
||||||
--pruning=nothing \
|
--pruning=nothing \
|
||||||
--log_level $LOGLEVEL \
|
--log_level $LOGLEVEL \
|
||||||
--minimum-gas-prices=0.0001photon \
|
--minimum-gas-prices=$MIN_GAS_PRICE$DENOM \
|
||||||
--api.enable \
|
--api.enable \
|
||||||
--rpc.laddr="tcp://0.0.0.0:26657" \
|
--rpc.laddr="tcp://0.0.0.0:26657" \
|
||||||
--gql-server --gql-playground
|
--gql-server --gql-playground
|
||||||
|
|||||||
@@ -103,10 +103,13 @@ func (ets *E2ETestSuite) createAuctionAndBid(createAuction, createBid bool) stri
|
|||||||
|
|
||||||
if createAuction {
|
if createAuction {
|
||||||
auctionArgs := []string{
|
auctionArgs := []string{
|
||||||
|
types.AuctionKindVickrey,
|
||||||
sampleCommitTime, sampleRevealTime,
|
sampleCommitTime, sampleRevealTime,
|
||||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||||
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
||||||
|
fmt.Sprintf("0%s", ets.cfg.BondDenom),
|
||||||
|
"0",
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
||||||
|
|||||||
@@ -46,10 +46,13 @@ func (ets *E2ETestSuite) TestTxCommitBid() {
|
|||||||
ets.Run(fmt.Sprintf("Case %s", test.msg), func() {
|
ets.Run(fmt.Sprintf("Case %s", test.msg), func() {
|
||||||
if test.createAuction {
|
if test.createAuction {
|
||||||
auctionArgs := []string{
|
auctionArgs := []string{
|
||||||
|
auctiontypes.AuctionKindVickrey,
|
||||||
sampleCommitTime, sampleRevealTime,
|
sampleCommitTime, sampleRevealTime,
|
||||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||||
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
||||||
|
fmt.Sprintf("0%s", ets.cfg.BondDenom),
|
||||||
|
"0",
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ package keeper_test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"cosmossdk.io/math"
|
"cosmossdk.io/math"
|
||||||
|
sdkmath "cosmossdk.io/math"
|
||||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
integrationTest "git.vdb.to/cerc-io/laconicd/tests/integration"
|
integrationTest "git.vdb.to/cerc-io/laconicd/tests/integration"
|
||||||
types "git.vdb.to/cerc-io/laconicd/x/auction"
|
types "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
@@ -284,6 +287,7 @@ func (kts *KeeperTestSuite) TestGrpcGetAuctionsByOwner() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (kts *KeeperTestSuite) TestGrpcQueryBalance() {
|
func (kts *KeeperTestSuite) TestGrpcQueryBalance() {
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
req *types.QueryGetAuctionModuleBalanceRequest
|
req *types.QueryGetAuctionModuleBalanceRequest
|
||||||
@@ -324,14 +328,20 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create funded account(s)
|
// 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)
|
auction, err := k.CreateAuction(
|
||||||
if err != nil {
|
ctx,
|
||||||
return nil, nil, err
|
types.MsgCreateAuction{
|
||||||
}
|
Kind: types.AuctionKindVickrey,
|
||||||
|
Signer: accounts[0].String(),
|
||||||
auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(*params, accounts[0]))
|
CommitsDuration: 5 * time.Minute,
|
||||||
|
RevealsDuration: 5 * time.Minute,
|
||||||
|
CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)),
|
||||||
|
RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)),
|
||||||
|
MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000000)),
|
||||||
|
},
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,11 +99,19 @@ func (tf *TestFixture) Setup() error {
|
|||||||
log.NewNopLogger(),
|
log.NewNopLogger(),
|
||||||
)
|
)
|
||||||
|
|
||||||
auctionKeeper := auctionkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[auctionTypes.StoreKey]), accountKeeper, bankKeeper)
|
auctionKeeper := auctionkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[auctionTypes.StoreKey]), accountKeeper, bankKeeper, authority.String())
|
||||||
|
|
||||||
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, runtime.NewKVStoreService(keys[registryTypes.StoreKey]), accountKeeper, bankKeeper, bondKeeper, auctionKeeper)
|
registryKeeper := registrykeeper.NewKeeper(
|
||||||
|
cdc,
|
||||||
|
runtime.NewKVStoreService(keys[registryTypes.StoreKey]),
|
||||||
|
accountKeeper,
|
||||||
|
bankKeeper,
|
||||||
|
bondKeeper,
|
||||||
|
auctionKeeper,
|
||||||
|
authority.String(),
|
||||||
|
)
|
||||||
|
|
||||||
authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil)
|
authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil)
|
||||||
bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil)
|
bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func (kts *KeeperTestSuite) createBond() (*bondTypes.Bond, error) {
|
|||||||
ctx := kts.SdkCtx
|
ctx := kts.SdkCtx
|
||||||
|
|
||||||
// Create a funded account
|
// 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))))
|
bond, err := kts.BondKeeper.CreateBond(ctx, kts.accounts[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000000))))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- TEST_AUCTION_ENABLED
|
- TEST_AUCTION_ENABLED
|
||||||
- TEST_REGISTRY_EXPIRY
|
- TEST_REGISTRY_EXPIRY
|
||||||
|
- ONBOARDING_ENABLED
|
||||||
- LOGLEVEL
|
- LOGLEVEL
|
||||||
volumes:
|
volumes:
|
||||||
- ../../scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ../../scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
|
|||||||
@@ -146,7 +146,11 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig,
|
appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig,
|
||||||
cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec())
|
cmtCfg, initCfg, appGenesis,
|
||||||
|
banktypes.GenesisBalancesIterator{},
|
||||||
|
genutiltypes.DefaultMessageValidator,
|
||||||
|
cfg.TxConfig.SigningContext().ValidatorAddressCodec(),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
||||||
|
"github.com/statechannels/go-nitro/crypto"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DecodeEthereumAddress(message []byte, sig string) (string, error) {
|
||||||
|
if len(sig) > 2 && sig[:2] == "0x" {
|
||||||
|
sig = sig[2:]
|
||||||
|
}
|
||||||
|
|
||||||
|
signature := crypto.SplitSignature(common.Hex2Bytes(sig))
|
||||||
|
ethereumAddress, err := crypto.RecoverEthereumMessageSigner(message, signature)
|
||||||
|
|
||||||
|
return ethereumAddress.String(), err
|
||||||
|
}
|
||||||
+318
-401
@@ -9,7 +9,6 @@ import (
|
|||||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
|
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
|
||||||
_ "google.golang.org/protobuf/types/known/durationpb"
|
|
||||||
_ "google.golang.org/protobuf/types/known/timestamppb"
|
_ "google.golang.org/protobuf/types/known/timestamppb"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
@@ -31,20 +30,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
|
|
||||||
// Params defines the auction module parameters
|
// Params defines the auction module parameters
|
||||||
type Params struct {
|
type Params struct {
|
||||||
// Duration of the commits phase in seconds
|
|
||||||
CommitsDuration time.Duration `protobuf:"bytes,1,opt,name=commits_duration,json=commitsDuration,proto3,stdduration" json:"commits_duration" json:"commits_duration" yaml:"commits_duration"`
|
|
||||||
// Duration of the reveals phase in seconds
|
|
||||||
RevealsDuration time.Duration `protobuf:"bytes,2,opt,name=reveals_duration,json=revealsDuration,proto3,stdduration" json:"reveals_duration" json:"reveals_duration" yaml:"reveals_duration"`
|
|
||||||
// Commit fees
|
|
||||||
CommitFee types.Coin `protobuf:"bytes,3,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"`
|
|
||||||
// Reveal fees
|
|
||||||
RevealFee types.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"`
|
|
||||||
// Minimum acceptable bid amount
|
|
||||||
MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Params) Reset() { *m = Params{} }
|
func (m *Params) Reset() { *m = Params{} }
|
||||||
func (*Params) ProtoMessage() {}
|
func (m *Params) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Params) ProtoMessage() {}
|
||||||
func (*Params) Descriptor() ([]byte, []int) {
|
func (*Params) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_34b162eb5b365523, []int{0}
|
return fileDescriptor_34b162eb5b365523, []int{0}
|
||||||
}
|
}
|
||||||
@@ -75,65 +65,47 @@ func (m *Params) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_Params proto.InternalMessageInfo
|
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Params) GetCommitsDuration() time.Duration {
|
|
||||||
if m != nil {
|
|
||||||
return m.CommitsDuration
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Params) GetRevealsDuration() time.Duration {
|
|
||||||
if m != nil {
|
|
||||||
return m.RevealsDuration
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Params) GetCommitFee() types.Coin {
|
|
||||||
if m != nil {
|
|
||||||
return m.CommitFee
|
|
||||||
}
|
|
||||||
return types.Coin{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Params) GetRevealFee() types.Coin {
|
|
||||||
if m != nil {
|
|
||||||
return m.RevealFee
|
|
||||||
}
|
|
||||||
return types.Coin{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Params) GetMinimumBid() types.Coin {
|
|
||||||
if m != nil {
|
|
||||||
return m.MinimumBid
|
|
||||||
}
|
|
||||||
return types.Coin{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auction represents a sealed-bid on-chain auction
|
// Auction represents a sealed-bid on-chain auction
|
||||||
type Auction struct {
|
type Auction struct {
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
|
// Auction kind (vickrey | provider)
|
||||||
|
Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"`
|
||||||
|
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
// Address of the creator of the auction
|
// Address of the creator of the auction
|
||||||
OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"`
|
OwnerAddress string `protobuf:"bytes,4,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"`
|
||||||
// Timestamp at which the auction was created
|
// Timestamp at which the auction was created
|
||||||
CreateTime time.Time `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" json:"create_time" yaml:"create_time"`
|
CreateTime time.Time `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" json:"create_time" yaml:"create_time"`
|
||||||
// Timestamp at which the commits phase concluded
|
// Timestamp at which the commits phase concluded
|
||||||
CommitsEndTime time.Time `protobuf:"bytes,5,opt,name=commits_end_time,json=commitsEndTime,proto3,stdtime" json:"commits_end_time" json:"commits_end_time" yaml:"commits_end_time"`
|
CommitsEndTime time.Time `protobuf:"bytes,6,opt,name=commits_end_time,json=commitsEndTime,proto3,stdtime" json:"commits_end_time" json:"commits_end_time" yaml:"commits_end_time"`
|
||||||
// Timestamp at which the reveals phase concluded
|
// Timestamp at which the reveals phase concluded
|
||||||
RevealsEndTime time.Time `protobuf:"bytes,6,opt,name=reveals_end_time,json=revealsEndTime,proto3,stdtime" json:"reveals_end_time" json:"reveals_end_time" yaml:"reveals_end_time"`
|
RevealsEndTime time.Time `protobuf:"bytes,7,opt,name=reveals_end_time,json=revealsEndTime,proto3,stdtime" json:"reveals_end_time" json:"reveals_end_time" yaml:"reveals_end_time"`
|
||||||
// Commit and reveal fees must both be paid when committing a bid
|
// Commit and reveal fees must both be paid when committing a bid
|
||||||
// Reveal fee is returned only if the bid is revealed
|
// Reveal fee is returned only if the bid is revealed
|
||||||
CommitFee types.Coin `protobuf:"bytes,7,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"`
|
CommitFee types.Coin `protobuf:"bytes,8,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"`
|
||||||
RevealFee types.Coin `protobuf:"bytes,8,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"`
|
RevealFee types.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"`
|
||||||
// Minimum acceptable bid amount for a valid commit
|
// Minimum acceptable bid amount for a valid commit
|
||||||
MinimumBid types.Coin `protobuf:"bytes,9,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"`
|
// Only applicable in vickrey auctions
|
||||||
// Address of the winner
|
MinimumBid types.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"`
|
||||||
WinnerAddress string `protobuf:"bytes,10,opt,name=winner_address,json=winnerAddress,proto3" json:"winner_address,omitempty"`
|
// Addresses of the winners
|
||||||
// Winning bid, i.e., the highest bid
|
// (single winner for vickrey auction)
|
||||||
WinningBid types.Coin `protobuf:"bytes,11,opt,name=winning_bid,json=winningBid,proto3" json:"winning_bid" json:"winning_bid" yaml:"winning_bid"`
|
// (multiple winners for provider auctions)
|
||||||
// Amount the winner pays, i.e. the second highest auction
|
WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"`
|
||||||
WinningPrice types.Coin `protobuf:"bytes,12,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"`
|
// Winning bids, i.e. the best bids
|
||||||
|
WinningBids []types.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"`
|
||||||
|
// Auction winning price
|
||||||
|
// vickrey auction: second highest bid, paid by the winner
|
||||||
|
// provider auction: higest bid amongst winning_bids, paid by auction creator
|
||||||
|
// to each winner
|
||||||
|
WinningPrice types.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"`
|
||||||
|
// Maximum acceptable bid amount for a valid commit
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"`
|
||||||
|
// Number of desired providers (num of auction winners)
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"`
|
||||||
|
// Whether funds have been released to providers
|
||||||
|
// Only applicable in provider auctions
|
||||||
|
FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Auction) Reset() { *m = Auction{} }
|
func (m *Auction) Reset() { *m = Auction{} }
|
||||||
@@ -263,57 +235,60 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) }
|
func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) }
|
||||||
|
|
||||||
var fileDescriptor_34b162eb5b365523 = []byte{
|
var fileDescriptor_34b162eb5b365523 = []byte{
|
||||||
// 798 bytes of a gzipped FileDescriptorProto
|
// 846 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x4f, 0xdb, 0x4a,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcd, 0x6e, 0xeb, 0x44,
|
||||||
0x14, 0x8d, 0x49, 0x08, 0xf1, 0x98, 0xc0, 0x93, 0xf5, 0xf4, 0x94, 0x17, 0x89, 0x04, 0x05, 0x21,
|
0x14, 0xc7, 0xe3, 0x7e, 0xe4, 0x26, 0x27, 0x4d, 0x5a, 0x59, 0x08, 0x4c, 0xd1, 0x8d, 0x43, 0xaa,
|
||||||
0xf1, 0xf4, 0x84, 0xad, 0xd0, 0x5d, 0xba, 0xa8, 0x48, 0x3f, 0xd4, 0x4a, 0x5d, 0x20, 0xab, 0xab,
|
0x8a, 0x54, 0x57, 0xd7, 0x56, 0x60, 0x57, 0x16, 0xa8, 0x46, 0x20, 0x90, 0x58, 0x54, 0x16, 0x62,
|
||||||
0x6e, 0xa2, 0xb1, 0x67, 0x08, 0x53, 0xc5, 0x1e, 0xea, 0x71, 0x42, 0xbb, 0xec, 0xae, 0x4b, 0xd4,
|
0xc1, 0xc6, 0x1a, 0x7b, 0xa6, 0xe9, 0x40, 0x66, 0xa6, 0x78, 0xec, 0xdc, 0xb2, 0x64, 0xc7, 0xf2,
|
||||||
0x15, 0xbb, 0xf6, 0xe7, 0xb0, 0x2b, 0xcb, 0xae, 0x68, 0x05, 0xff, 0xa0, 0xbf, 0xa0, 0x9a, 0xaf,
|
0xbe, 0x01, 0xec, 0x79, 0x91, 0xbb, 0xbc, 0x4b, 0x56, 0x01, 0xb5, 0x6f, 0xd0, 0x27, 0x40, 0x9e,
|
||||||
0x64, 0x6c, 0xa8, 0xd2, 0x2c, 0x60, 0xe7, 0x39, 0x33, 0xf7, 0x9e, 0x73, 0x2f, 0xf7, 0xdc, 0x00,
|
0x8f, 0xd4, 0x31, 0x1f, 0xa1, 0x57, 0xea, 0x6e, 0xce, 0x7f, 0xe6, 0xcc, 0xef, 0x9c, 0xc9, 0xf1,
|
||||||
0x36, 0x22, 0x9c, 0x46, 0x3e, 0x1c, 0x47, 0x19, 0xa1, 0x89, 0x3f, 0xe9, 0xea, 0x4f, 0xef, 0x38,
|
0x5f, 0x81, 0xa7, 0x19, 0xc9, 0xb3, 0x10, 0x95, 0x59, 0x41, 0x05, 0x0f, 0x17, 0x53, 0xbb, 0x0c,
|
||||||
0xa5, 0x19, 0x75, 0xd7, 0xf9, 0xb5, 0xa7, 0xb1, 0x49, 0xb7, 0xf9, 0xf7, 0x90, 0x0e, 0xa9, 0xb8,
|
0xae, 0x72, 0x51, 0x08, 0x77, 0xbf, 0xda, 0x0e, 0xac, 0xb6, 0x98, 0x1e, 0xbe, 0x35, 0x13, 0x33,
|
||||||
0xf3, 0xf9, 0x97, 0x7c, 0xd6, 0x6c, 0x0d, 0x29, 0x1d, 0x8e, 0xb0, 0x2f, 0x4e, 0xe1, 0xf8, 0xd0,
|
0xa1, 0xf6, 0xc2, 0x6a, 0xa5, 0x8f, 0x1d, 0xfa, 0x33, 0x21, 0x66, 0x73, 0x12, 0xaa, 0x28, 0x2d,
|
||||||
0x47, 0xe3, 0x14, 0xce, 0xd2, 0x34, 0xdb, 0xc5, 0xfb, 0x8c, 0xc4, 0x98, 0x65, 0x30, 0x3e, 0xd6,
|
0x2f, 0xc2, 0x82, 0x32, 0x22, 0x0b, 0xc4, 0xae, 0xcc, 0x81, 0x61, 0x26, 0x24, 0x13, 0x32, 0x4c,
|
||||||
0x09, 0x22, 0xca, 0x62, 0xca, 0xfc, 0x10, 0x32, 0xec, 0x4f, 0xba, 0x21, 0xce, 0x60, 0xd7, 0x8f,
|
0x91, 0x24, 0xe1, 0x62, 0x9a, 0x92, 0x02, 0x4d, 0xc3, 0x4c, 0x50, 0xc3, 0x19, 0x77, 0xa0, 0x7d,
|
||||||
0x28, 0x51, 0x09, 0x3a, 0x5f, 0x2b, 0xa0, 0x7a, 0x00, 0x53, 0x18, 0x33, 0xf7, 0x83, 0x05, 0xfe,
|
0x8e, 0x72, 0xc4, 0xe4, 0xf8, 0x37, 0x80, 0x27, 0x67, 0x9a, 0xe7, 0x0e, 0x60, 0x8b, 0x62, 0xcf,
|
||||||
0x8a, 0x68, 0x1c, 0x93, 0x8c, 0x0d, 0x34, 0x4d, 0xc3, 0xda, 0xb4, 0x76, 0x9c, 0xbd, 0x7f, 0x3d,
|
0x19, 0x39, 0x93, 0x6e, 0xbc, 0x45, 0xb1, 0x1b, 0xc2, 0xce, 0xf7, 0x94, 0x63, 0x6f, 0xab, 0x52,
|
||||||
0xc9, 0xe3, 0x69, 0x1e, 0xef, 0x89, 0x7a, 0xd0, 0x7f, 0x78, 0x7e, 0xd9, 0x2e, 0xfd, 0xbc, 0x6c,
|
0xa2, 0xf7, 0xee, 0x96, 0xfe, 0x3b, 0xdf, 0x49, 0xc1, 0x4f, 0xc7, 0x95, 0x3a, 0x1e, 0xfd, 0x88,
|
||||||
0xfb, 0x6f, 0x18, 0x4d, 0x7a, 0x9d, 0x62, 0x82, 0xce, 0xe6, 0x7b, 0x18, 0x8f, 0x6e, 0xc1, 0xcf,
|
0xd8, 0xdc, 0xac, 0x63, 0x75, 0xd0, 0x7d, 0x1b, 0xda, 0xb2, 0x40, 0x45, 0x29, 0xbd, 0x6d, 0x75,
|
||||||
0xbe, 0xb7, 0xad, 0x60, 0x5d, 0xc1, 0x3a, 0x9b, 0xd0, 0x90, 0xe2, 0x09, 0x86, 0x23, 0x43, 0xc3,
|
0x89, 0x89, 0xdc, 0x23, 0xe8, 0x8b, 0x17, 0x9c, 0xe4, 0x09, 0xc2, 0x38, 0x27, 0x52, 0x7a, 0x3b,
|
||||||
0xd2, 0x82, 0x1a, 0x8a, 0x09, 0xb4, 0x86, 0x1b, 0xb8, 0xd4, 0xa0, 0xe0, 0xa9, 0x06, 0x0c, 0x80,
|
0x6a, 0x7b, 0x4f, 0x89, 0x67, 0x5a, 0x73, 0x39, 0xf4, 0xb2, 0x9c, 0xa0, 0x82, 0x24, 0x55, 0x37,
|
||||||
0x94, 0x35, 0x38, 0xc4, 0xb8, 0x51, 0x56, 0xe4, 0xb2, 0x8f, 0x1e, 0xef, 0xa3, 0xa7, 0xfa, 0xe8,
|
0xde, 0xee, 0xc8, 0x99, 0xf4, 0x3e, 0x3c, 0x0c, 0x74, 0xab, 0x81, 0x6d, 0x35, 0xf8, 0xda, 0xb6,
|
||||||
0x3d, 0xa6, 0x24, 0xe9, 0xff, 0xaf, 0xc8, 0xb7, 0xcc, 0x06, 0xf0, 0xd0, 0x7c, 0xe9, 0x02, 0x09,
|
0x1a, 0x4d, 0x5f, 0x2d, 0xfd, 0xd6, 0xdd, 0xd2, 0x3f, 0xd6, 0x45, 0xd5, 0x92, 0x6d, 0x6d, 0x75,
|
||||||
0x6c, 0x79, 0x78, 0x86, 0x31, 0xa7, 0x91, 0xcc, 0x82, 0xa6, 0xb2, 0x20, 0xcd, 0x2c, 0x34, 0x5f,
|
0xe9, 0xe5, 0x1f, 0xbe, 0x13, 0x83, 0x56, 0xaa, 0x3b, 0xdc, 0x9f, 0x1c, 0x38, 0xc8, 0x04, 0x63,
|
||||||
0x9d, 0xa2, 0x91, 0x07, 0x4e, 0x43, 0x80, 0x13, 0x93, 0x84, 0xc4, 0xe3, 0x78, 0x10, 0x12, 0xd4,
|
0xb4, 0x90, 0x09, 0xe1, 0x58, 0x53, 0xdb, 0x1b, 0xa9, 0x1f, 0x1b, 0x6a, 0x68, 0xa8, 0x8d, 0x1b,
|
||||||
0x58, 0x9e, 0xc7, 0xb3, 0xab, 0x78, 0xb6, 0x25, 0x8f, 0x11, 0xab, 0x89, 0x4c, 0x28, 0x00, 0xea,
|
0x56, 0xe8, 0xa6, 0xae, 0xf8, 0x03, 0x23, 0x7f, 0xc6, 0xf1, 0xaa, 0x86, 0x9c, 0x2c, 0x08, 0x9a,
|
||||||
0xd4, 0x27, 0xa8, 0x57, 0x39, 0xfb, 0xd2, 0x2e, 0x75, 0x3e, 0xd5, 0xc0, 0xca, 0xbe, 0x9c, 0x6b,
|
0xd7, 0x6a, 0x78, 0xf2, 0xd0, 0x1a, 0x9a, 0x37, 0xd8, 0x1a, 0xfe, 0xa6, 0xeb, 0x1a, 0x8c, 0x6c,
|
||||||
0x77, 0x0d, 0x2c, 0x11, 0x24, 0x66, 0xc8, 0x0e, 0x96, 0x08, 0x72, 0xff, 0x01, 0x55, 0x96, 0xc1,
|
0x6b, 0x20, 0x00, 0xba, 0xaa, 0xe4, 0x82, 0x10, 0xaf, 0xa3, 0xe0, 0xef, 0x06, 0x7a, 0x80, 0x82,
|
||||||
0x6c, 0xcc, 0xc4, 0xdf, 0xd4, 0x0e, 0xd4, 0xc9, 0xdd, 0x02, 0x75, 0x7a, 0x92, 0xe0, 0x74, 0x00,
|
0x6a, 0x80, 0x02, 0x33, 0x40, 0xc1, 0xa7, 0x82, 0xf2, 0xe8, 0x99, 0x61, 0x1f, 0xd5, 0xfb, 0xaf,
|
||||||
0x11, 0x4a, 0x31, 0x63, 0xa2, 0xeb, 0x76, 0xb0, 0x2a, 0xc0, 0x7d, 0x89, 0xb9, 0x09, 0x70, 0xa2,
|
0x52, 0xd7, 0x3b, 0x57, 0x4a, 0xdc, 0xd5, 0xc1, 0xe7, 0x44, 0x61, 0x34, 0x58, 0x61, 0xba, 0x0f,
|
||||||
0x14, 0xc3, 0x0c, 0x0f, 0xf8, 0x90, 0xab, 0x8e, 0x35, 0x6f, 0x4c, 0xc5, 0x2b, 0xed, 0x80, 0x7e,
|
0xc4, 0xdc, 0xa7, 0xae, 0x37, 0x67, 0x30, 0x3a, 0xa8, 0x30, 0x14, 0x7a, 0x8c, 0x72, 0xca, 0x4a,
|
||||||
0x37, 0x5f, 0x8a, 0x11, 0x3c, 0xfd, 0xd3, 0x18, 0xd0, 0x29, 0x1f, 0x06, 0x20, 0x11, 0x9e, 0x23,
|
0x96, 0xa4, 0x14, 0x7b, 0xb0, 0x89, 0xf3, 0x7c, 0x7d, 0x88, 0x6a, 0xb9, 0x16, 0x54, 0x97, 0x62,
|
||||||
0xe7, 0x07, 0x9c, 0x20, 0xc9, 0xba, 0x3c, 0x97, 0xf5, 0x37, 0x86, 0xd0, 0x19, 0x8a, 0x86, 0x98,
|
0x30, 0x51, 0x44, 0xb1, 0x7b, 0x02, 0x07, 0x2f, 0x28, 0xaf, 0x8d, 0x35, 0x91, 0x5e, 0x6f, 0xb4,
|
||||||
0xe2, 0x82, 0x7f, 0x4d, 0xc1, 0x4f, 0x13, 0x34, 0xd5, 0xa0, 0xc7, 0x76, 0xaa, 0xa1, 0xba, 0xa8,
|
0x3d, 0xe9, 0xc6, 0xfb, 0x5a, 0x3f, 0xb3, 0xb2, 0xcb, 0x60, 0xaf, 0x92, 0x28, 0x9f, 0x55, 0xd7,
|
||||||
0x86, 0x62, 0x86, 0xa2, 0x21, 0x0a, 0x1a, 0x14, 0xac, 0x35, 0xe4, 0xfd, 0xb0, 0x72, 0x3f, 0x7e,
|
0x48, 0x6f, 0x6f, 0xb4, 0xfd, 0xdf, 0x65, 0x85, 0xa6, 0xac, 0x0f, 0x74, 0x59, 0xf5, 0x64, 0x5b,
|
||||||
0xa8, 0xdd, 0x93, 0x1f, 0xec, 0xbb, 0xf3, 0x83, 0xbb, 0x0d, 0xd6, 0x4e, 0x48, 0x62, 0x8e, 0x35,
|
0xd7, 0x9a, 0x16, 0xf7, 0x4c, 0x18, 0x51, 0x2c, 0xdd, 0x1f, 0xa0, 0x6f, 0x77, 0xaf, 0x72, 0x9a,
|
||||||
0x10, 0x63, 0x5d, 0x97, 0xa8, 0x9e, 0x6b, 0x02, 0x1c, 0x0e, 0x90, 0x64, 0x28, 0x14, 0x39, 0x0b,
|
0x11, 0xaf, 0xbf, 0xe9, 0x19, 0xec, 0xb7, 0x74, 0xb2, 0xce, 0x53, 0xd9, 0x4d, 0xa0, 0x16, 0x63,
|
||||||
0x2a, 0x32, 0x62, 0xb5, 0x22, 0x13, 0x0a, 0x80, 0x3a, 0x71, 0x45, 0x6f, 0x41, 0x5d, 0xdf, 0x1d,
|
0xdb, 0xd1, 0x79, 0x15, 0xba, 0x08, 0xba, 0x0c, 0x5d, 0x1b, 0xdc, 0x60, 0x13, 0xee, 0xc4, 0xe0,
|
||||||
0xa7, 0x24, 0xc2, 0x8d, 0xd5, 0x79, 0x64, 0xda, 0x43, 0xff, 0xe5, 0xc9, 0x44, 0x74, 0x91, 0x4e,
|
0xde, 0x37, 0xaf, 0x6e, 0x33, 0x57, 0x6f, 0xbe, 0x12, 0xe2, 0x0e, 0x43, 0xd7, 0x1a, 0x71, 0x04,
|
||||||
0x82, 0xc1, 0xaa, 0x3a, 0x1f, 0xf0, 0x63, 0xaf, 0xf2, 0x91, 0x2f, 0x85, 0x97, 0xa0, 0xa6, 0x76,
|
0x7d, 0x5e, 0xb2, 0xe4, 0x2a, 0x17, 0x0b, 0x8a, 0x49, 0x2e, 0xbd, 0xfd, 0x91, 0x33, 0xd9, 0x8d,
|
||||||
0x02, 0x73, 0x7b, 0xa0, 0xa6, 0x7e, 0xf7, 0x58, 0xc3, 0xda, 0x2c, 0xef, 0x38, 0x7b, 0x0d, 0xaf,
|
0xf7, 0x78, 0xc9, 0xce, 0xad, 0xe6, 0x7e, 0x03, 0x83, 0x8b, 0x92, 0x63, 0x99, 0xe4, 0x64, 0x4e,
|
||||||
0xf0, 0x6b, 0xe8, 0xa9, 0xc7, 0xfd, 0x0a, 0xa7, 0x0f, 0xa6, 0xef, 0x55, 0xb6, 0xcf, 0xcb, 0xa0,
|
0x90, 0x24, 0xd8, 0x3b, 0x18, 0x39, 0x93, 0x4e, 0x14, 0xde, 0x2d, 0xfd, 0x67, 0x9a, 0xb6, 0xbe,
|
||||||
0xcc, 0xcb, 0xd9, 0x00, 0x40, 0xdd, 0x0c, 0xa6, 0x6b, 0xc6, 0x56, 0xc8, 0x0b, 0xd1, 0xff, 0x90,
|
0x6f, 0x91, 0x0d, 0x35, 0xee, 0x2b, 0x21, 0x36, 0xf1, 0xe9, 0xce, 0xcf, 0xbf, 0xfa, 0xad, 0xf1,
|
||||||
0x20, 0x64, 0xf4, 0x5f, 0x6e, 0x9d, 0xba, 0x44, 0x75, 0xff, 0x67, 0x4b, 0xa9, 0x9c, 0x5b, 0x4a,
|
0x57, 0xd0, 0x31, 0x66, 0x29, 0xdd, 0x53, 0xe8, 0x18, 0xa3, 0x96, 0x9e, 0xa3, 0x7e, 0x4f, 0x2f,
|
||||||
0x6d, 0xe0, 0xa8, 0x51, 0x3d, 0x82, 0xec, 0x48, 0xec, 0x1b, 0x3b, 0x50, 0x56, 0x78, 0x0e, 0xd9,
|
0x68, 0xd8, 0x77, 0x60, 0x0e, 0x47, 0x3b, 0x55, 0xbf, 0xf1, 0xea, 0xbc, 0xb9, 0xed, 0x97, 0x5d,
|
||||||
0x91, 0x58, 0x48, 0xf2, 0xc1, 0x1f, 0xae, 0x86, 0xe2, 0x42, 0x9a, 0x05, 0x17, 0xbc, 0x61, 0x2e,
|
0xd8, 0xae, 0x06, 0xe9, 0x29, 0x80, 0xd9, 0x49, 0x56, 0xfe, 0xdb, 0x35, 0xca, 0x97, 0xd8, 0x3d,
|
||||||
0x24, 0x81, 0xdc, 0x62, 0xc4, 0xea, 0x5d, 0x19, 0x31, 0x01, 0x8e, 0xf2, 0x8e, 0x28, 0x6b, 0x65,
|
0x86, 0x41, 0x4a, 0x31, 0xae, 0xd9, 0xa7, 0x32, 0xe4, 0xb8, 0xaf, 0x55, 0xeb, 0x9f, 0xff, 0x66,
|
||||||
0xd1, 0xb2, 0x8c, 0xe0, 0x82, 0x17, 0x8d, 0xb2, 0x24, 0xa2, 0xcb, 0xba, 0x0f, 0xe3, 0x63, 0x00,
|
0xbe, 0x3e, 0xf4, 0xcc, 0x27, 0x79, 0x89, 0xe4, 0xa5, 0xb1, 0x5e, 0xf3, 0xc9, 0x7f, 0x81, 0xe4,
|
||||||
0x42, 0x82, 0x06, 0x30, 0xa6, 0xe3, 0x24, 0x9b, 0xef, 0xfb, 0x02, 0xcd, 0x2c, 0x54, 0xd3, 0x18,
|
0xa5, 0x32, 0x5e, 0x7d, 0xe0, 0x0d, 0x8d, 0xf7, 0x3e, 0xb9, 0xe1, 0x01, 0x75, 0xe3, 0x55, 0xca,
|
||||||
0x48, 0x60, 0x87, 0x04, 0xed, 0x8b, 0x6f, 0x39, 0xa1, 0xfd, 0x47, 0xe7, 0x57, 0x2d, 0xeb, 0xe2,
|
0x3f, 0x18, 0x4e, 0xfb, 0xb1, 0x0c, 0x87, 0x43, 0xcf, 0x78, 0xc4, 0xff, 0x74, 0xd5, 0x46, 0x5b,
|
||||||
0xaa, 0x65, 0xfd, 0xb8, 0x6a, 0x59, 0xa7, 0xd7, 0xad, 0xd2, 0xc5, 0x75, 0xab, 0xf4, 0xed, 0xba,
|
0xb5, 0xe4, 0x86, 0xe7, 0xd4, 0xda, 0xd2, 0x8a, 0x6d, 0xab, 0x66, 0x70, 0x9d, 0xc7, 0x32, 0x38,
|
||||||
0x55, 0x7a, 0xbd, 0x3d, 0x24, 0x99, 0x37, 0x41, 0xa1, 0x97, 0x51, 0x9f, 0x4f, 0xfd, 0x2e, 0xa1,
|
0x02, 0x90, 0x52, 0x9c, 0x20, 0x26, 0x4a, 0x5e, 0x3c, 0xd8, 0x47, 0xef, 0x53, 0x2d, 0xa6, 0xa6,
|
||||||
0xfe, 0x08, 0x46, 0x34, 0x21, 0x11, 0xf2, 0xdf, 0xe9, 0xff, 0x12, 0xc3, 0xaa, 0xe8, 0xf3, 0x83,
|
0xc4, 0xdd, 0x94, 0xe2, 0x33, 0xb5, 0xd6, 0x13, 0x1a, 0x7d, 0xf2, 0xea, 0x66, 0xe8, 0xbc, 0xbe,
|
||||||
0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0xbb, 0x15, 0xc2, 0x47, 0x0a, 0x00, 0x00,
|
0x19, 0x3a, 0x7f, 0xde, 0x0c, 0x9d, 0x97, 0xb7, 0xc3, 0xd6, 0xeb, 0xdb, 0x61, 0xeb, 0xf7, 0xdb,
|
||||||
|
0x61, 0xeb, 0xdb, 0xe3, 0x19, 0x2d, 0x82, 0x05, 0x4e, 0x83, 0x42, 0x84, 0xd5, 0xd4, 0x3f, 0xa7,
|
||||||
|
0x22, 0x9c, 0xa3, 0x4c, 0x70, 0x9a, 0xe1, 0xf0, 0xda, 0xfe, 0xad, 0x49, 0xdb, 0xea, 0x9d, 0x3f,
|
||||||
|
0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x67, 0x62, 0x6b, 0xf8, 0x08, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||||
@@ -336,52 +311,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
{
|
|
||||||
size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x2a
|
|
||||||
{
|
|
||||||
size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
{
|
|
||||||
size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RevealsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration):])
|
|
||||||
if err4 != nil {
|
|
||||||
return 0, err4
|
|
||||||
}
|
|
||||||
i -= n4
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n4))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CommitsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration):])
|
|
||||||
if err5 != nil {
|
|
||||||
return 0, err5
|
|
||||||
}
|
|
||||||
i -= n5
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n5))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,6 +334,33 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.FundsReleased {
|
||||||
|
i--
|
||||||
|
if m.FundsReleased {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x80
|
||||||
|
}
|
||||||
|
if m.NumProviders != 0 {
|
||||||
|
i = encodeVarintAuction(dAtA, i, uint64(m.NumProviders))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x78
|
||||||
|
}
|
||||||
|
{
|
||||||
|
size, err := m.MaxPrice.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x72
|
||||||
{
|
{
|
||||||
size, err := m.WinningPrice.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.WinningPrice.MarshalToSizedBuffer(dAtA[:i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -414,23 +370,29 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x62
|
dAtA[i] = 0x6a
|
||||||
{
|
if len(m.WinningBids) > 0 {
|
||||||
size, err := m.WinningBid.MarshalToSizedBuffer(dAtA[:i])
|
for iNdEx := len(m.WinningBids) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
if err != nil {
|
{
|
||||||
return 0, err
|
size, err := m.WinningBids[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x62
|
||||||
}
|
}
|
||||||
i -= size
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
|
||||||
}
|
}
|
||||||
i--
|
if len(m.WinnerAddresses) > 0 {
|
||||||
dAtA[i] = 0x5a
|
for iNdEx := len(m.WinnerAddresses) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
if len(m.WinnerAddress) > 0 {
|
i -= len(m.WinnerAddresses[iNdEx])
|
||||||
i -= len(m.WinnerAddress)
|
copy(dAtA[i:], m.WinnerAddresses[iNdEx])
|
||||||
copy(dAtA[i:], m.WinnerAddress)
|
i = encodeVarintAuction(dAtA, i, uint64(len(m.WinnerAddresses[iNdEx])))
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(len(m.WinnerAddress)))
|
i--
|
||||||
i--
|
dAtA[i] = 0x5a
|
||||||
dAtA[i] = 0x52
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i])
|
||||||
@@ -441,7 +403,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x4a
|
dAtA[i] = 0x52
|
||||||
{
|
{
|
||||||
size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -451,7 +413,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x42
|
dAtA[i] = 0x4a
|
||||||
{
|
{
|
||||||
size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i])
|
size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -461,43 +423,50 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintAuction(dAtA, i, uint64(size))
|
i = encodeVarintAuction(dAtA, i, uint64(size))
|
||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x3a
|
dAtA[i] = 0x42
|
||||||
n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealsEndTime):])
|
n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealsEndTime):])
|
||||||
if err11 != nil {
|
if err6 != nil {
|
||||||
return 0, err11
|
return 0, err6
|
||||||
}
|
}
|
||||||
i -= n11
|
i -= n6
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n11))
|
i = encodeVarintAuction(dAtA, i, uint64(n6))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x3a
|
||||||
|
n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitsEndTime):])
|
||||||
|
if err7 != nil {
|
||||||
|
return 0, err7
|
||||||
|
}
|
||||||
|
i -= n7
|
||||||
|
i = encodeVarintAuction(dAtA, i, uint64(n7))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x32
|
dAtA[i] = 0x32
|
||||||
n12, err12 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitsEndTime):])
|
n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CreateTime):])
|
||||||
if err12 != nil {
|
if err8 != nil {
|
||||||
return 0, err12
|
return 0, err8
|
||||||
}
|
}
|
||||||
i -= n12
|
i -= n8
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n12))
|
i = encodeVarintAuction(dAtA, i, uint64(n8))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x2a
|
dAtA[i] = 0x2a
|
||||||
n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CreateTime):])
|
|
||||||
if err13 != nil {
|
|
||||||
return 0, err13
|
|
||||||
}
|
|
||||||
i -= n13
|
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n13))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
if len(m.OwnerAddress) > 0 {
|
if len(m.OwnerAddress) > 0 {
|
||||||
i -= len(m.OwnerAddress)
|
i -= len(m.OwnerAddress)
|
||||||
copy(dAtA[i:], m.OwnerAddress)
|
copy(dAtA[i:], m.OwnerAddress)
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(len(m.OwnerAddress)))
|
i = encodeVarintAuction(dAtA, i, uint64(len(m.OwnerAddress)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x1a
|
dAtA[i] = 0x22
|
||||||
}
|
}
|
||||||
if len(m.Status) > 0 {
|
if len(m.Status) > 0 {
|
||||||
i -= len(m.Status)
|
i -= len(m.Status)
|
||||||
copy(dAtA[i:], m.Status)
|
copy(dAtA[i:], m.Status)
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(len(m.Status)))
|
i = encodeVarintAuction(dAtA, i, uint64(len(m.Status)))
|
||||||
i--
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
if len(m.Kind) > 0 {
|
||||||
|
i -= len(m.Kind)
|
||||||
|
copy(dAtA[i:], m.Kind)
|
||||||
|
i = encodeVarintAuction(dAtA, i, uint64(len(m.Kind)))
|
||||||
|
i--
|
||||||
dAtA[i] = 0x12
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if len(m.Id) > 0 {
|
if len(m.Id) > 0 {
|
||||||
@@ -587,12 +556,12 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x42
|
dAtA[i] = 0x42
|
||||||
n16, err16 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealTime):])
|
n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealTime):])
|
||||||
if err16 != nil {
|
if err11 != nil {
|
||||||
return 0, err16
|
return 0, err11
|
||||||
}
|
}
|
||||||
i -= n16
|
i -= n11
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n16))
|
i = encodeVarintAuction(dAtA, i, uint64(n11))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x3a
|
dAtA[i] = 0x3a
|
||||||
{
|
{
|
||||||
@@ -605,12 +574,12 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x32
|
dAtA[i] = 0x32
|
||||||
n18, err18 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitTime):])
|
n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitTime):])
|
||||||
if err18 != nil {
|
if err13 != nil {
|
||||||
return 0, err18
|
return 0, err13
|
||||||
}
|
}
|
||||||
i -= n18
|
i -= n13
|
||||||
i = encodeVarintAuction(dAtA, i, uint64(n18))
|
i = encodeVarintAuction(dAtA, i, uint64(n13))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x2a
|
dAtA[i] = 0x2a
|
||||||
if len(m.CommitHash) > 0 {
|
if len(m.CommitHash) > 0 {
|
||||||
@@ -661,16 +630,6 @@ func (m *Params) Size() (n int) {
|
|||||||
}
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration)
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration)
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
l = m.CommitFee.Size()
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
l = m.RevealFee.Size()
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
l = m.MinimumBid.Size()
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,6 +643,10 @@ func (m *Auction) Size() (n int) {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
}
|
}
|
||||||
|
l = len(m.Kind)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
|
}
|
||||||
l = len(m.Status)
|
l = len(m.Status)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
@@ -704,14 +667,28 @@ func (m *Auction) Size() (n int) {
|
|||||||
n += 1 + l + sovAuction(uint64(l))
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
l = m.MinimumBid.Size()
|
l = m.MinimumBid.Size()
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
l = len(m.WinnerAddress)
|
if len(m.WinnerAddresses) > 0 {
|
||||||
if l > 0 {
|
for _, s := range m.WinnerAddresses {
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
l = len(s)
|
||||||
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.WinningBids) > 0 {
|
||||||
|
for _, e := range m.WinningBids {
|
||||||
|
l = e.Size()
|
||||||
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
l = m.WinningBid.Size()
|
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
|
||||||
l = m.WinningPrice.Size()
|
l = m.WinningPrice.Size()
|
||||||
n += 1 + l + sovAuction(uint64(l))
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
|
l = m.MaxPrice.Size()
|
||||||
|
n += 1 + l + sovAuction(uint64(l))
|
||||||
|
if m.NumProviders != 0 {
|
||||||
|
n += 1 + sovAuction(uint64(m.NumProviders))
|
||||||
|
}
|
||||||
|
if m.FundsReleased {
|
||||||
|
n += 3
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -800,171 +777,6 @@ func (m *Params) Unmarshal(dAtA []byte) error {
|
|||||||
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field CommitsDuration", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuction
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CommitsDuration, dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field RevealsDuration", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuction
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RevealsDuration, dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuction
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := m.CommitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuction
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := m.RevealFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 5:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAuction
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAuction
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := m.MinimumBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipAuction(dAtA[iNdEx:])
|
skippy, err := skipAuction(dAtA[iNdEx:])
|
||||||
@@ -1048,6 +860,38 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
m.Id = string(dAtA[iNdEx:postIndex])
|
m.Id = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 2:
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowAuction
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthAuction
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthAuction
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Kind = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 3:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
||||||
}
|
}
|
||||||
@@ -1079,7 +923,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.Status = string(dAtA[iNdEx:postIndex])
|
m.Status = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 3:
|
case 4:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType)
|
||||||
}
|
}
|
||||||
@@ -1111,7 +955,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.OwnerAddress = string(dAtA[iNdEx:postIndex])
|
m.OwnerAddress = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 4:
|
case 5:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType)
|
||||||
}
|
}
|
||||||
@@ -1144,7 +988,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 5:
|
case 6:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field CommitsEndTime", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field CommitsEndTime", wireType)
|
||||||
}
|
}
|
||||||
@@ -1177,7 +1021,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 6:
|
case 7:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field RevealsEndTime", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field RevealsEndTime", wireType)
|
||||||
}
|
}
|
||||||
@@ -1210,7 +1054,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 7:
|
case 8:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType)
|
||||||
}
|
}
|
||||||
@@ -1243,7 +1087,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 8:
|
case 9:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType)
|
||||||
}
|
}
|
||||||
@@ -1276,7 +1120,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 9:
|
case 10:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType)
|
||||||
}
|
}
|
||||||
@@ -1309,9 +1153,9 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 10:
|
case 11:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field WinnerAddress", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field WinnerAddresses", wireType)
|
||||||
}
|
}
|
||||||
var stringLen uint64
|
var stringLen uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@@ -1339,11 +1183,11 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
m.WinnerAddress = string(dAtA[iNdEx:postIndex])
|
m.WinnerAddresses = append(m.WinnerAddresses, string(dAtA[iNdEx:postIndex]))
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 11:
|
case 12:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field WinningBid", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field WinningBids", wireType)
|
||||||
}
|
}
|
||||||
var msglen int
|
var msglen int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@@ -1370,11 +1214,12 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if err := m.WinningBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
m.WinningBids = append(m.WinningBids, types.Coin{})
|
||||||
|
if err := m.WinningBids[len(m.WinningBids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 12:
|
case 13:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field WinningPrice", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field WinningPrice", wireType)
|
||||||
}
|
}
|
||||||
@@ -1407,6 +1252,78 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 14:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowAuction
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthAuction
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthAuction
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.MaxPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 15:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType)
|
||||||
|
}
|
||||||
|
m.NumProviders = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowAuction
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.NumProviders |= int32(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 16:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field FundsReleased", wireType)
|
||||||
|
}
|
||||||
|
var v int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowAuction
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
v |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.FundsReleased = bool(v != 0)
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipAuction(dAtA[iNdEx:])
|
skippy, err := skipAuction(dAtA[iNdEx:])
|
||||||
|
|||||||
+40
-16
@@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
@@ -12,7 +13,6 @@ import (
|
|||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
|
||||||
|
|
||||||
wnsUtils "git.vdb.to/cerc-io/laconicd/utils"
|
wnsUtils "git.vdb.to/cerc-io/laconicd/utils"
|
||||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
@@ -48,6 +48,16 @@ func GetCmdCommitBid() *cobra.Command {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take chain id passed by user
|
||||||
|
chainId, _ := cmd.Flags().GetString(flags.FlagChainID)
|
||||||
|
if chainId == "" {
|
||||||
|
// Take from config if not provided
|
||||||
|
chainId = clientCtx.ChainID
|
||||||
|
}
|
||||||
|
if chainId == "" {
|
||||||
|
return fmt.Errorf("--chain-id required")
|
||||||
|
}
|
||||||
|
|
||||||
bidAmount, err := sdk.ParseCoinNormalized(args[1])
|
bidAmount, err := sdk.ParseCoinNormalized(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -58,7 +68,6 @@ func GetCmdCommitBid() *cobra.Command {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
chainId := viper.GetString("chain-id")
|
|
||||||
auctionId := args[0]
|
auctionId := args[0]
|
||||||
|
|
||||||
reveal := map[string]interface{}{
|
reveal := map[string]interface{}{
|
||||||
@@ -132,48 +141,63 @@ func GetCmdRevealBid() *cobra.Command {
|
|||||||
|
|
||||||
func GetCmdCreateAuction() *cobra.Command {
|
func GetCmdCreateAuction() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid]",
|
Use: "create [kind] [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [num-providers]",
|
||||||
Short: "Create auction.",
|
Short: "Create auction.",
|
||||||
Args: cobra.ExactArgs(5),
|
Args: cobra.ExactArgs(8),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
clientCtx, err := client.GetClientTxContext(cmd)
|
clientCtx, err := client.GetClientTxContext(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
commitsDuration, err := time.ParseDuration(args[0])
|
kind := args[0]
|
||||||
|
|
||||||
|
commitsDuration, err := time.ParseDuration(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
revealsDuration, err := time.ParseDuration(args[1])
|
revealsDuration, err := time.ParseDuration(args[2])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
commitFee, err := sdk.ParseCoinNormalized(args[2])
|
commitFee, err := sdk.ParseCoinNormalized(args[3])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
revealFee, err := sdk.ParseCoinNormalized(args[3])
|
revealFee, err := sdk.ParseCoinNormalized(args[4])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
minimumBid, err := sdk.ParseCoinNormalized(args[4])
|
minimumBid, err := sdk.ParseCoinNormalized(args[5])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
params := auctiontypes.Params{
|
maxPrice, err := sdk.ParseCoinNormalized(args[6])
|
||||||
CommitsDuration: commitsDuration,
|
if err != nil {
|
||||||
RevealsDuration: revealsDuration,
|
return err
|
||||||
CommitFee: commitFee,
|
|
||||||
RevealFee: revealFee,
|
|
||||||
MinimumBid: minimumBid,
|
|
||||||
}
|
}
|
||||||
msg := auctiontypes.NewMsgCreateAuction(params, clientCtx.GetFromAddress())
|
|
||||||
|
numProviders, err := strconv.ParseInt(args[7], 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
msg := auctiontypes.NewMsgCreateAuction(
|
||||||
|
kind,
|
||||||
|
commitsDuration,
|
||||||
|
revealsDuration,
|
||||||
|
commitFee,
|
||||||
|
revealFee,
|
||||||
|
minimumBid,
|
||||||
|
maxPrice,
|
||||||
|
int32(numProviders),
|
||||||
|
clientCtx.GetFromAddress(),
|
||||||
|
)
|
||||||
err = msg.ValidateBasic()
|
err = msg.ValidateBasic()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const (
|
|||||||
EventTypeCreateAuction = "create-auction"
|
EventTypeCreateAuction = "create-auction"
|
||||||
EventTypeCommitBid = "commit-bid"
|
EventTypeCommitBid = "commit-bid"
|
||||||
EventTypeRevealBid = "reveal-bid"
|
EventTypeRevealBid = "reveal-bid"
|
||||||
|
EventTypeReleaseFunds = "release-funds"
|
||||||
|
|
||||||
AttributeKeyCommitsDuration = "commits-duration"
|
AttributeKeyCommitsDuration = "commits-duration"
|
||||||
AttributeKeyRevealsDuration = "reveals-duration"
|
AttributeKeyRevealsDuration = "reveals-duration"
|
||||||
|
|||||||
+262
-24
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"cosmossdk.io/collections"
|
"cosmossdk.io/collections"
|
||||||
@@ -12,6 +13,7 @@ import (
|
|||||||
storetypes "cosmossdk.io/core/store"
|
storetypes "cosmossdk.io/core/store"
|
||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
"cosmossdk.io/log"
|
"cosmossdk.io/log"
|
||||||
|
"cosmossdk.io/math"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
@@ -24,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// CompletedAuctionDeleteTimeout => Completed auctions are deleted after this timeout (after reveals end time).
|
// CompletedAuctionDeleteTimeout => Completed auctions are deleted after this timeout (after reveals end time).
|
||||||
const CompletedAuctionDeleteTimeout = time.Hour * 24
|
const CompletedAuctionDeleteTimeout = 365 * 24 * time.Hour // 1 year
|
||||||
|
|
||||||
type AuctionsIndexes struct {
|
type AuctionsIndexes struct {
|
||||||
Owner *indexes.Multi[string, string, auctiontypes.Auction]
|
Owner *indexes.Multi[string, string, auctiontypes.Auction]
|
||||||
@@ -67,6 +69,8 @@ type Keeper struct {
|
|||||||
// Codecs
|
// Codecs
|
||||||
cdc codec.BinaryCodec
|
cdc codec.BinaryCodec
|
||||||
|
|
||||||
|
authority string
|
||||||
|
|
||||||
// External keepers
|
// External keepers
|
||||||
accountKeeper auth.AccountKeeper
|
accountKeeper auth.AccountKeeper
|
||||||
bankKeeper bank.Keeper
|
bankKeeper bank.Keeper
|
||||||
@@ -77,8 +81,12 @@ type Keeper struct {
|
|||||||
// state management
|
// state management
|
||||||
Schema collections.Schema
|
Schema collections.Schema
|
||||||
Params collections.Item[auctiontypes.Params]
|
Params collections.Item[auctiontypes.Params]
|
||||||
Auctions *collections.IndexedMap[string, auctiontypes.Auction, AuctionsIndexes] // map: auctionId -> Auction, index: owner -> Auctions
|
Auctions *collections.IndexedMap[
|
||||||
Bids *collections.IndexedMap[collections.Pair[string, string], auctiontypes.Bid, BidsIndexes] // map: (auctionId, bidder) -> Bid, index: bidder -> auctionId
|
string, auctiontypes.Auction, AuctionsIndexes,
|
||||||
|
] // map: auctionId -> Auction, index: owner -> Auctions
|
||||||
|
Bids *collections.IndexedMap[
|
||||||
|
collections.Pair[string, string], auctiontypes.Bid, BidsIndexes,
|
||||||
|
] // map: (auctionId, bidder) -> Bid, index: bidder -> auctionId
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKeeper creates a new Keeper instance
|
// NewKeeper creates a new Keeper instance
|
||||||
@@ -87,16 +95,30 @@ func NewKeeper(
|
|||||||
storeService storetypes.KVStoreService,
|
storeService storetypes.KVStoreService,
|
||||||
accountKeeper auth.AccountKeeper,
|
accountKeeper auth.AccountKeeper,
|
||||||
bankKeeper bank.Keeper,
|
bankKeeper bank.Keeper,
|
||||||
|
authority string,
|
||||||
) *Keeper {
|
) *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)
|
sb := collections.NewSchemaBuilder(storeService)
|
||||||
k := Keeper{
|
k := Keeper{
|
||||||
cdc: cdc,
|
cdc: cdc,
|
||||||
|
authority: authority,
|
||||||
accountKeeper: accountKeeper,
|
accountKeeper: accountKeeper,
|
||||||
bankKeeper: bankKeeper,
|
bankKeeper: bankKeeper,
|
||||||
Params: collections.NewItem(sb, auctiontypes.ParamsPrefix, "params", codec.CollValue[auctiontypes.Params](cdc)),
|
Params: collections.NewItem(sb, auctiontypes.ParamsPrefix, "params", codec.CollValue[auctiontypes.Params](cdc)),
|
||||||
Auctions: collections.NewIndexedMap(sb, auctiontypes.AuctionsPrefix, "auctions", collections.StringKey, codec.CollValue[auctiontypes.Auction](cdc), newAuctionIndexes(sb)),
|
Auctions: collections.NewIndexedMap(
|
||||||
Bids: collections.NewIndexedMap(sb, auctiontypes.BidsPrefix, "bids", collections.PairKeyCodec(collections.StringKey, collections.StringKey), codec.CollValue[auctiontypes.Bid](cdc), newBidsIndexes(sb)),
|
sb, auctiontypes.AuctionsPrefix, "auctions", collections.StringKey, codec.CollValue[auctiontypes.Auction](cdc), newAuctionIndexes(sb),
|
||||||
usageKeepers: nil,
|
),
|
||||||
|
Bids: collections.NewIndexedMap(
|
||||||
|
sb, auctiontypes.BidsPrefix, "bids",
|
||||||
|
collections.PairKeyCodec(collections.StringKey, collections.StringKey),
|
||||||
|
codec.CollValue[auctiontypes.Bid](cdc),
|
||||||
|
newBidsIndexes(sb),
|
||||||
|
),
|
||||||
|
usageKeepers: nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
schema, err := sb.Build()
|
schema, err := sb.Build()
|
||||||
@@ -191,10 +213,16 @@ func (k Keeper) GetBid(ctx sdk.Context, id string, bidder string) (auctiontypes.
|
|||||||
func (k Keeper) GetBids(ctx sdk.Context, id string) ([]*auctiontypes.Bid, error) {
|
func (k Keeper) GetBids(ctx sdk.Context, id string) ([]*auctiontypes.Bid, error) {
|
||||||
var bids []*auctiontypes.Bid
|
var bids []*auctiontypes.Bid
|
||||||
|
|
||||||
err := k.Bids.Walk(ctx, collections.NewPrefixedPairRange[string, string](id), func(key collections.Pair[string, string], value auctiontypes.Bid) (stop bool, err error) {
|
err := k.Bids.Walk(ctx,
|
||||||
bids = append(bids, &value)
|
collections.NewPrefixedPairRange[string, string](id),
|
||||||
return false, nil
|
func(
|
||||||
})
|
key collections.Pair[string, string],
|
||||||
|
value auctiontypes.Bid) (stop bool, err error,
|
||||||
|
) {
|
||||||
|
bids = append(bids, &value)
|
||||||
|
return false, nil
|
||||||
|
},
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -313,8 +341,18 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction
|
|||||||
commitsEndTime := now.Add(msg.CommitsDuration)
|
commitsEndTime := now.Add(msg.CommitsDuration)
|
||||||
revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration)
|
revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration)
|
||||||
|
|
||||||
|
if msg.Kind == auctiontypes.AuctionKindProvider {
|
||||||
|
totalLockedAmount := sdk.NewCoin(msg.MaxPrice.Denom, msg.MaxPrice.Amount.MulRaw(int64(msg.NumProviders)))
|
||||||
|
|
||||||
|
sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalLockedAmount))
|
||||||
|
if sdkErr != nil {
|
||||||
|
return nil, errorsmod.Wrap(sdkErr, "Auction error transferring maximum price amount")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auction := auctiontypes.Auction{
|
auction := auctiontypes.Auction{
|
||||||
Id: auctionId,
|
Id: auctionId,
|
||||||
|
Kind: msg.Kind,
|
||||||
Status: auctiontypes.AuctionStatusCommitPhase,
|
Status: auctiontypes.AuctionStatusCommitPhase,
|
||||||
OwnerAddress: signerAddress.String(),
|
OwnerAddress: signerAddress.String(),
|
||||||
CreateTime: now,
|
CreateTime: now,
|
||||||
@@ -323,6 +361,8 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction
|
|||||||
CommitFee: msg.CommitFee,
|
CommitFee: msg.CommitFee,
|
||||||
RevealFee: msg.RevealFee,
|
RevealFee: msg.RevealFee,
|
||||||
MinimumBid: msg.MinimumBid,
|
MinimumBid: msg.MinimumBid,
|
||||||
|
MaxPrice: msg.MaxPrice,
|
||||||
|
NumProviders: msg.NumProviders,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save auction in store.
|
// Save auction in store.
|
||||||
@@ -490,14 +530,20 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct
|
|||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal bid amount.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal bid amount.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if bidAmount.IsLT(auction.MinimumBid) {
|
if auction.Kind == auctiontypes.AuctionKindVickrey && bidAmount.IsLT(auction.MinimumBid) {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if auction.Kind == auctiontypes.AuctionKindProvider && auction.MaxPrice.IsLT(bidAmount) {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is higher than max price.")
|
||||||
|
}
|
||||||
|
|
||||||
// Lock bid amount.
|
// Lock bid amount.
|
||||||
sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(bidAmount))
|
if auction.Kind == auctiontypes.AuctionKindVickrey {
|
||||||
if sdkErr != nil {
|
sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(bidAmount))
|
||||||
return nil, sdkErr
|
if sdkErr != nil {
|
||||||
|
return nil, sdkErr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update bid.
|
// Update bid.
|
||||||
@@ -511,6 +557,11 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct
|
|||||||
return &auction, nil
|
return &auction, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetAuthority returns the x/auction module's authority.
|
||||||
|
func (k Keeper) GetAuthority() string {
|
||||||
|
return k.authority
|
||||||
|
}
|
||||||
|
|
||||||
// GetParams gets the auction module's parameters.
|
// GetParams gets the auction module's parameters.
|
||||||
func (k Keeper) GetParams(ctx sdk.Context) (*auctiontypes.Params, error) {
|
func (k Keeper) GetParams(ctx sdk.Context) (*auctiontypes.Params, error) {
|
||||||
params, err := k.Params.Get(ctx)
|
params, err := k.Params.Get(ctx)
|
||||||
@@ -521,6 +572,11 @@ func (k Keeper) GetParams(ctx sdk.Context) (*auctiontypes.Params, error) {
|
|||||||
return ¶ms, nil
|
return ¶ms, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetParams sets the x/auction module parameters.
|
||||||
|
func (k Keeper) SetParams(ctx sdk.Context, params auctiontypes.Params) error {
|
||||||
|
return k.Params.Set(ctx, params)
|
||||||
|
}
|
||||||
|
|
||||||
// GetAuctionModuleBalances gets the auction module account(s) balances.
|
// GetAuctionModuleBalances gets the auction module account(s) balances.
|
||||||
func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) sdk.Coins {
|
func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) sdk.Coins {
|
||||||
moduleAddress := k.accountKeeper.GetModuleAddress(auctiontypes.ModuleName)
|
moduleAddress := k.accountKeeper.GetModuleAddress(auctiontypes.ModuleName)
|
||||||
@@ -570,8 +626,14 @@ func (k Keeper) processAuctionPhases(ctx sdk.Context) error {
|
|||||||
|
|
||||||
// If auction has expired, pick a winner from revealed bids.
|
// If auction has expired, pick a winner from revealed bids.
|
||||||
if auction.Status == auctiontypes.AuctionStatusExpired {
|
if auction.Status == auctiontypes.AuctionStatusExpired {
|
||||||
if err = k.pickAuctionWinner(ctx, auction); err != nil {
|
if auction.Kind == auctiontypes.AuctionKindVickrey {
|
||||||
return err
|
if err = k.pickAuctionWinner(ctx, auction); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err = k.pickProviderAuctionWinners(ctx, auction); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -599,6 +661,7 @@ func (k Keeper) deleteCompletedAuctions(ctx sdk.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pick winner for vickrey auction
|
||||||
func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction) error {
|
func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction) error {
|
||||||
k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winner.", auction.Id))
|
k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winner.", auction.Id))
|
||||||
|
|
||||||
@@ -650,17 +713,17 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction
|
|||||||
auction.Status = auctiontypes.AuctionStatusCompleted
|
auction.Status = auctiontypes.AuctionStatusCompleted
|
||||||
|
|
||||||
if highestBid != nil {
|
if highestBid != nil {
|
||||||
auction.WinnerAddress = highestBid.BidderAddress
|
auction.WinningBids = []sdk.Coin{highestBid.BidAmount}
|
||||||
auction.WinningBid = highestBid.BidAmount
|
auction.WinnerAddresses = []string{highestBid.BidderAddress}
|
||||||
|
|
||||||
// Winner pays 2nd price, if a 2nd price exists.
|
// Winner pays 2nd price, if a 2nd price exists.
|
||||||
auction.WinningPrice = highestBid.BidAmount
|
auction.WinningPrice = highestBid.BidAmount
|
||||||
if secondHighestBid != nil {
|
if secondHighestBid != nil {
|
||||||
auction.WinningPrice = secondHighestBid.BidAmount
|
auction.WinningPrice = secondHighestBid.BidAmount
|
||||||
}
|
}
|
||||||
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress))
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddresses[0]))
|
||||||
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String()))
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBids[0].String()))
|
||||||
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String()))
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winning price %s.", auction.Id, auction.WinningPrice.String()))
|
||||||
} else {
|
} else {
|
||||||
k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id))
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id))
|
||||||
}
|
}
|
||||||
@@ -694,8 +757,8 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process winner account (if nobody bids, there won't be a winner).
|
// Process winner account (if nobody bids, there won't be a winner).
|
||||||
if auction.WinnerAddress != "" {
|
if len(auction.WinnerAddresses) != 0 {
|
||||||
winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddress)
|
winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddresses[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err))
|
k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err))
|
||||||
panic("Invalid winner address.")
|
panic("Invalid winner address.")
|
||||||
@@ -716,7 +779,12 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use auction burn module account instead of actually burning coins to better keep track of supply.
|
// Use auction burn module account instead of actually burning coins to better keep track of supply.
|
||||||
sdkErr = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, auctiontypes.AuctionBurnModuleAccountName, sdk.NewCoins(amountToBurn))
|
sdkErr = k.bankKeeper.SendCoinsFromModuleToModule(
|
||||||
|
ctx,
|
||||||
|
auctiontypes.ModuleName,
|
||||||
|
auctiontypes.AuctionBurnModuleAccountName,
|
||||||
|
sdk.NewCoins(amountToBurn),
|
||||||
|
)
|
||||||
if sdkErr != nil {
|
if sdkErr != nil {
|
||||||
k.Logger(ctx).Error(fmt.Sprintf("Auction error burning coins: %v", sdkErr))
|
k.Logger(ctx).Error(fmt.Sprintf("Auction error burning coins: %v", sdkErr))
|
||||||
panic(sdkErr)
|
panic(sdkErr)
|
||||||
@@ -732,3 +800,173 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pick winner for provider auction
|
||||||
|
func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontypes.Auction) error {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winners.", auction.Id))
|
||||||
|
|
||||||
|
bids, err := k.GetBids(ctx, auction.Id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
revealedBids := make([]*auctiontypes.Bid, 0, len(bids))
|
||||||
|
for _, bid := range bids {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Processing bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
|
||||||
|
|
||||||
|
// Only consider revealed bids.
|
||||||
|
if bid.Status != auctiontypes.BidStatusRevealed {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Ignoring unrevealed bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
revealedBids = append(revealedBids, bid)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sort the valid bids
|
||||||
|
slices.SortStableFunc(revealedBids, func(a, b *auctiontypes.Bid) int {
|
||||||
|
if a.BidAmount.Amount.LT(b.BidAmount.Amount) {
|
||||||
|
return -1
|
||||||
|
} else if a.BidAmount.Amount.GT(b.BidAmount.Amount) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// Take best min(len(revealedBids), auction.NumProviders) bids
|
||||||
|
numWinners := int(auction.NumProviders)
|
||||||
|
if len(revealedBids) < numWinners {
|
||||||
|
numWinners = len(revealedBids)
|
||||||
|
}
|
||||||
|
winnerBids := revealedBids[:numWinners]
|
||||||
|
|
||||||
|
auction.Status = auctiontypes.AuctionStatusCompleted
|
||||||
|
|
||||||
|
if len(winnerBids) > 0 {
|
||||||
|
winnerAddresses := make([]string, len(winnerBids))
|
||||||
|
winningBids := make([]sdk.Coin, len(winnerBids))
|
||||||
|
for i, bid := range winnerBids {
|
||||||
|
winnerAddresses[i] = bid.BidderAddress
|
||||||
|
winningBids[i] = bid.BidAmount
|
||||||
|
}
|
||||||
|
|
||||||
|
auction.WinnerAddresses = winnerAddresses
|
||||||
|
auction.WinningBids = winningBids
|
||||||
|
|
||||||
|
// The last best bid is the winning price
|
||||||
|
auction.WinningPrice = winnerBids[len(winnerBids)-1].BidAmount
|
||||||
|
|
||||||
|
for _, bid := range winnerBids {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner address: %s, bid amount: %s.", auction.Id, bid.BidderAddress, bid.BidAmount.String()))
|
||||||
|
}
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s winning price %s.", auction.Id, auction.WinningPrice.String()))
|
||||||
|
} else {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id))
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := k.SaveAuction(ctx, auction); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, bid := range bids {
|
||||||
|
bidderAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress)
|
||||||
|
if err != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Invalid bidderAddress address. %v", err))
|
||||||
|
panic("Invalid bidder address.")
|
||||||
|
}
|
||||||
|
|
||||||
|
if bid.Status == auctiontypes.BidStatusRevealed {
|
||||||
|
// Send reveal fee back to bidders that've revealed the bid.
|
||||||
|
sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidderAddress, sdk.NewCoins(bid.RevealFee))
|
||||||
|
if sdkErr != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Auction error returning reveal fee: %v", sdkErr))
|
||||||
|
panic(sdkErr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send back any leftover locked amount to auction creator
|
||||||
|
// All of it in case of no winners
|
||||||
|
totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders)))
|
||||||
|
totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses))))
|
||||||
|
creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid))
|
||||||
|
|
||||||
|
ownerAccAddress, err := sdk.AccAddressFromBech32(auction.OwnerAddress)
|
||||||
|
if err != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Invalid auction owner address. %v", err))
|
||||||
|
panic("Invalid auction owner address.")
|
||||||
|
}
|
||||||
|
|
||||||
|
sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(
|
||||||
|
ctx,
|
||||||
|
auctiontypes.ModuleName,
|
||||||
|
ownerAccAddress,
|
||||||
|
sdk.NewCoins(creatorLeftOverAmount),
|
||||||
|
)
|
||||||
|
if sdkErr != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Auction error returning leftover locked amount: %v", sdkErr))
|
||||||
|
panic(sdkErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify other modules (hook).
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s notifying %d modules.", auction.Id, len(k.usageKeepers)))
|
||||||
|
for _, keeper := range k.usageKeepers {
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("Auction %s notifying module %s.", auction.Id, keeper.ModuleName()))
|
||||||
|
keeper.OnAuctionWinnerSelected(ctx, auction.Id)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds) (*auctiontypes.Auction, error) {
|
||||||
|
auction, err := k.GetAuctionById(ctx, msg.AuctionId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if auction.Kind != auctiontypes.AuctionKindProvider {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction kind must be provider.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only the auction owner can release funds.
|
||||||
|
if msg.Signer != auction.OwnerAddress {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Only auction owner can release funds.")
|
||||||
|
}
|
||||||
|
|
||||||
|
if auction.Status != auctiontypes.AuctionStatusCompleted {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.")
|
||||||
|
}
|
||||||
|
|
||||||
|
if auction.FundsReleased {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction funds already released.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark funds as released in the stored auction
|
||||||
|
auction.FundsReleased = true
|
||||||
|
if err = k.SaveAuction(ctx, &auction); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process winner accounts.
|
||||||
|
for _, winnerAddress := range auction.WinnerAddresses {
|
||||||
|
winnerAccAddress, err := sdk.AccAddressFromBech32(winnerAddress)
|
||||||
|
if err != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err))
|
||||||
|
panic("Invalid winner address.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send winning price to winning bidders
|
||||||
|
sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(
|
||||||
|
ctx,
|
||||||
|
auctiontypes.ModuleName,
|
||||||
|
winnerAccAddress,
|
||||||
|
sdk.NewCoins(auction.WinningPrice),
|
||||||
|
)
|
||||||
|
if sdkErr != nil {
|
||||||
|
k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr))
|
||||||
|
panic(sdkErr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &auction, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package keeper
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
"git.vdb.to/cerc-io/laconicd/utils"
|
"git.vdb.to/cerc-io/laconicd/utils"
|
||||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ auctiontypes.MsgServer = msgServer{}
|
var _ auctiontypes.MsgServer = msgServer{}
|
||||||
@@ -54,7 +56,6 @@ func (ms msgServer) CreateAuction(c context.Context, msg *auctiontypes.MsgCreate
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CommitBid is the command for committing a bid
|
// CommitBid is the command for committing a bid
|
||||||
// nolint: all
|
|
||||||
func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid) (*auctiontypes.MsgCommitBidResponse, error) {
|
func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid) (*auctiontypes.MsgCommitBidResponse, error) {
|
||||||
if err := msg.ValidateBasic(); err != nil {
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -92,7 +93,6 @@ func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RevealBid is the command for revealing a bid
|
// RevealBid is the command for revealing a bid
|
||||||
// nolint: all
|
|
||||||
func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid) (*auctiontypes.MsgRevealBidResponse, error) {
|
func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid) (*auctiontypes.MsgRevealBidResponse, error) {
|
||||||
if err := msg.ValidateBasic(); err != nil {
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -128,3 +128,58 @@ func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid)
|
|||||||
|
|
||||||
return &auctiontypes.MsgRevealBidResponse{Auction: resp}, nil
|
return &auctiontypes.MsgRevealBidResponse{Auction: resp}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateParams defines a method to perform updation of module params.
|
||||||
|
func (ms msgServer) UpdateParams(c context.Context, msg *auctiontypes.MsgUpdateParams) (*auctiontypes.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 &auctiontypes.MsgUpdateParamsResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReleaseFunds is the command to pay the winning amounts to provider auction winners
|
||||||
|
func (ms msgServer) ReleaseFunds(c context.Context, msg *auctiontypes.MsgReleaseFunds) (*auctiontypes.MsgReleaseFundsResponse, error) {
|
||||||
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
ctx = *utils.CtxWithCustomKVGasConfig(&ctx)
|
||||||
|
|
||||||
|
signerAddress, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := ms.k.ReleaseFunds(ctx, *msg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.EventManager().EmitEvents(sdk.Events{
|
||||||
|
sdk.NewEvent(
|
||||||
|
auctiontypes.EventTypeReleaseFunds,
|
||||||
|
sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId),
|
||||||
|
),
|
||||||
|
sdk.NewEvent(
|
||||||
|
sdk.EventTypeMessage,
|
||||||
|
sdk.NewAttribute(sdk.AttributeKeyModule, auctiontypes.AttributeValueCategory),
|
||||||
|
sdk.NewAttribute(auctiontypes.AttributeKeySigner, signerAddress.String()),
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
utils.LogTxGasConsumed(ctx, ms.k.Logger(ctx), "ReleaseFunds")
|
||||||
|
|
||||||
|
return &auctiontypes.MsgReleaseFundsResponse{Auction: resp}, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -98,7 +98,10 @@ func (qs queryServer) GetBids(c context.Context, req *auctiontypes.QueryGetBidsR
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AuctionsByBidder queries auctions by bidder
|
// AuctionsByBidder queries auctions by bidder
|
||||||
func (qs queryServer) AuctionsByBidder(c context.Context, req *auctiontypes.QueryAuctionsByBidderRequest) (*auctiontypes.QueryAuctionsByBidderResponse, error) {
|
func (qs queryServer) AuctionsByBidder(
|
||||||
|
c context.Context,
|
||||||
|
req *auctiontypes.QueryAuctionsByBidderRequest,
|
||||||
|
) (*auctiontypes.QueryAuctionsByBidderResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
if req.BidderAddress == "" {
|
if req.BidderAddress == "" {
|
||||||
@@ -110,11 +113,18 @@ func (qs queryServer) AuctionsByBidder(c context.Context, req *auctiontypes.Quer
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &auctiontypes.QueryAuctionsByBidderResponse{Auctions: &auctiontypes.Auctions{Auctions: auctions}}, nil
|
return &auctiontypes.QueryAuctionsByBidderResponse{
|
||||||
|
Auctions: &auctiontypes.Auctions{
|
||||||
|
Auctions: auctions,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuctionsByOwner queries auctions by owner
|
// AuctionsByOwner queries auctions by owner
|
||||||
func (qs queryServer) AuctionsByOwner(c context.Context, req *auctiontypes.QueryAuctionsByOwnerRequest) (*auctiontypes.QueryAuctionsByOwnerResponse, error) {
|
func (qs queryServer) AuctionsByOwner(
|
||||||
|
c context.Context,
|
||||||
|
req *auctiontypes.QueryAuctionsByOwnerRequest,
|
||||||
|
) (*auctiontypes.QueryAuctionsByOwnerResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
if req.OwnerAddress == "" {
|
if req.OwnerAddress == "" {
|
||||||
@@ -130,7 +140,10 @@ func (qs queryServer) AuctionsByOwner(c context.Context, req *auctiontypes.Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetAuctionModuleBalance queries the auction module account balance
|
// GetAuctionModuleBalance queries the auction module account balance
|
||||||
func (qs queryServer) GetAuctionModuleBalance(c context.Context, req *auctiontypes.QueryGetAuctionModuleBalanceRequest) (*auctiontypes.QueryGetAuctionModuleBalanceResponse, error) {
|
func (qs queryServer) GetAuctionModuleBalance(
|
||||||
|
c context.Context,
|
||||||
|
req *auctiontypes.QueryGetAuctionModuleBalanceRequest,
|
||||||
|
) (*auctiontypes.QueryGetAuctionModuleBalanceResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
balances := qs.k.GetAuctionModuleBalances(ctx)
|
balances := qs.k.GetAuctionModuleBalances(ctx)
|
||||||
|
|
||||||
|
|||||||
@@ -81,17 +81,27 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|||||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||||
{
|
{
|
||||||
RpcMethod: "CreateAuction",
|
RpcMethod: "CreateAuction",
|
||||||
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid]",
|
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee]",
|
||||||
Short: "Create an auction",
|
Short: "Create an auction",
|
||||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||||
{ProtoField: "commits_duration"},
|
{ProtoField: "commits_duration"},
|
||||||
{ProtoField: "reveals_duration"},
|
{ProtoField: "reveals_duration"},
|
||||||
{ProtoField: "commit_fee"},
|
{ProtoField: "commit_fee"},
|
||||||
{ProtoField: "reveal_fee"},
|
{ProtoField: "reveal_fee"},
|
||||||
{ProtoField: "minimum_bid"},
|
},
|
||||||
|
FlagOptions: map[string]*autocliv1.FlagOptions{
|
||||||
|
"kind": {Name: "kind", DefaultValue: "vickrey", Usage: "Auction kind (vickrey|provider) (default: vickrey)"},
|
||||||
|
"minimum_bid": {Name: "minimum-bid", Usage: "Minimum bid (required for vickrey auctions)"},
|
||||||
|
"max_price": {Name: "max-price", Usage: "Max price (required for provider auctions)"},
|
||||||
|
"num_providers": {Name: "num-providers", Usage: "Number of desired providers (required for provider auctions)"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
RpcMethod: "UpdateParams",
|
||||||
|
Skip: true, // skipped because authority gated
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
EnhanceCustomCommand: true, // Allow additional manual commands
|
EnhanceCustomCommand: true, // Allow additional manual commands
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import (
|
|||||||
"cosmossdk.io/core/appmodule"
|
"cosmossdk.io/core/appmodule"
|
||||||
"cosmossdk.io/core/store"
|
"cosmossdk.io/core/store"
|
||||||
"cosmossdk.io/depinject"
|
"cosmossdk.io/depinject"
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
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"
|
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/auction/module/v1"
|
modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/auction/module/v1"
|
||||||
"git.vdb.to/cerc-io/laconicd/x/auction"
|
"git.vdb.to/cerc-io/laconicd/x/auction"
|
||||||
@@ -34,6 +35,7 @@ func init() {
|
|||||||
type ModuleInputs struct {
|
type ModuleInputs struct {
|
||||||
depinject.In
|
depinject.In
|
||||||
|
|
||||||
|
Config *modulev1.Module
|
||||||
Cdc codec.Codec
|
Cdc codec.Codec
|
||||||
StoreService store.KVStoreService
|
StoreService store.KVStoreService
|
||||||
|
|
||||||
@@ -53,7 +55,13 @@ type ModuleOutputs struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
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)
|
m := NewAppModule(in.Cdc, k)
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k}
|
return ModuleOutputs{Module: m, Keeper: k}
|
||||||
@@ -64,15 +72,14 @@ func InvokeSetAuctionHooks(
|
|||||||
keeper *keeper.Keeper,
|
keeper *keeper.Keeper,
|
||||||
auctionHooks map[string]auction.AuctionHooksWrapper,
|
auctionHooks map[string]auction.AuctionHooksWrapper,
|
||||||
) error {
|
) error {
|
||||||
// all arguments to invokers are optional
|
// All arguments to invokers are optional
|
||||||
if keeper == nil || config == nil {
|
if keeper == nil || config == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var usageKeepers []auction.AuctionUsageKeeper
|
usageKeepers := make([]auction.AuctionUsageKeeper, 0, len(auctionHooks))
|
||||||
|
|
||||||
for _, modName := range maps.Keys(auctionHooks) {
|
for _, hook := range auctionHooks {
|
||||||
hook := auctionHooks[modName]
|
|
||||||
usageKeepers = append(usageKeepers, hook)
|
usageKeepers = append(usageKeepers, hook)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func (AppModule) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingCo
|
|||||||
return data.Validate()
|
return data.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitGenesis performs genesis initialization for the checkers module.
|
// InitGenesis performs genesis initialization for the auction module.
|
||||||
// It returns no validator updates.
|
// It returns no validator updates.
|
||||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
|
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
|
||||||
var genesisState auction.GenesisState
|
var genesisState auction.GenesisState
|
||||||
|
|||||||
+70
-19
@@ -1,6 +1,9 @@
|
|||||||
package auction
|
package auction
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
time "time"
|
||||||
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
@@ -13,13 +16,26 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// NewMsgCreateAuction is the constructor function for MsgCreateAuction.
|
// NewMsgCreateAuction is the constructor function for MsgCreateAuction.
|
||||||
func NewMsgCreateAuction(params Params, signer sdk.AccAddress) MsgCreateAuction {
|
func NewMsgCreateAuction(
|
||||||
|
kind string,
|
||||||
|
commitsDuration time.Duration,
|
||||||
|
revealsDuration time.Duration,
|
||||||
|
commitFee sdk.Coin,
|
||||||
|
revealFee sdk.Coin,
|
||||||
|
minimumBid sdk.Coin,
|
||||||
|
maxPrice sdk.Coin,
|
||||||
|
numProviders int32,
|
||||||
|
signer sdk.AccAddress,
|
||||||
|
) MsgCreateAuction {
|
||||||
return MsgCreateAuction{
|
return MsgCreateAuction{
|
||||||
CommitsDuration: params.CommitsDuration,
|
CommitsDuration: commitsDuration,
|
||||||
RevealsDuration: params.RevealsDuration,
|
RevealsDuration: revealsDuration,
|
||||||
CommitFee: params.CommitFee,
|
CommitFee: commitFee,
|
||||||
RevealFee: params.RevealFee,
|
RevealFee: revealFee,
|
||||||
MinimumBid: params.MinimumBid,
|
MinimumBid: minimumBid,
|
||||||
|
MaxPrice: maxPrice,
|
||||||
|
Kind: kind,
|
||||||
|
NumProviders: numProviders,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,22 +49,53 @@ func NewMsgCommitBid(auctionId string, commitHash string, signer sdk.AccAddress)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewMsgRevealBid is the constructor function for MsgRevealBid.
|
||||||
|
func NewMsgRevealBid(auctionId string, reveal string, signer sdk.AccAddress) MsgRevealBid {
|
||||||
|
return MsgRevealBid{
|
||||||
|
AuctionId: auctionId,
|
||||||
|
Reveal: reveal,
|
||||||
|
Signer: signer.String(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMsgReleaseFunds is the constructor function for MsgReleaseFunds.
|
||||||
|
func NewMsgReleaseFunds(auctionId string, signer sdk.AccAddress) MsgReleaseFunds {
|
||||||
|
return MsgReleaseFunds{
|
||||||
|
AuctionId: auctionId,
|
||||||
|
Signer: signer.String(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ValidateBasic Implements Msg.
|
// ValidateBasic Implements Msg.
|
||||||
func (msg MsgCreateAuction) ValidateBasic() error {
|
func (msg MsgCreateAuction) ValidateBasic() error {
|
||||||
if msg.Signer == "" {
|
if msg.Signer == "" {
|
||||||
return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer)
|
return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if msg.Kind != AuctionKindVickrey && msg.Kind != AuctionKindProvider {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("auction kind should be one of %s | %s", AuctionKindVickrey, AuctionKindProvider))
|
||||||
|
}
|
||||||
|
|
||||||
if msg.CommitsDuration <= 0 {
|
if msg.CommitsDuration <= 0 {
|
||||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "commit phase duration invalid.")
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "commit phase duration invalid")
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg.RevealsDuration <= 0 {
|
if msg.RevealsDuration <= 0 {
|
||||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "reveal phase duration invalid.")
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "reveal phase duration invalid")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !msg.MinimumBid.IsPositive() {
|
if msg.Kind == AuctionKindVickrey && !msg.MinimumBid.IsPositive() {
|
||||||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "minimum bid should be greater than zero.")
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("minimum bid should be greater than zero for %s auction", AuctionKindVickrey))
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.Kind == AuctionKindProvider {
|
||||||
|
if !msg.MaxPrice.IsPositive() {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("max price should be greater than zero for %s auction", AuctionKindProvider))
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.NumProviders <= 0 {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("num providers should be greater than zero for %s auction", AuctionKindProvider))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -71,15 +118,6 @@ func (msg MsgCommitBid) ValidateBasic() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgRevealBid is the constructor function for MsgRevealBid.
|
|
||||||
func NewMsgRevealBid(auctionId string, reveal string, signer sdk.AccAddress) MsgRevealBid {
|
|
||||||
return MsgRevealBid{
|
|
||||||
AuctionId: auctionId,
|
|
||||||
Reveal: reveal,
|
|
||||||
Signer: signer.String(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateBasic Implements Msg.
|
// ValidateBasic Implements Msg.
|
||||||
func (msg MsgRevealBid) ValidateBasic() error {
|
func (msg MsgRevealBid) ValidateBasic() error {
|
||||||
if msg.Signer == "" {
|
if msg.Signer == "" {
|
||||||
@@ -96,3 +134,16 @@ func (msg MsgRevealBid) ValidateBasic() error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ValidateBasic Implements Msg.
|
||||||
|
func (msg MsgReleaseFunds) ValidateBasic() error {
|
||||||
|
if msg.Signer == "" {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer address")
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.AuctionId == "" {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid auction id")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
+1
-132
@@ -1,142 +1,11 @@
|
|||||||
package auction
|
package auction
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
fmt "fmt"
|
|
||||||
"strings"
|
|
||||||
time "time"
|
|
||||||
|
|
||||||
sdkmath "cosmossdk.io/math"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
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}
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewParams(commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params {
|
|
||||||
return Params{
|
|
||||||
CommitsDuration: commitsDuration,
|
|
||||||
RevealsDuration: revealsDuration,
|
|
||||||
CommitFee: commitFee,
|
|
||||||
RevealFee: revealFee,
|
|
||||||
MinimumBid: minimumBid,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultParams returns a default set of parameters.
|
// DefaultParams returns a default set of parameters.
|
||||||
func DefaultParams() Params {
|
func DefaultParams() Params {
|
||||||
return Params{
|
return Params{}
|
||||||
CommitsDuration: DefaultCommitsDuration,
|
|
||||||
RevealsDuration: DefaultRevealsDuration,
|
|
||||||
CommitFee: DefaultCommitFee,
|
|
||||||
RevealFee: DefaultRevealFee,
|
|
||||||
MinimumBid: DefaultMinimumBid,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// String returns a human readable string representation of the parameters.
|
|
||||||
func (p Params) String() string {
|
|
||||||
var sb strings.Builder
|
|
||||||
sb.WriteString("Params: \n")
|
|
||||||
sb.WriteString(fmt.Sprintf("CommitsDuration: %s\n", p.CommitsDuration.String()))
|
|
||||||
sb.WriteString(fmt.Sprintf("RevealsDuration: %s\n", p.RevealsDuration.String()))
|
|
||||||
sb.WriteString(fmt.Sprintf("CommitFee: %s\n", p.CommitFee.String()))
|
|
||||||
sb.WriteString(fmt.Sprintf("RevealFee: %s\n", p.RevealFee.String()))
|
|
||||||
sb.WriteString(fmt.Sprintf("MinimumBid: %s\n", p.MinimumBid.String()))
|
|
||||||
return sb.String()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate a set of params.
|
// Validate a set of params.
|
||||||
func (p Params) Validate() error {
|
func (p Params) Validate() error {
|
||||||
if err := validateCommitsDuration(p.CommitsDuration); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := validateRevealsDuration(p.RevealsDuration); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := validateCommitFee(p.CommitFee); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := validateRevealFee(p.RevealFee); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := validateMinimumBid(p.MinimumBid); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validateCommitsDuration(i interface{}) error {
|
|
||||||
v, ok := i.(time.Duration)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid parameter type: %T", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if v < 0 {
|
|
||||||
return errors.New("commits duration cannot be negative")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validateRevealsDuration(i interface{}) error {
|
|
||||||
v, ok := i.(time.Duration)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid parameter type: %T", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if v < 0 {
|
|
||||||
return errors.New("reveals duration cannot be negative")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validateCommitFee(i interface{}) error {
|
|
||||||
v, ok := i.(sdk.Coin)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid parameter type: %T", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if v.Amount.IsNegative() {
|
|
||||||
return errors.New("commit fee must be positive")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validateRevealFee(i interface{}) error {
|
|
||||||
v, ok := i.(sdk.Coin)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid parameter type: %T", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if v.Amount.IsNegative() {
|
|
||||||
return errors.New("reveal fee must be positive")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func validateMinimumBid(i interface{}) error {
|
|
||||||
v, ok := i.(sdk.Coin)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid parameter type: %T", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if v.Amount.IsNegative() {
|
|
||||||
return errors.New("minimum bid must be positive")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
+1048
-93
File diff suppressed because it is too large
Load Diff
@@ -141,6 +141,42 @@ func local_request_Msg_RevealBid_0(ctx context.Context, marshaler runtime.Marsha
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Msg_ReleaseFunds_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
|
func request_Msg_ReleaseFunds_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReleaseFunds
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReleaseFunds_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.ReleaseFunds(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Msg_ReleaseFunds_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq MsgReleaseFunds
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
if err := req.ParseForm(); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReleaseFunds_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.ReleaseFunds(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
|
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
|
||||||
// UnaryRPC :call MsgServer directly.
|
// UnaryRPC :call MsgServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
@@ -216,6 +252,29 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReleaseFunds_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_Msg_ReleaseFunds_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_Msg_ReleaseFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,6 +376,26 @@ func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("POST", pattern_Msg_ReleaseFunds_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_Msg_ReleaseFunds_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Msg_ReleaseFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,6 +405,8 @@ var (
|
|||||||
pattern_Msg_CommitBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "commit_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
pattern_Msg_CommitBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "commit_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
pattern_Msg_RevealBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "reveal_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
pattern_Msg_RevealBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "reveal_bid"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
|
||||||
|
pattern_Msg_ReleaseFunds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "release_funds"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -334,4 +415,6 @@ var (
|
|||||||
forward_Msg_CommitBid_0 = runtime.ForwardResponseMessage
|
forward_Msg_CommitBid_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Msg_RevealBid_0 = runtime.ForwardResponseMessage
|
forward_Msg_RevealBid_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Msg_ReleaseFunds_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ const (
|
|||||||
BidStatusRevealed = "reveal"
|
BidStatusRevealed = "reveal"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Auction kinds
|
||||||
|
const (
|
||||||
|
AuctionKindVickrey = "vickrey"
|
||||||
|
AuctionKindProvider = "provider"
|
||||||
|
)
|
||||||
|
|
||||||
// AuctionId simplifies generation of auction ids.
|
// AuctionId simplifies generation of auction ids.
|
||||||
type AuctionId struct {
|
type AuctionId struct {
|
||||||
Address sdk.Address
|
Address sdk.Address
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package bond
|
|
||||||
|
|
||||||
import "cosmossdk.io/errors"
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrIndexTooLong = errors.Register(ModuleName, 2, "index too long")
|
|
||||||
ErrDuplicateAddress = errors.Register(ModuleName, 3, "duplicate address")
|
|
||||||
ErrInvalidBlack = errors.Register(ModuleName, 4, "black address is invalid: %s")
|
|
||||||
ErrInvalidRed = errors.Register(ModuleName, 5, "red address is invalid: %s")
|
|
||||||
ErrGameNotParseable = errors.Register(ModuleName, 6, "game cannot be parsed")
|
|
||||||
)
|
|
||||||
+1
-1
@@ -3,7 +3,7 @@ package bond
|
|||||||
// bond module event types
|
// bond module event types
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventTypeCreateBond = "crate_bond"
|
EventTypeCreateBond = "create_bond"
|
||||||
EventTypeRefillBond = "refill_bond"
|
EventTypeRefillBond = "refill_bond"
|
||||||
EventTypeCancelBond = "cancel_bond"
|
EventTypeCancelBond = "cancel_bond"
|
||||||
EventTypeWithdrawBond = "withdraw_bond"
|
EventTypeWithdrawBond = "withdraw_bond"
|
||||||
|
|||||||
+23
-2
@@ -45,6 +45,8 @@ type Keeper struct {
|
|||||||
// Codecs
|
// Codecs
|
||||||
cdc codec.BinaryCodec
|
cdc codec.BinaryCodec
|
||||||
|
|
||||||
|
authority string
|
||||||
|
|
||||||
// External keepers
|
// External keepers
|
||||||
accountKeeper auth.AccountKeeper
|
accountKeeper auth.AccountKeeper
|
||||||
bankKeeper bank.Keeper
|
bankKeeper bank.Keeper
|
||||||
@@ -64,15 +66,24 @@ func NewKeeper(
|
|||||||
storeService store.KVStoreService,
|
storeService store.KVStoreService,
|
||||||
accountKeeper auth.AccountKeeper,
|
accountKeeper auth.AccountKeeper,
|
||||||
bankKeeper bank.Keeper,
|
bankKeeper bank.Keeper,
|
||||||
|
authority string,
|
||||||
) *Keeper {
|
) *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)
|
sb := collections.NewSchemaBuilder(storeService)
|
||||||
k := Keeper{
|
k := Keeper{
|
||||||
cdc: cdc,
|
cdc: cdc,
|
||||||
|
authority: authority,
|
||||||
accountKeeper: accountKeeper,
|
accountKeeper: accountKeeper,
|
||||||
bankKeeper: bankKeeper,
|
bankKeeper: bankKeeper,
|
||||||
Params: collections.NewItem(sb, bondtypes.ParamsPrefix, "params", codec.CollValue[bondtypes.Params](cdc)),
|
Params: collections.NewItem(sb, bondtypes.ParamsPrefix, "params", codec.CollValue[bondtypes.Params](cdc)),
|
||||||
Bonds: collections.NewIndexedMap(sb, bondtypes.BondsPrefix, "bonds", collections.StringKey, codec.CollValue[bondtypes.Bond](cdc), newBondIndexes(sb)),
|
Bonds: collections.NewIndexedMap(
|
||||||
usageKeepers: nil,
|
sb, bondtypes.BondsPrefix, "bonds", collections.StringKey, codec.CollValue[bondtypes.Bond](cdc), newBondIndexes(sb),
|
||||||
|
),
|
||||||
|
usageKeepers: nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
schema, err := sb.Build()
|
schema, err := sb.Build()
|
||||||
@@ -353,6 +364,11 @@ func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre
|
|||||||
return &bond, nil
|
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.
|
// GetParams gets the bond module's parameters.
|
||||||
func (k Keeper) GetParams(ctx sdk.Context) (*bondtypes.Params, error) {
|
func (k Keeper) GetParams(ctx sdk.Context) (*bondtypes.Params, error) {
|
||||||
params, err := k.Params.Get(ctx)
|
params, err := k.Params.Get(ctx)
|
||||||
@@ -363,6 +379,11 @@ func (k Keeper) GetParams(ctx sdk.Context) (*bondtypes.Params, error) {
|
|||||||
return ¶ms, nil
|
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) {
|
func (k Keeper) getMaxBondAmount(ctx sdk.Context) (sdk.Coins, error) {
|
||||||
params, err := k.GetParams(ctx)
|
params, err := k.GetParams(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package keeper
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
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/utils"
|
||||||
"git.vdb.to/cerc-io/laconicd/x/bond"
|
"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
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -63,12 +63,17 @@ func (qs queryServer) GetBondById(c context.Context, req *bondtypes.QueryGetBond
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetBondsByOwner implements bond.QueryServer.
|
// GetBondsByOwner implements bond.QueryServer.
|
||||||
func (qs queryServer) GetBondsByOwner(c context.Context, req *bondtypes.QueryGetBondsByOwnerRequest) (*bondtypes.QueryGetBondsByOwnerResponse, error) {
|
func (qs queryServer) GetBondsByOwner(
|
||||||
|
c context.Context,
|
||||||
|
req *bondtypes.QueryGetBondsByOwnerRequest,
|
||||||
|
) (*bondtypes.QueryGetBondsByOwnerResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
owner := req.GetOwner()
|
owner := req.GetOwner()
|
||||||
if len(owner) == 0 {
|
if len(owner) == 0 {
|
||||||
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "owner required")
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest,
|
||||||
|
"owner required",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
bonds, err := qs.k.GetBondsByOwner(ctx, owner)
|
bonds, err := qs.k.GetBondsByOwner(ctx, owner)
|
||||||
@@ -80,9 +85,14 @@ func (qs queryServer) GetBondsByOwner(c context.Context, req *bondtypes.QueryGet
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetBondModuleBalance implements bond.QueryServer.
|
// GetBondModuleBalance implements bond.QueryServer.
|
||||||
func (qs queryServer) GetBondModuleBalance(c context.Context, _ *bondtypes.QueryGetBondModuleBalanceRequest) (*bondtypes.QueryGetBondModuleBalanceResponse, error) {
|
func (qs queryServer) GetBondModuleBalance(
|
||||||
|
c context.Context,
|
||||||
|
_ *bondtypes.QueryGetBondModuleBalanceRequest,
|
||||||
|
) (*bondtypes.QueryGetBondModuleBalanceResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
balances := qs.k.GetBondModuleBalances(ctx)
|
balances := qs.k.GetBondModuleBalances(ctx)
|
||||||
|
|
||||||
return &bondtypes.QueryGetBondModuleBalanceResponse{Balance: balances}, nil
|
return &bondtypes.QueryGetBondModuleBalanceResponse{
|
||||||
|
Balance: balances,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|||||||
{ProtoField: "id"},
|
{ProtoField: "id"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
RpcMethod: "UpdateParams",
|
||||||
|
Skip: true, // skipped because authority gated
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import (
|
|||||||
"cosmossdk.io/core/appmodule"
|
"cosmossdk.io/core/appmodule"
|
||||||
"cosmossdk.io/core/store"
|
"cosmossdk.io/core/store"
|
||||||
"cosmossdk.io/depinject"
|
"cosmossdk.io/depinject"
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
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"
|
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"
|
modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/bond/module/v1"
|
||||||
"git.vdb.to/cerc-io/laconicd/x/bond"
|
"git.vdb.to/cerc-io/laconicd/x/bond"
|
||||||
@@ -34,6 +35,7 @@ func init() {
|
|||||||
type ModuleInputs struct {
|
type ModuleInputs struct {
|
||||||
depinject.In
|
depinject.In
|
||||||
|
|
||||||
|
Config *modulev1.Module
|
||||||
Cdc codec.Codec
|
Cdc codec.Codec
|
||||||
StoreService store.KVStoreService
|
StoreService store.KVStoreService
|
||||||
|
|
||||||
@@ -49,7 +51,13 @@ type ModuleOutputs struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
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)
|
m := NewAppModule(in.Cdc, k)
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k}
|
return ModuleOutputs{Module: m, Keeper: k}
|
||||||
@@ -60,15 +68,14 @@ func InvokeSetBondHooks(
|
|||||||
keeper *keeper.Keeper,
|
keeper *keeper.Keeper,
|
||||||
bondHooks map[string]bond.BondHooksWrapper,
|
bondHooks map[string]bond.BondHooksWrapper,
|
||||||
) error {
|
) error {
|
||||||
// all arguments to invokers are optional
|
// All arguments to invokers are optional
|
||||||
if keeper == nil || config == nil {
|
if keeper == nil || config == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var usageKeepers []bond.BondUsageKeeper
|
usageKeepers := make([]bond.BondUsageKeeper, 0, len(bondHooks))
|
||||||
|
|
||||||
for _, modName := range maps.Keys(bondHooks) {
|
for _, hook := range bondHooks {
|
||||||
hook := bondHooks[modName]
|
|
||||||
usageKeepers = append(usageKeepers, hook)
|
usageKeepers = append(usageKeepers, hook)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ func (AppModule) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingCo
|
|||||||
return data.Validate()
|
return data.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitGenesis performs genesis initialization for the checkers module.
|
// InitGenesis performs genesis initialization for the bond module.
|
||||||
// It returns no validator updates.
|
// It returns no validator updates.
|
||||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
|
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
|
||||||
var genesisState bond.GenesisState
|
var genesisState bond.GenesisState
|
||||||
|
|||||||
+1
-3
@@ -6,9 +6,7 @@ import (
|
|||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var _ sdk.Msg = &MsgCreateBond{}
|
||||||
_ sdk.Msg = &MsgCreateBond{}
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewMsgCreateBond is the constructor function for MsgCreateBond.
|
// NewMsgCreateBond is the constructor function for MsgCreateBond.
|
||||||
func NewMsgCreateBond(coins sdk.Coins, signer sdk.AccAddress) MsgCreateBond {
|
func NewMsgCreateBond(coins sdk.Coins, signer sdk.AccAddress) MsgCreateBond {
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
|||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default parameter values.
|
// 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 {
|
func NewParams(maxBondAmount sdk.Coin) Params {
|
||||||
return Params{MaxBondAmount: maxBondAmount}
|
return Params{MaxBondAmount: maxBondAmount}
|
||||||
|
|||||||
+434
-36
@@ -6,6 +6,7 @@ package bond
|
|||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/cosmos-proto"
|
||||||
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
||||||
types "github.com/cosmos/cosmos-sdk/types"
|
types "github.com/cosmos/cosmos-sdk/types"
|
||||||
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
@@ -416,6 +417,102 @@ func (m *MsgCancelBondResponse) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_MsgCancelBondResponse proto.InternalMessageInfo
|
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() {
|
func init() {
|
||||||
proto.RegisterType((*MsgCreateBond)(nil), "cerc.bond.v1.MsgCreateBond")
|
proto.RegisterType((*MsgCreateBond)(nil), "cerc.bond.v1.MsgCreateBond")
|
||||||
proto.RegisterType((*MsgCreateBondResponse)(nil), "cerc.bond.v1.MsgCreateBondResponse")
|
proto.RegisterType((*MsgCreateBondResponse)(nil), "cerc.bond.v1.MsgCreateBondResponse")
|
||||||
@@ -425,47 +522,56 @@ func init() {
|
|||||||
proto.RegisterType((*MsgWithdrawBondResponse)(nil), "cerc.bond.v1.MsgWithdrawBondResponse")
|
proto.RegisterType((*MsgWithdrawBondResponse)(nil), "cerc.bond.v1.MsgWithdrawBondResponse")
|
||||||
proto.RegisterType((*MsgCancelBond)(nil), "cerc.bond.v1.MsgCancelBond")
|
proto.RegisterType((*MsgCancelBond)(nil), "cerc.bond.v1.MsgCancelBond")
|
||||||
proto.RegisterType((*MsgCancelBondResponse)(nil), "cerc.bond.v1.MsgCancelBondResponse")
|
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) }
|
func init() { proto.RegisterFile("cerc/bond/v1/tx.proto", fileDescriptor_efb1a132c2c5bd62) }
|
||||||
|
|
||||||
var fileDescriptor_efb1a132c2c5bd62 = []byte{
|
var fileDescriptor_efb1a132c2c5bd62 = []byte{
|
||||||
// 548 bytes of a gzipped FileDescriptorProto
|
// 659 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0x41, 0x6f, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6b, 0x13, 0x41,
|
||||||
0x18, 0x6d, 0x5a, 0x6d, 0x12, 0xde, 0x00, 0xa9, 0x62, 0x6c, 0x6d, 0x59, 0x5a, 0x32, 0x21, 0xaa,
|
0x18, 0xce, 0xa6, 0x1f, 0xd0, 0x69, 0xad, 0xb0, 0xb4, 0xa6, 0x49, 0xed, 0xb6, 0x6e, 0x11, 0x4b,
|
||||||
0x49, 0xb3, 0xd5, 0x71, 0x9b, 0x38, 0x75, 0x5c, 0x7b, 0xe9, 0x05, 0x89, 0x0b, 0x72, 0x12, 0xe3,
|
0xa1, 0x3b, 0x24, 0x82, 0x87, 0xe2, 0xc5, 0xd4, 0x6b, 0x40, 0xa2, 0x22, 0x78, 0x29, 0x93, 0xdd,
|
||||||
0x19, 0x1a, 0x7f, 0x25, 0x36, 0xdd, 0x7a, 0x41, 0x68, 0xbf, 0x00, 0x89, 0x7f, 0xc1, 0x69, 0x07,
|
0x71, 0x3a, 0x9a, 0x9d, 0x59, 0x77, 0xa6, 0x69, 0x73, 0x11, 0xe9, 0x5d, 0x10, 0xfc, 0x17, 0x9e,
|
||||||
0x7e, 0x02, 0x42, 0x3b, 0x4e, 0xe2, 0xc2, 0x69, 0x4c, 0x2d, 0xd2, 0xee, 0xfc, 0x02, 0x14, 0x27,
|
0x7a, 0x28, 0xfe, 0x02, 0x91, 0x1e, 0x8b, 0x5e, 0x3c, 0x55, 0x69, 0x85, 0xde, 0xfd, 0x05, 0xb2,
|
||||||
0x4d, 0x93, 0x35, 0x9b, 0xc4, 0x0d, 0x4e, 0x8d, 0xfd, 0x9e, 0xdf, 0xfb, 0xde, 0xe7, 0xcf, 0x45,
|
0x33, 0xd3, 0xcd, 0x6e, 0xb3, 0x2d, 0x78, 0xd3, 0x53, 0x76, 0xe6, 0x79, 0xf3, 0x3e, 0x1f, 0xfb,
|
||||||
0x6b, 0x1e, 0x0b, 0x3d, 0xe2, 0x82, 0xf4, 0xc9, 0xa8, 0x43, 0xf4, 0x11, 0x1e, 0x86, 0xa0, 0xa1,
|
0xce, 0x0e, 0x98, 0xf5, 0x71, 0xec, 0xc3, 0x0e, 0x67, 0x01, 0xec, 0xd5, 0xa1, 0xdc, 0xf5, 0xa2,
|
||||||
0xba, 0x1a, 0x6d, 0xe3, 0x68, 0x1b, 0x8f, 0x3a, 0xf5, 0x75, 0x0f, 0x54, 0x00, 0x8a, 0x04, 0x8a,
|
0x98, 0x4b, 0x6e, 0x4f, 0x25, 0xdb, 0x5e, 0xb2, 0xed, 0xf5, 0xea, 0xb5, 0x8a, 0xcf, 0x45, 0xc8,
|
||||||
0x47, 0xac, 0x40, 0xf1, 0x98, 0x56, 0xbf, 0xc7, 0x81, 0x83, 0xf9, 0x24, 0xd1, 0x57, 0xb2, 0xfb,
|
0x05, 0x0c, 0x05, 0x49, 0xaa, 0x42, 0x41, 0x74, 0x59, 0x6d, 0x86, 0x70, 0xc2, 0xd5, 0x23, 0x4c,
|
||||||
0x80, 0x03, 0xf0, 0x01, 0x23, 0x74, 0x28, 0x08, 0x95, 0x12, 0x34, 0xd5, 0x02, 0xa4, 0x4a, 0x50,
|
0x9e, 0xcc, 0xee, 0x4d, 0xc2, 0x39, 0xe9, 0x62, 0x88, 0x22, 0x0a, 0x11, 0x63, 0x5c, 0x22, 0x49,
|
||||||
0x3b, 0x11, 0x73, 0xa9, 0x62, 0x64, 0xd4, 0x71, 0x99, 0xa6, 0x1d, 0xe2, 0x81, 0x90, 0x31, 0xee,
|
0x39, 0x13, 0x06, 0x75, 0x4c, 0xb3, 0x0e, 0x12, 0x18, 0xf6, 0xea, 0x1d, 0x2c, 0x51, 0x1d, 0xfa,
|
||||||
0x7c, 0xb1, 0xd0, 0xed, 0x9e, 0xe2, 0xfb, 0x21, 0xa3, 0x9a, 0x75, 0x41, 0xfa, 0xd5, 0xfb, 0x68,
|
0x9c, 0x32, 0x83, 0x57, 0x35, 0xbe, 0xa9, 0xdb, 0xea, 0x85, 0x81, 0x2a, 0x39, 0xb1, 0x4a, 0x9d,
|
||||||
0x59, 0x09, 0x2e, 0x59, 0xb8, 0x61, 0xb5, 0xac, 0xf6, 0xad, 0x7e, 0xb2, 0xaa, 0xbe, 0x47, 0x4b,
|
0x02, 0xdc, 0x03, 0x0b, 0x5c, 0x6b, 0x09, 0xb2, 0x11, 0x63, 0x24, 0x71, 0x93, 0xb3, 0xc0, 0xbe,
|
||||||
0xd1, 0x39, 0xb5, 0x51, 0x6e, 0x55, 0xda, 0x2b, 0xbb, 0x35, 0x1c, 0x2b, 0xe3, 0x48, 0x19, 0x27,
|
0x01, 0xc6, 0x05, 0x25, 0x0c, 0xc7, 0x73, 0xd6, 0x92, 0xb5, 0x32, 0xd1, 0x36, 0x2b, 0xfb, 0x0d,
|
||||||
0xca, 0x78, 0x1f, 0x84, 0xec, 0xf6, 0x4e, 0xcf, 0x9b, 0xa5, 0xdf, 0xe7, 0xcd, 0xda, 0x6b, 0x05,
|
0x18, 0x4b, 0xb8, 0xc4, 0x5c, 0x79, 0x69, 0x64, 0x65, 0xb2, 0x51, 0xf5, 0x0c, 0x41, 0xa2, 0xc6,
|
||||||
0x72, 0xcf, 0x31, 0xa7, 0x9c, 0xd6, 0x98, 0x06, 0x83, 0xd9, 0xe2, 0xf3, 0xcf, 0x66, 0x9b, 0x0b,
|
0x33, 0x6a, 0xbc, 0x0d, 0x4e, 0x59, 0xb3, 0x75, 0x78, 0xbc, 0x58, 0xfa, 0x7d, 0xbc, 0x58, 0x7d,
|
||||||
0x7d, 0xf0, 0xce, 0xc5, 0x1e, 0x04, 0x24, 0xa9, 0x31, 0xfe, 0xd9, 0x51, 0xfe, 0x1b, 0xa2, 0xc7,
|
0x29, 0x38, 0x5b, 0x77, 0xd5, 0xbf, 0xdc, 0xa5, 0x3e, 0x0a, 0xbb, 0xe7, 0x8b, 0x8f, 0x3f, 0x16,
|
||||||
0x43, 0xa6, 0x8c, 0x9a, 0xea, 0xc7, 0xb6, 0x7b, 0x2b, 0xc7, 0x97, 0x27, 0xdb, 0x49, 0x31, 0xce,
|
0x57, 0x08, 0x95, 0x5b, 0xdb, 0x1d, 0xcf, 0xe7, 0xa1, 0x91, 0x6a, 0x7e, 0xd6, 0x44, 0xf0, 0x0a,
|
||||||
0x63, 0xb4, 0x96, 0xab, 0xba, 0xcf, 0xd4, 0x10, 0xa4, 0x62, 0xd5, 0x3b, 0xa8, 0x2c, 0xfc, 0xa4,
|
0xca, 0x7e, 0x84, 0x85, 0xea, 0x26, 0xda, 0x9a, 0x76, 0x7d, 0x72, 0xef, 0x6c, 0x7f, 0xd5, 0x88,
|
||||||
0xf2, 0xb2, 0xf0, 0x9d, 0xaf, 0x71, 0xbe, 0x3e, 0x7b, 0x25, 0x06, 0x03, 0x93, 0xef, 0x0a, 0x23,
|
0x71, 0xef, 0x80, 0xd9, 0x9c, 0xea, 0x36, 0x16, 0x11, 0x67, 0x02, 0xdb, 0xd3, 0xa0, 0x4c, 0x03,
|
||||||
0x93, 0xb7, 0x5c, 0x9c, 0xb7, 0xf2, 0x0f, 0xe4, 0x5d, 0x37, 0x79, 0xe7, 0x29, 0x66, 0x79, 0x9d,
|
0xa3, 0xbc, 0x4c, 0x03, 0xf7, 0xb3, 0xf6, 0xd7, 0xc6, 0x2f, 0x68, 0xb7, 0xab, 0xfc, 0x5d, 0xa8,
|
||||||
0x6f, 0x16, 0xba, 0xdb, 0x53, 0xfc, 0xb9, 0xd0, 0x07, 0x7e, 0x48, 0x0f, 0xff, 0xdf, 0x84, 0x35,
|
0xc8, 0xf8, 0x2d, 0x17, 0xfb, 0x1d, 0xf9, 0x07, 0xfc, 0x56, 0x94, 0xdf, 0x81, 0x8b, 0x73, 0xbf,
|
||||||
0xb4, 0x7e, 0x25, 0x47, 0x9a, 0xf1, 0x59, 0x3c, 0xa2, 0x54, 0x7a, 0xec, 0xaf, 0xae, 0xb0, 0xa8,
|
0xee, 0x17, 0x0b, 0x5c, 0x6f, 0x09, 0xf2, 0x8c, 0xca, 0xad, 0x20, 0x46, 0x3b, 0xff, 0xaf, 0xc3,
|
||||||
0x85, 0x73, 0x95, 0x99, 0xfc, 0xee, 0x45, 0x05, 0x55, 0x7a, 0x8a, 0x57, 0xdf, 0x22, 0x94, 0x79,
|
0x2a, 0xa8, 0x5c, 0xf0, 0x91, 0x7a, 0x7c, 0xa8, 0x47, 0x14, 0x31, 0x1f, 0xff, 0xd5, 0x2b, 0x2c,
|
||||||
0x06, 0x0d, 0x9c, 0x7d, 0x94, 0x38, 0x37, 0x6d, 0xf5, 0xad, 0x1b, 0xc0, 0xb4, 0xec, 0x87, 0xc7,
|
0x8a, 0x70, 0xd0, 0x25, 0x6d, 0xff, 0x4e, 0x47, 0xf8, 0x34, 0x0a, 0x90, 0xc4, 0x8f, 0x50, 0x8c,
|
||||||
0xdf, 0x7f, 0x7d, 0x2a, 0x37, 0x9c, 0x1a, 0xc9, 0xbd, 0x7a, 0xcf, 0x30, 0x5f, 0x46, 0xcb, 0xc8,
|
0x42, 0x61, 0xdf, 0x03, 0x13, 0x68, 0x5b, 0x6e, 0xf1, 0x98, 0xca, 0xbe, 0x26, 0x6a, 0xce, 0x7d,
|
||||||
0x32, 0x33, 0x99, 0x8b, 0x96, 0x73, 0xb0, 0xc0, 0xb2, 0x60, 0x1a, 0xae, 0xb1, 0x0c, 0x0d, 0x33,
|
0x3d, 0x58, 0x9b, 0x31, 0x09, 0x3d, 0x08, 0x82, 0x18, 0x0b, 0xf1, 0x58, 0xc6, 0x94, 0x91, 0xf6,
|
||||||
0xb6, 0x1c, 0xa3, 0xd5, 0xdc, 0xb0, 0x6c, 0x2e, 0xe8, 0x66, 0xe1, 0xfa, 0xa3, 0x1b, 0xe1, 0xd4,
|
0xa0, 0xd4, 0x6e, 0x80, 0xf1, 0x48, 0x75, 0x50, 0x4a, 0x26, 0x1b, 0x33, 0x5e, 0xf6, 0x73, 0xe0,
|
||||||
0x78, 0xcb, 0x18, 0x6f, 0x3a, 0x8d, 0xbc, 0xf1, 0x61, 0xc2, 0x4d, 0xd3, 0x66, 0x2e, 0xb1, 0xa0,
|
0xe9, 0xee, 0xcd, 0xd1, 0x24, 0xce, 0xb6, 0xa9, 0x5c, 0x9f, 0x4e, 0x54, 0x0e, 0x7a, 0x98, 0x24,
|
||||||
0xc1, 0x29, 0x58, 0xd4, 0xe0, 0x85, 0x8b, 0xbb, 0xb6, 0xc1, 0x86, 0x69, 0x2c, 0xeb, 0x4b, 0x1f,
|
0xb2, 0x72, 0xce, 0xa5, 0x36, 0x3e, 0x8d, 0x82, 0x91, 0x96, 0x20, 0xf6, 0x6b, 0x00, 0x32, 0x27,
|
||||||
0x2e, 0x4f, 0xb6, 0xad, 0xee, 0xd3, 0xd3, 0x89, 0x6d, 0x9d, 0x4d, 0x6c, 0xeb, 0x62, 0x62, 0x5b,
|
0x76, 0x3e, 0x4f, 0x92, 0x3b, 0x18, 0xb5, 0xe5, 0x2b, 0xc0, 0x34, 0x82, 0x5b, 0x7b, 0xdf, 0x7e,
|
||||||
0x1f, 0xa7, 0x76, 0xe9, 0x6c, 0x6a, 0x97, 0x7e, 0x4c, 0xed, 0xd2, 0x0b, 0x87, 0x0b, 0x8d, 0x47,
|
0x7d, 0x28, 0xcf, 0xbb, 0x55, 0x98, 0xfb, 0x4e, 0xf8, 0xaa, 0x72, 0x33, 0x59, 0x26, 0x94, 0x99,
|
||||||
0xbe, 0x8b, 0x35, 0x18, 0x95, 0x1d, 0x01, 0x64, 0x40, 0x3d, 0x90, 0xc2, 0xf3, 0xc9, 0x91, 0xd1,
|
0x43, 0x34, 0x4c, 0x39, 0x00, 0x0b, 0x28, 0x0b, 0x06, 0xf7, 0x12, 0xca, 0x58, 0x55, 0x6a, 0xca,
|
||||||
0x74, 0x97, 0xcd, 0x5f, 0xe5, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x49, 0xe0, 0xe1,
|
0x3e, 0x98, 0xca, 0xcd, 0xf5, 0xc2, 0x50, 0xdf, 0x2c, 0x5c, 0xbb, 0x7d, 0x25, 0x9c, 0x12, 0x2f,
|
||||||
0xbe, 0x05, 0x00, 0x00,
|
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.
|
// 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)
|
WithdrawBond(ctx context.Context, in *MsgWithdrawBond, opts ...grpc.CallOption) (*MsgWithdrawBondResponse, error)
|
||||||
// CancelBond defines a method for cancelling a bond.
|
// CancelBond defines a method for cancelling a bond.
|
||||||
CancelBond(ctx context.Context, in *MsgCancelBond, opts ...grpc.CallOption) (*MsgCancelBondResponse, error)
|
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 {
|
type msgClient struct {
|
||||||
@@ -534,6 +643,15 @@ func (c *msgClient) CancelBond(ctx context.Context, in *MsgCancelBond, opts ...g
|
|||||||
return out, nil
|
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.
|
// MsgServer is the server API for Msg service.
|
||||||
type MsgServer interface {
|
type MsgServer interface {
|
||||||
// CreateBond defines a method for creating a new bond.
|
// CreateBond defines a method for creating a new bond.
|
||||||
@@ -544,6 +662,9 @@ type MsgServer interface {
|
|||||||
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
WithdrawBond(context.Context, *MsgWithdrawBond) (*MsgWithdrawBondResponse, error)
|
||||||
// CancelBond defines a method for cancelling a bond.
|
// CancelBond defines a method for cancelling a bond.
|
||||||
CancelBond(context.Context, *MsgCancelBond) (*MsgCancelBondResponse, error)
|
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.
|
// 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) {
|
func (*UnimplementedMsgServer) CancelBond(ctx context.Context, req *MsgCancelBond) (*MsgCancelBondResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CancelBond not implemented")
|
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) {
|
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
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)
|
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{
|
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "cerc.bond.v1.Msg",
|
ServiceName: "cerc.bond.v1.Msg",
|
||||||
HandlerType: (*MsgServer)(nil),
|
HandlerType: (*MsgServer)(nil),
|
||||||
@@ -659,6 +801,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "CancelBond",
|
MethodName: "CancelBond",
|
||||||
Handler: _Msg_CancelBond_Handler,
|
Handler: _Msg_CancelBond_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cerc/bond/v1/tx.proto",
|
Metadata: "cerc/bond/v1/tx.proto",
|
||||||
@@ -946,6 +1092,69 @@ func (m *MsgCancelBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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 {
|
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||||
offset -= sovTx(v)
|
offset -= sovTx(v)
|
||||||
base := offset
|
base := offset
|
||||||
@@ -1079,6 +1288,30 @@ func (m *MsgCancelBondResponse) Size() (n int) {
|
|||||||
return n
|
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) {
|
func sovTx(x uint64) (n int) {
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
}
|
}
|
||||||
@@ -1843,6 +2076,171 @@ func (m *MsgCancelBondResponse) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
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) {
|
func skipTx(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package onboarding
|
||||||
|
|
||||||
|
import (
|
||||||
|
types "github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RegisterInterfaces registers the interfaces types with the interface registry.
|
||||||
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||||
|
registry.RegisterImplementations((*sdk.Msg)(nil),
|
||||||
|
&MsgOnboardParticipant{},
|
||||||
|
)
|
||||||
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package onboarding
|
||||||
|
|
||||||
|
// onboarding module event types
|
||||||
|
|
||||||
|
const (
|
||||||
|
EventTypeOnboardParticipant = "onboard_participant"
|
||||||
|
|
||||||
|
AttributeKeySigner = "signer"
|
||||||
|
AttributeKeyEthAddress = "eth_address"
|
||||||
|
AttributeValueCategory = ModuleName
|
||||||
|
)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package onboarding
|
||||||
|
|
||||||
|
func DefaultGenesisState() *GenesisState {
|
||||||
|
return &GenesisState{
|
||||||
|
Params: DefaultParams(),
|
||||||
|
Participants: []Participant{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGenesisState(params Params, participants []Participant) *GenesisState {
|
||||||
|
return &GenesisState{
|
||||||
|
Params: params,
|
||||||
|
Participants: participants,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate performs basic genesis state validation returning an error upon any
|
||||||
|
func (gs *GenesisState) Validate() error {
|
||||||
|
if err := gs.Params.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,387 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: cerc/onboarding/v1/genesis.proto
|
||||||
|
|
||||||
|
package onboarding
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// GenesisState defines the onboarding module's genesis state.
|
||||||
|
type GenesisState struct {
|
||||||
|
// params defines all the parameters of the module.
|
||||||
|
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
|
||||||
|
// participants defines all the participants
|
||||||
|
Participants []Participant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||||
|
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*GenesisState) ProtoMessage() {}
|
||||||
|
func (*GenesisState) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_d21793296c3d9d75, []int{0}
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_GenesisState.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_GenesisState.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *GenesisState) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) GetParticipants() []Participant {
|
||||||
|
if m != nil {
|
||||||
|
return m.Participants
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*GenesisState)(nil), "cerc.onboarding.v1.GenesisState")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("cerc/onboarding/v1/genesis.proto", fileDescriptor_d21793296c3d9d75) }
|
||||||
|
|
||||||
|
var fileDescriptor_d21793296c3d9d75 = []byte{
|
||||||
|
// 234 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x4e, 0x2d, 0x4a,
|
||||||
|
0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x4f,
|
||||||
|
0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xa9,
|
||||||
|
0xd0, 0x43, 0xa8, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83,
|
||||||
|
0x58, 0x10, 0x95, 0x52, 0xca, 0x58, 0xcc, 0x42, 0xd2, 0x07, 0x56, 0xa4, 0x34, 0x99, 0x91, 0x8b,
|
||||||
|
0xc7, 0x1d, 0x62, 0x41, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x05, 0x17, 0x5b, 0x41, 0x62, 0x51,
|
||||||
|
0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xa6, 0x85, 0x7a, 0x01,
|
||||||
|
0x60, 0x15, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x0b, 0x79, 0x72, 0xf1, 0x14,
|
||||||
|
0x24, 0x16, 0x95, 0x64, 0x26, 0x67, 0x16, 0x24, 0xe6, 0x95, 0x14, 0x4b, 0x30, 0x29, 0x30, 0x6b,
|
||||||
|
0x70, 0x1b, 0xc9, 0xe3, 0xd0, 0x0f, 0x53, 0x07, 0x35, 0x04, 0x45, 0xab, 0x93, 0xd3, 0x89, 0x47,
|
||||||
|
0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85,
|
||||||
|
0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa4, 0x67, 0x96, 0xe8, 0x95, 0xa5, 0x24,
|
||||||
|
0xe9, 0x95, 0xe4, 0xeb, 0x83, 0x0c, 0xd6, 0xcd, 0xcc, 0xd7, 0xcf, 0x49, 0x4c, 0xce, 0xcf, 0xcb,
|
||||||
|
0x4c, 0x4e, 0xd1, 0xaf, 0x40, 0xf2, 0x5f, 0x12, 0x1b, 0xd8, 0x83, 0xc6, 0x80, 0x00, 0x00, 0x00,
|
||||||
|
0xff, 0xff, 0x90, 0xbd, 0x55, 0xee, 0x53, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Participants) > 0 {
|
||||||
|
for iNdEx := len(m.Participants) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
{
|
||||||
|
size, err := m.Participants[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovGenesis(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
if len(m.Participants) > 0 {
|
||||||
|
for _, e := range m.Participants {
|
||||||
|
l = e.Size()
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovGenesis(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozGenesis(x uint64) (n int) {
|
||||||
|
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *GenesisState) 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 ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
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: GenesisState: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
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 ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Participants = append(m.Participants, Participant{})
|
||||||
|
if err := m.Participants[len(m.Participants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipGenesis(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupGenesis
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
|
)
|
||||||
|
|
||||||
|
// InitGenesis initializes the module state from a genesis state.
|
||||||
|
func (k *Keeper) InitGenesis(ctx context.Context, data *onboarding.GenesisState) error {
|
||||||
|
if err := k.Params.Set(ctx, data.Params); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, participant := range data.Participants {
|
||||||
|
if err := k.Participants.Set(ctx, participant.CosmosAddress, participant); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExportGenesis exports the module state to a genesis state.
|
||||||
|
func (k *Keeper) ExportGenesis(ctx context.Context) (*onboarding.GenesisState, error) {
|
||||||
|
params, err := k.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var participants []onboarding.Participant
|
||||||
|
if err := k.Participants.Walk(ctx, nil, func(cosmosAddress string, participant onboarding.Participant) (bool, error) {
|
||||||
|
participants = append(participants, participant)
|
||||||
|
return false, nil
|
||||||
|
}); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &onboarding.GenesisState{
|
||||||
|
Params: params,
|
||||||
|
Participants: participants,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"cosmossdk.io/collections"
|
||||||
|
"cosmossdk.io/core/address"
|
||||||
|
storetypes "cosmossdk.io/core/store"
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/utils"
|
||||||
|
onboardingTypes "git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Keeper struct {
|
||||||
|
cdc codec.BinaryCodec
|
||||||
|
addressCodec address.Codec
|
||||||
|
|
||||||
|
// authority is the address capable of executing a MsgUpdateParams and other authority-gated message.
|
||||||
|
// typically, this should be the x/gov module account.
|
||||||
|
authority string
|
||||||
|
|
||||||
|
// state management
|
||||||
|
Schema collections.Schema
|
||||||
|
Params collections.Item[onboardingTypes.Params]
|
||||||
|
Participants collections.Map[string, onboardingTypes.Participant]
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewKeeper creates a new Keeper instance
|
||||||
|
func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, authority string) *Keeper {
|
||||||
|
if _, err := addressCodec.StringToBytes(authority); err != nil {
|
||||||
|
panic(fmt.Errorf("invalid authority address: %w", err))
|
||||||
|
}
|
||||||
|
|
||||||
|
sb := collections.NewSchemaBuilder(storeService)
|
||||||
|
k := Keeper{
|
||||||
|
cdc: cdc,
|
||||||
|
addressCodec: addressCodec,
|
||||||
|
authority: authority,
|
||||||
|
Params: collections.NewItem(sb, onboardingTypes.ParamsPrefix, "params", codec.CollValue[onboardingTypes.Params](cdc)),
|
||||||
|
Participants: collections.NewMap(
|
||||||
|
sb, onboardingTypes.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboardingTypes.Participant](cdc),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
schema, err := sb.Build()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
k.Schema = schema
|
||||||
|
|
||||||
|
return &k
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetAuthority returns the module's authority.
|
||||||
|
func (k Keeper) GetAuthority() string {
|
||||||
|
return k.authority
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
|
||||||
|
return ctx.Logger().With("module", onboardingTypes.ModuleName)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) OnboardParticipant(
|
||||||
|
ctx sdk.Context,
|
||||||
|
msg *onboardingTypes.MsgOnboardParticipant,
|
||||||
|
signerAddress sdk.AccAddress,
|
||||||
|
) (*onboardingTypes.MsgOnboardParticipantResponse, error) {
|
||||||
|
params, err := k.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if !params.OnboardingEnabled {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Onboarding is disabled")
|
||||||
|
}
|
||||||
|
|
||||||
|
message, err := json.Marshal(msg.EthPayload)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid format for payload")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode eth address from signature which should be the nitro address of the participant
|
||||||
|
nitroAddress, err := utils.DecodeEthereumAddress(message, msg.EthSignature)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Failed to decode Ethereum address")
|
||||||
|
}
|
||||||
|
|
||||||
|
if nitroAddress != msg.EthPayload.Address {
|
||||||
|
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Recovered ethereum address does not match the address set in payload")
|
||||||
|
}
|
||||||
|
|
||||||
|
participant := &onboardingTypes.Participant{
|
||||||
|
CosmosAddress: signerAddress.String(),
|
||||||
|
NitroAddress: nitroAddress,
|
||||||
|
Role: msg.Role,
|
||||||
|
KycId: msg.KycId,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := k.StoreParticipant(ctx, participant); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &onboardingTypes.MsgOnboardParticipantResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboardingTypes.Participant) error {
|
||||||
|
key := participant.CosmosAddress
|
||||||
|
return k.Participants.Set(ctx, key, *participant)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListParticipants - get all participants.
|
||||||
|
func (k Keeper) ListParticipants(ctx sdk.Context) ([]*onboardingTypes.Participant, error) {
|
||||||
|
var participants []*onboardingTypes.Participant
|
||||||
|
|
||||||
|
iter, err := k.Participants.Iterate(ctx, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for ; iter.Valid(); iter.Next() {
|
||||||
|
participant, err := iter.Value()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
participants = append(participants, &participant)
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/utils"
|
||||||
|
"git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
|
)
|
||||||
|
|
||||||
|
type msgServer struct {
|
||||||
|
k Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ onboarding.MsgServer = msgServer{}
|
||||||
|
|
||||||
|
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
||||||
|
func NewMsgServerImpl(keeper *Keeper) onboarding.MsgServer {
|
||||||
|
return &msgServer{k: *keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms msgServer) OnboardParticipant(c context.Context, msg *onboarding.MsgOnboardParticipant) (*onboarding.MsgOnboardParticipantResponse, error) {
|
||||||
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
ctx = *utils.CtxWithCustomKVGasConfig(&ctx)
|
||||||
|
|
||||||
|
signerAddress, err := sdk.AccAddressFromBech32(msg.Participant)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = ms.k.OnboardParticipant(ctx, msg, signerAddress)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.EventManager().EmitEvents(sdk.Events{
|
||||||
|
sdk.NewEvent(
|
||||||
|
onboarding.EventTypeOnboardParticipant,
|
||||||
|
sdk.NewAttribute(onboarding.AttributeKeySigner, msg.Participant),
|
||||||
|
sdk.NewAttribute(onboarding.AttributeKeyEthAddress, msg.EthPayload.Address),
|
||||||
|
),
|
||||||
|
sdk.NewEvent(
|
||||||
|
sdk.EventTypeMessage,
|
||||||
|
sdk.NewAttribute(sdk.AttributeKeyModule, onboarding.AttributeValueCategory),
|
||||||
|
sdk.NewAttribute(onboarding.AttributeKeySigner, msg.Participant),
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
utils.LogTxGasConsumed(ctx, ms.k.Logger(ctx), "OnboardParticipant")
|
||||||
|
|
||||||
|
return &onboarding.MsgOnboardParticipantResponse{}, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ onboardingtypes.QueryServer = queryServer{}
|
||||||
|
|
||||||
|
type queryServer struct {
|
||||||
|
k *Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewQueryServerImpl returns an implementation of the module QueryServer.
|
||||||
|
func NewQueryServerImpl(k *Keeper) onboardingtypes.QueryServer {
|
||||||
|
return queryServer{k}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Participants implements Participants.QueryServer.
|
||||||
|
func (qs queryServer) Participants(
|
||||||
|
c context.Context,
|
||||||
|
_ *onboardingtypes.QueryParticipantsRequest,
|
||||||
|
) (*onboardingtypes.QueryParticipantsResponse, error) {
|
||||||
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
|
resp, err := qs.k.ListParticipants(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package onboarding
|
||||||
|
|
||||||
|
import "cosmossdk.io/collections"
|
||||||
|
|
||||||
|
const (
|
||||||
|
ModuleName = "onboarding"
|
||||||
|
|
||||||
|
// StoreKey defines the primary module store key
|
||||||
|
StoreKey = ModuleName
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ParamsPrefix = collections.NewPrefix(0)
|
||||||
|
|
||||||
|
ParticipantsPrefix = collections.NewPrefix(1)
|
||||||
|
)
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||||
|
|
||||||
|
onboardingv1 "git.vdb.to/cerc-io/laconicd/api/cerc/onboarding/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||||
|
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||||
|
return &autocliv1.ModuleOptions{
|
||||||
|
Query: &autocliv1.ServiceCommandDescriptor{
|
||||||
|
Service: onboardingv1.Query_ServiceDesc.ServiceName,
|
||||||
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||||
|
{
|
||||||
|
RpcMethod: "Participants",
|
||||||
|
Use: "list",
|
||||||
|
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
|
||||||
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||||
|
Service: onboardingv1.Msg_ServiceDesc.ServiceName,
|
||||||
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||||
|
{
|
||||||
|
RpcMethod: "OnboardParticipant",
|
||||||
|
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"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cosmossdk.io/core/address"
|
||||||
|
"cosmossdk.io/core/appmodule"
|
||||||
|
"cosmossdk.io/core/store"
|
||||||
|
"cosmossdk.io/depinject"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
|
||||||
|
modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/onboarding/module/v1"
|
||||||
|
"git.vdb.to/cerc-io/laconicd/x/onboarding/keeper"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ appmodule.AppModule = AppModule{}
|
||||||
|
|
||||||
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
||||||
|
func (am AppModule) IsOnePerModuleType() {}
|
||||||
|
|
||||||
|
// IsAppModule implements the appmodule.AppModule interface.
|
||||||
|
func (am AppModule) IsAppModule() {}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
appmodule.Register(
|
||||||
|
&modulev1.Module{},
|
||||||
|
appmodule.Provide(ProvideModule),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleInputs struct {
|
||||||
|
depinject.In
|
||||||
|
|
||||||
|
Cdc codec.Codec
|
||||||
|
StoreService store.KVStoreService
|
||||||
|
AddressCodec address.Codec
|
||||||
|
|
||||||
|
Config *modulev1.Module
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleOutputs struct {
|
||||||
|
depinject.Out
|
||||||
|
|
||||||
|
Module appmodule.AppModule
|
||||||
|
Keeper *keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||||
|
// default to governance as authority if not provided
|
||||||
|
authority := authtypes.NewModuleAddress("gov")
|
||||||
|
if in.Config.Authority != "" {
|
||||||
|
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
|
||||||
|
}
|
||||||
|
|
||||||
|
k := keeper.NewKeeper(in.Cdc, in.AddressCodec, in.StoreService, authority.String())
|
||||||
|
m := NewAppModule(in.Cdc, k)
|
||||||
|
|
||||||
|
return ModuleOutputs{Module: m, Keeper: k}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"cosmossdk.io/core/appmodule"
|
||||||
|
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/module"
|
||||||
|
|
||||||
|
"git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||||
|
"git.vdb.to/cerc-io/laconicd/x/onboarding/keeper"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ module.AppModuleBasic = AppModule{}
|
||||||
|
_ module.HasGenesis = AppModule{}
|
||||||
|
_ appmodule.AppModule = AppModule{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ConsensusVersion defines the current module consensus version.
|
||||||
|
const ConsensusVersion = 1
|
||||||
|
|
||||||
|
type AppModule struct {
|
||||||
|
cdc codec.Codec
|
||||||
|
keeper *keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAppModule creates a new AppModule object
|
||||||
|
func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule {
|
||||||
|
return AppModule{
|
||||||
|
cdc: cdc,
|
||||||
|
keeper: keeper,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAppModuleBasic(m AppModule) module.AppModuleBasic {
|
||||||
|
return module.CoreAppModuleBasicAdaptor(m.Name(), m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the onboarding module's name.
|
||||||
|
func (AppModule) Name() string { return onboarding.ModuleName }
|
||||||
|
|
||||||
|
// RegisterLegacyAminoCodec registers the onboarding module's types on the LegacyAmino codec.
|
||||||
|
// New modules do not need to support Amino.
|
||||||
|
func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}
|
||||||
|
|
||||||
|
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the onboarding module.
|
||||||
|
func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
|
||||||
|
if err := onboarding.RegisterQueryHandlerClient(context.Background(), mux, onboarding.NewQueryClient(clientCtx)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterInterfaces registers interfaces and implementations of the onboarding module.
|
||||||
|
func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
|
||||||
|
onboarding.RegisterInterfaces(registry)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConsensusVersion implements AppModule/ConsensusVersion.
|
||||||
|
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
|
||||||
|
|
||||||
|
// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries.
|
||||||
|
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||||
|
// Register servers
|
||||||
|
onboarding.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
|
||||||
|
onboarding.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper))
|
||||||
|
|
||||||
|
// Register in place module state migration migrations
|
||||||
|
// m := keeper.NewMigrator(am.keeper)
|
||||||
|
// if err := cfg.RegisterMigration(onboarding.ModuleName, 1, m.Migrate1to2); err != nil {
|
||||||
|
// panic(fmt.Sprintf("failed to migrate x/%s from version 1 to 2: %v", onboarding.ModuleName, err))
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultGenesis returns default genesis state as raw bytes for the module.
|
||||||
|
func (AppModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
||||||
|
return cdc.MustMarshalJSON(onboarding.DefaultGenesisState())
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateGenesis performs genesis state validation for the circuit module.
|
||||||
|
func (AppModule) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
|
||||||
|
var data onboarding.GenesisState
|
||||||
|
if err := cdc.UnmarshalJSON(bz, &data); err != nil {
|
||||||
|
return fmt.Errorf("failed to unmarshal %s genesis state: %w", onboarding.ModuleName, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.Validate()
|
||||||
|
}
|
||||||
|
|
||||||
|
// InitGenesis performs genesis initialization for the onboarding module.
|
||||||
|
// It returns no validator updates.
|
||||||
|
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
|
||||||
|
var genesisState onboarding.GenesisState
|
||||||
|
cdc.MustUnmarshalJSON(data, &genesisState)
|
||||||
|
|
||||||
|
if err := am.keeper.InitGenesis(ctx, &genesisState); err != nil {
|
||||||
|
panic(fmt.Sprintf("failed to initialize %s genesis state: %v", onboarding.ModuleName, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExportGenesis returns the exported genesis state as raw bytes for the circuit
|
||||||
|
// module.
|
||||||
|
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
|
||||||
|
gs, err := am.keeper.ExportGenesis(ctx)
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Sprintf("failed to export %s genesis state: %v", onboarding.ModuleName, err))
|
||||||
|
}
|
||||||
|
|
||||||
|
return cdc.MustMarshalJSON(gs)
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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 {
|
||||||
|
if len(msg.Participant) == 0 {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrorInvalidSigner, msg.Participant)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(msg.EthPayload.Address) != 42 {
|
||||||
|
return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Participant)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(msg.EthSignature) != 132 {
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,874 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: cerc/onboarding/v1/onboarding.proto
|
||||||
|
|
||||||
|
package onboarding
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// Params defines the parameters of the onboarding module.
|
||||||
|
type Params struct {
|
||||||
|
OnboardingEnabled bool `protobuf:"varint,1,opt,name=onboarding_enabled,json=onboardingEnabled,proto3" json:"onboarding_enabled,omitempty" json:"onboarding_enabled" yaml:"onboarding_enabled"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Reset() { *m = Params{} }
|
||||||
|
func (m *Params) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Params) ProtoMessage() {}
|
||||||
|
func (*Params) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_59afed779274eaf0, []int{0}
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Params.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Params) GetOnboardingEnabled() bool {
|
||||||
|
if m != nil {
|
||||||
|
return m.OnboardingEnabled
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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"`
|
||||||
|
// 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{} }
|
||||||
|
func (m *Participant) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Participant) ProtoMessage() {}
|
||||||
|
func (*Participant) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_59afed779274eaf0, []int{1}
|
||||||
|
}
|
||||||
|
func (m *Participant) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Participant.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 *Participant) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Participant.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Participant) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Participant) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Participant.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Participant proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Participant) GetCosmosAddress() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.CosmosAddress
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Participant) GetNitroAddress() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.NitroAddress
|
||||||
|
}
|
||||||
|
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"`
|
||||||
|
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty" json:"msg" yaml:"msg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EthPayload) Reset() { *m = EthPayload{} }
|
||||||
|
func (m *EthPayload) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*EthPayload) ProtoMessage() {}
|
||||||
|
func (*EthPayload) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_59afed779274eaf0, []int{2}
|
||||||
|
}
|
||||||
|
func (m *EthPayload) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *EthPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_EthPayload.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 *EthPayload) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_EthPayload.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *EthPayload) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *EthPayload) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_EthPayload.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_EthPayload proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *EthPayload) GetAddress() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Address
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EthPayload) GetMsg() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Msg
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*Params)(nil), "cerc.onboarding.v1.Params")
|
||||||
|
proto.RegisterType((*Participant)(nil), "cerc.onboarding.v1.Participant")
|
||||||
|
proto.RegisterType((*EthPayload)(nil), "cerc.onboarding.v1.EthPayload")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterFile("cerc/onboarding/v1/onboarding.proto", fileDescriptor_59afed779274eaf0)
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileDescriptor_59afed779274eaf0 = []byte{
|
||||||
|
// 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) {
|
||||||
|
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 *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.OnboardingEnabled {
|
||||||
|
i--
|
||||||
|
if m.OnboardingEnabled {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Participant) 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 *Participant) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = 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)
|
||||||
|
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.NitroAddress)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
if len(m.CosmosAddress) > 0 {
|
||||||
|
i -= len(m.CosmosAddress)
|
||||||
|
copy(dAtA[i:], m.CosmosAddress)
|
||||||
|
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.CosmosAddress)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EthPayload) 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 *EthPayload) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EthPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Msg) > 0 {
|
||||||
|
i -= len(m.Msg)
|
||||||
|
copy(dAtA[i:], m.Msg)
|
||||||
|
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Msg)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
if len(m.Address) > 0 {
|
||||||
|
i -= len(m.Address)
|
||||||
|
copy(dAtA[i:], m.Address)
|
||||||
|
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Address)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintOnboarding(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovOnboarding(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *Params) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.OnboardingEnabled {
|
||||||
|
n += 2
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Participant) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.CosmosAddress)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovOnboarding(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.NitroAddress)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EthPayload) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Address)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovOnboarding(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Msg)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovOnboarding(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovOnboarding(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozOnboarding(x uint64) (n int) {
|
||||||
|
return sovOnboarding(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *Params) 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 ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
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: Params: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field OnboardingEnabled", wireType)
|
||||||
|
}
|
||||||
|
var v int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
v |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.OnboardingEnabled = bool(v != 0)
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipOnboarding(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthOnboarding
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *Participant) 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 ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
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: Participant: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Participant: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field CosmosAddress", 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.CosmosAddress = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
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 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.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:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthOnboarding
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *EthPayload) 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 ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
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: EthPayload: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: EthPayload: 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 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.Address = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Msg", 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.Msg = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipOnboarding(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthOnboarding
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipOnboarding(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowOnboarding
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthOnboarding
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupOnboarding
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthOnboarding
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthOnboarding = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowOnboarding = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupOnboarding = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package onboarding
|
||||||
|
|
||||||
|
// DefaultParams returns default module parameters.
|
||||||
|
func DefaultParams() Params {
|
||||||
|
return Params{
|
||||||
|
// Set default values here.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate does the sanity check on the params.
|
||||||
|
func (p Params) Validate() error {
|
||||||
|
// Sanity check goes here.
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user