mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
feat(macaroon): add transaction allowlist/denylist caveats
This commit is contained in:
parent
8ac1ccaa34
commit
c3e8fcc3d3
@ -6,6 +6,7 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
_ "github.com/onsonr/sonr/api/did/v1"
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
@ -2734,6 +2735,610 @@ func (x *fastReflection_Caveats) ProtoMethods() *protoiface.Methods {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.List = (*_Transactions_1_list)(nil)
|
||||||
|
|
||||||
|
type _Transactions_1_list struct {
|
||||||
|
list *[]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) Len() int {
|
||||||
|
if x.list == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return len(*x.list)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) Get(i int) protoreflect.Value {
|
||||||
|
return protoreflect.ValueOfString((*x.list)[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) Set(i int, value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.String()
|
||||||
|
concreteValue := valueUnwrapped
|
||||||
|
(*x.list)[i] = concreteValue
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) Append(value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.String()
|
||||||
|
concreteValue := valueUnwrapped
|
||||||
|
*x.list = append(*x.list, concreteValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) AppendMutable() protoreflect.Value {
|
||||||
|
panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Allowlist as it is not of Message kind"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) Truncate(n int) {
|
||||||
|
*x.list = (*x.list)[:n]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) NewElement() protoreflect.Value {
|
||||||
|
v := ""
|
||||||
|
return protoreflect.ValueOfString(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_1_list) IsValid() bool {
|
||||||
|
return x.list != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.List = (*_Transactions_2_list)(nil)
|
||||||
|
|
||||||
|
type _Transactions_2_list struct {
|
||||||
|
list *[]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) Len() int {
|
||||||
|
if x.list == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return len(*x.list)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) Get(i int) protoreflect.Value {
|
||||||
|
return protoreflect.ValueOfString((*x.list)[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) Set(i int, value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.String()
|
||||||
|
concreteValue := valueUnwrapped
|
||||||
|
(*x.list)[i] = concreteValue
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) Append(value protoreflect.Value) {
|
||||||
|
valueUnwrapped := value.String()
|
||||||
|
concreteValue := valueUnwrapped
|
||||||
|
*x.list = append(*x.list, concreteValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) AppendMutable() protoreflect.Value {
|
||||||
|
panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Denylist as it is not of Message kind"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) Truncate(n int) {
|
||||||
|
*x.list = (*x.list)[:n]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) NewElement() protoreflect.Value {
|
||||||
|
v := ""
|
||||||
|
return protoreflect.ValueOfString(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *_Transactions_2_list) IsValid() bool {
|
||||||
|
return x.list != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
md_Transactions protoreflect.MessageDescriptor
|
||||||
|
fd_Transactions_allowlist protoreflect.FieldDescriptor
|
||||||
|
fd_Transactions_denylist protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_macaroon_v1_genesis_proto_init()
|
||||||
|
md_Transactions = File_macaroon_v1_genesis_proto.Messages().ByName("Transactions")
|
||||||
|
fd_Transactions_allowlist = md_Transactions.Fields().ByName("allowlist")
|
||||||
|
fd_Transactions_denylist = md_Transactions.Fields().ByName("denylist")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_Transactions)(nil)
|
||||||
|
|
||||||
|
type fastReflection_Transactions Transactions
|
||||||
|
|
||||||
|
func (x *Transactions) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_Transactions)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Transactions) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_macaroon_v1_genesis_proto_msgTypes[5]
|
||||||
|
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_Transactions_messageType fastReflection_Transactions_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_Transactions_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_Transactions_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_Transactions_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_Transactions)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Transactions_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Transactions)
|
||||||
|
}
|
||||||
|
func (x fastReflection_Transactions_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Transactions
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_Transactions) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_Transactions
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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_Transactions) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_Transactions_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_Transactions) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_Transactions)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_Transactions) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*Transactions)(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_Transactions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||||
|
if len(x.Allowlist) != 0 {
|
||||||
|
value := protoreflect.ValueOfList(&_Transactions_1_list{list: &x.Allowlist})
|
||||||
|
if !f(fd_Transactions_allowlist, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(x.Denylist) != 0 {
|
||||||
|
value := protoreflect.ValueOfList(&_Transactions_2_list{list: &x.Denylist})
|
||||||
|
if !f(fd_Transactions_denylist, 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_Transactions) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
return len(x.Allowlist) != 0
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
return len(x.Denylist) != 0
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
x.Allowlist = nil
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
x.Denylist = nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch descriptor.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
if len(x.Allowlist) == 0 {
|
||||||
|
return protoreflect.ValueOfList(&_Transactions_1_list{})
|
||||||
|
}
|
||||||
|
listValue := &_Transactions_1_list{list: &x.Allowlist}
|
||||||
|
return protoreflect.ValueOfList(listValue)
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
if len(x.Denylist) == 0 {
|
||||||
|
return protoreflect.ValueOfList(&_Transactions_2_list{})
|
||||||
|
}
|
||||||
|
listValue := &_Transactions_2_list{list: &x.Denylist}
|
||||||
|
return protoreflect.ValueOfList(listValue)
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
lv := value.List()
|
||||||
|
clv := lv.(*_Transactions_1_list)
|
||||||
|
x.Allowlist = *clv.list
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
lv := value.List()
|
||||||
|
clv := lv.(*_Transactions_2_list)
|
||||||
|
x.Denylist = *clv.list
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
if x.Allowlist == nil {
|
||||||
|
x.Allowlist = []string{}
|
||||||
|
}
|
||||||
|
value := &_Transactions_1_list{list: &x.Allowlist}
|
||||||
|
return protoreflect.ValueOfList(value)
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
if x.Denylist == nil {
|
||||||
|
x.Denylist = []string{}
|
||||||
|
}
|
||||||
|
value := &_Transactions_2_list{list: &x.Denylist}
|
||||||
|
return protoreflect.ValueOfList(value)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.Transactions.allowlist":
|
||||||
|
list := []string{}
|
||||||
|
return protoreflect.ValueOfList(&_Transactions_1_list{list: &list})
|
||||||
|
case "macaroon.v1.Transactions.denylist":
|
||||||
|
list := []string{}
|
||||||
|
return protoreflect.ValueOfList(&_Transactions_2_list{list: &list})
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in macaroon.v1.Transactions", 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_Transactions) 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_Transactions) 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_Transactions) 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_Transactions) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*Transactions)
|
||||||
|
if x == nil {
|
||||||
|
return protoiface.SizeOutput{
|
||||||
|
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||||
|
Size: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options := runtime.SizeInputToOptions(input)
|
||||||
|
_ = options
|
||||||
|
var n int
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(x.Allowlist) > 0 {
|
||||||
|
for _, s := range x.Allowlist {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(x.Denylist) > 0 {
|
||||||
|
for _, s := range x.Denylist {
|
||||||
|
l = len(s)
|
||||||
|
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().(*Transactions)
|
||||||
|
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.Denylist) > 0 {
|
||||||
|
for iNdEx := len(x.Denylist) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(x.Denylist[iNdEx])
|
||||||
|
copy(dAtA[i:], x.Denylist[iNdEx])
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denylist[iNdEx])))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(x.Allowlist) > 0 {
|
||||||
|
for iNdEx := len(x.Allowlist) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(x.Allowlist[iNdEx])
|
||||||
|
copy(dAtA[i:], x.Allowlist[iNdEx])
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Allowlist[iNdEx])))
|
||||||
|
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().(*Transactions)
|
||||||
|
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: Transactions: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Transactions: 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 Allowlist", 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.Allowlist = append(x.Allowlist, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denylist", 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.Denylist = append(x.Denylist, 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.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.27.0
|
// protoc-gen-go v1.27.0
|
||||||
@ -2971,6 +3576,51 @@ func (x *Caveats) GetSupportedThirdParty() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transactions defines the allowlist,denylist for transactions which can be
|
||||||
|
// broadcasted to the network with the Sonr DWN Signed macaroon.
|
||||||
|
type Transactions struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"`
|
||||||
|
Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Transactions) Reset() {
|
||||||
|
*x = Transactions{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_macaroon_v1_genesis_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Transactions) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Transactions) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use Transactions.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Transactions) Descriptor() ([]byte, []int) {
|
||||||
|
return file_macaroon_v1_genesis_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Transactions) GetAllowlist() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Allowlist
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Transactions) GetDenylist() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Denylist
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_macaroon_v1_genesis_proto protoreflect.FileDescriptor
|
var File_macaroon_v1_genesis_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_macaroon_v1_genesis_proto_rawDesc = []byte{
|
var file_macaroon_v1_genesis_proto_rawDesc = []byte{
|
||||||
@ -2979,53 +3629,61 @@ var file_macaroon_v1_genesis_proto_rawDesc = []byte{
|
|||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f,
|
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f,
|
||||||
0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67,
|
0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67,
|
||||||
0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74,
|
0x6f, 0x1a, 0x0f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x74, 0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61,
|
||||||
0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
|
0x74, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61,
|
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
||||||
0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12,
|
0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70,
|
||||||
0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
||||||
0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
|
0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12,
|
0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
|
||||||
0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73,
|
||||||
0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63,
|
0x12, 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x07,
|
0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53,
|
||||||
0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a,
|
||||||
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65,
|
0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
|
||||||
0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98, 0xa0,
|
0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76,
|
||||||
0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
0x65, 0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98,
|
||||||
0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d, 0x65,
|
0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61,
|
||||||
0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12,
|
0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||||
0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03,
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||||
0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19, 0xe8,
|
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20,
|
||||||
0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19,
|
||||||
0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f, 0x70,
|
0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||||
0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f,
|
||||||
0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,
|
0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
||||||
0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d,
|
0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70,
|
||||||
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8b,
|
0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f,
|
||||||
0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x75,
|
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22,
|
||||||
0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, 0x61,
|
0x8c, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73,
|
||||||
0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, 0x6f,
|
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70,
|
||||||
0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, 0x32,
|
0x61, 0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70,
|
||||||
0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, 0x72,
|
0x6f, 0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12,
|
||||||
0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73,
|
0x32, 0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69,
|
||||||
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72,
|
0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13,
|
||||||
0x74, 0x79, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63,
|
0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61,
|
||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x42, 0x9f, 0x01, 0x0a,
|
0x72, 0x74, 0x79, 0x3a, 0x19, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61,
|
||||||
0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x22, 0x68,
|
||||||
0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c,
|
||||||
0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73,
|
0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||||
0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63,
|
0x09, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08,
|
||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08,
|
||||||
0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61,
|
0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x1e, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7,
|
||||||
0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
0xb0, 0x2a, 0x15, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e,
|
||||||
0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x9f, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
|
||||||
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65,
|
||||||
0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
|
0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f,
|
||||||
|
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f,
|
||||||
|
0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2,
|
||||||
|
0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||||
|
0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56,
|
||||||
|
0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c,
|
||||||
|
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61,
|
||||||
|
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -3040,13 +3698,14 @@ func file_macaroon_v1_genesis_proto_rawDescGZIP() []byte {
|
|||||||
return file_macaroon_v1_genesis_proto_rawDescData
|
return file_macaroon_v1_genesis_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_macaroon_v1_genesis_proto_goTypes = []interface{}{
|
var file_macaroon_v1_genesis_proto_goTypes = []interface{}{
|
||||||
(*GenesisState)(nil), // 0: macaroon.v1.GenesisState
|
(*GenesisState)(nil), // 0: macaroon.v1.GenesisState
|
||||||
(*Params)(nil), // 1: macaroon.v1.Params
|
(*Params)(nil), // 1: macaroon.v1.Params
|
||||||
(*Methods)(nil), // 2: macaroon.v1.Methods
|
(*Methods)(nil), // 2: macaroon.v1.Methods
|
||||||
(*Scopes)(nil), // 3: macaroon.v1.Scopes
|
(*Scopes)(nil), // 3: macaroon.v1.Scopes
|
||||||
(*Caveats)(nil), // 4: macaroon.v1.Caveats
|
(*Caveats)(nil), // 4: macaroon.v1.Caveats
|
||||||
|
(*Transactions)(nil), // 5: macaroon.v1.Transactions
|
||||||
}
|
}
|
||||||
var file_macaroon_v1_genesis_proto_depIdxs = []int32{
|
var file_macaroon_v1_genesis_proto_depIdxs = []int32{
|
||||||
1, // 0: macaroon.v1.GenesisState.params:type_name -> macaroon.v1.Params
|
1, // 0: macaroon.v1.GenesisState.params:type_name -> macaroon.v1.Params
|
||||||
@ -3126,6 +3785,18 @@ func file_macaroon_v1_genesis_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_macaroon_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Transactions); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@ -3133,7 +3804,7 @@ func file_macaroon_v1_genesis_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_macaroon_v1_genesis_proto_rawDesc,
|
RawDescriptor: file_macaroon_v1_genesis_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 5,
|
NumMessages: 6,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
18
app/app.go
18
app/app.go
@ -151,9 +151,6 @@ import (
|
|||||||
macaroon "github.com/onsonr/sonr/x/macaroon"
|
macaroon "github.com/onsonr/sonr/x/macaroon"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
||||||
oracle "github.com/onsonr/sonr/x/oracle"
|
|
||||||
oraclekeeper "github.com/onsonr/sonr/x/oracle/keeper"
|
|
||||||
oracletypes "github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
service "github.com/onsonr/sonr/x/service"
|
service "github.com/onsonr/sonr/x/service"
|
||||||
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
||||||
servicetypes "github.com/onsonr/sonr/x/service/types"
|
servicetypes "github.com/onsonr/sonr/x/service/types"
|
||||||
@ -241,7 +238,6 @@ type SonrApp struct {
|
|||||||
VaultKeeper vaultkeeper.Keeper
|
VaultKeeper vaultkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
MacaroonKeeper macaroonkeeper.Keeper
|
||||||
ServiceKeeper servicekeeper.Keeper
|
ServiceKeeper servicekeeper.Keeper
|
||||||
OracleKeeper oraclekeeper.Keeper
|
|
||||||
sm *module.SimulationManager
|
sm *module.SimulationManager
|
||||||
BasicModuleManager module.BasicManager
|
BasicModuleManager module.BasicManager
|
||||||
ModuleManager *module.Manager
|
ModuleManager *module.Manager
|
||||||
@ -377,7 +373,6 @@ func NewChainApp(
|
|||||||
vaulttypes.StoreKey,
|
vaulttypes.StoreKey,
|
||||||
macaroontypes.StoreKey,
|
macaroontypes.StoreKey,
|
||||||
servicetypes.StoreKey,
|
servicetypes.StoreKey,
|
||||||
oracletypes.StoreKey,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
||||||
@ -668,14 +663,6 @@ func NewChainApp(
|
|||||||
app.NFTKeeper,
|
app.NFTKeeper,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the oracle Keeper
|
|
||||||
app.OracleKeeper = oraclekeeper.NewKeeper(
|
|
||||||
appCodec,
|
|
||||||
sdkruntime.NewKVStoreService(keys[oracletypes.StoreKey]),
|
|
||||||
logger,
|
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create the globalfee keeper
|
// Create the globalfee keeper
|
||||||
app.GlobalFeeKeeper = globalfeekeeper.NewKeeper(
|
app.GlobalFeeKeeper = globalfeekeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
@ -938,7 +925,6 @@ func NewChainApp(
|
|||||||
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
||||||
|
|
||||||
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper),
|
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper),
|
||||||
oracle.NewAppModule(appCodec, app.OracleKeeper, app.DidKeeper, app.MacaroonKeeper),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
||||||
@ -990,7 +976,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
app.ModuleManager.SetOrderEndBlockers(
|
app.ModuleManager.SetOrderEndBlockers(
|
||||||
@ -1013,7 +998,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NOTE: The genutils module must occur after staking so that pools are
|
// NOTE: The genutils module must occur after staking so that pools are
|
||||||
@ -1045,7 +1029,6 @@ func NewChainApp(
|
|||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
macaroontypes.ModuleName,
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
oracletypes.ModuleName,
|
|
||||||
}
|
}
|
||||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||||
@ -1508,7 +1491,6 @@ func initParamsKeeper(
|
|||||||
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
||||||
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
||||||
paramsKeeper.Subspace(servicetypes.ModuleName)
|
paramsKeeper.Subspace(servicetypes.ModuleName)
|
||||||
paramsKeeper.Subspace(oracletypes.ModuleName)
|
|
||||||
|
|
||||||
return paramsKeeper
|
return paramsKeeper
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package macaroon.v1;
|
|||||||
|
|
||||||
import "amino/amino.proto";
|
import "amino/amino.proto";
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
|
import "did/v1/tx.proto";
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
||||||
|
|
||||||
@ -46,9 +47,19 @@ message Scopes {
|
|||||||
|
|
||||||
// Caveats defines the available caveats
|
// Caveats defines the available caveats
|
||||||
message Caveats {
|
message Caveats {
|
||||||
option (amino.name) = "macaroon/caveat";
|
option (amino.name) = "macaroon/caveats";
|
||||||
option (gogoproto.equal) = true;
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
repeated string supported_first_party = 1;
|
repeated string supported_first_party = 1;
|
||||||
repeated string supported_third_party = 2;
|
repeated string supported_third_party = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transactions defines the allowlist,denylist for transactions which can be
|
||||||
|
// broadcasted to the network with the Sonr DWN Signed macaroon.
|
||||||
|
message Transactions {
|
||||||
|
option (amino.name) = "macaroon/transactions";
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
|
repeated string allowlist = 1;
|
||||||
|
repeated string denylist = 2;
|
||||||
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package oracle.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 : "github.com/onsonr/sonr"
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package oracle.v1;
|
|
||||||
|
|
||||||
import "amino/amino.proto";
|
|
||||||
import "gogoproto/gogo.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/oracle/types";
|
|
||||||
|
|
||||||
// GenesisState defines the module genesis state
|
|
||||||
message GenesisState {
|
|
||||||
// Params defines all the parameters of the module.
|
|
||||||
Params params = 1 [(gogoproto.nullable) = false];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Params defines the set of module parameters.
|
|
||||||
message Params {
|
|
||||||
option (amino.name) = "oracle/params";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
option (gogoproto.goproto_stringer) = false;
|
|
||||||
|
|
||||||
Assets assets = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Assets {
|
|
||||||
option (amino.name) = "oracle/assets";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
|
|
||||||
repeated AssetInfo assets = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// AssetInfo defines the asset info
|
|
||||||
message AssetInfo {
|
|
||||||
option (amino.name) = "oracle/asset_info";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
|
|
||||||
// The coin type index for bip44 path
|
|
||||||
int64 index = 1;
|
|
||||||
|
|
||||||
// The hrp for bech32 address
|
|
||||||
string hrp = 2;
|
|
||||||
|
|
||||||
// The coin symbol
|
|
||||||
string symbol = 3;
|
|
||||||
|
|
||||||
// The coin name
|
|
||||||
string asset_type = 4;
|
|
||||||
|
|
||||||
// The name of the asset
|
|
||||||
string name = 5;
|
|
||||||
|
|
||||||
// The icon url
|
|
||||||
string icon_url = 6;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package oracle.v1;
|
|
||||||
|
|
||||||
import "google/api/annotations.proto";
|
|
||||||
import "oracle/v1/genesis.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/oracle/types";
|
|
||||||
|
|
||||||
// Query provides defines the gRPC querier service.
|
|
||||||
service Query {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
||||||
option (google.api.http).get = "/oracle/v1/params";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
|
||||||
message QueryParamsRequest {}
|
|
||||||
|
|
||||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
||||||
message QueryParamsResponse {
|
|
||||||
// params defines the parameters of the module.
|
|
||||||
Params params = 1;
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package oracle.v1;
|
|
||||||
|
|
||||||
import "cosmos/orm/v1/orm.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/oracle/types";
|
|
||||||
|
|
||||||
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
|
|
||||||
|
|
||||||
message Balance {
|
|
||||||
option (cosmos.orm.v1.table) = {
|
|
||||||
id: 1
|
|
||||||
primary_key: {fields: "account"}
|
|
||||||
index: {
|
|
||||||
id: 1
|
|
||||||
fields: "amount"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
string account = 1;
|
|
||||||
uint64 amount = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Account {
|
|
||||||
option (cosmos.orm.v1.table) = {
|
|
||||||
id: 2
|
|
||||||
primary_key: {fields: "id"}
|
|
||||||
index: {
|
|
||||||
id: 1
|
|
||||||
fields: "address,chain,network"
|
|
||||||
unique: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
uint64 id = 1;
|
|
||||||
string address = 2;
|
|
||||||
string chain = 3;
|
|
||||||
string network = 4;
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package oracle.v1;
|
|
||||||
|
|
||||||
import "cosmos/msg/v1/msg.proto";
|
|
||||||
import "oracle/v1/genesis.proto";
|
|
||||||
import "gogoproto/gogo.proto";
|
|
||||||
import "cosmos_proto/cosmos.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/oracle/types";
|
|
||||||
|
|
||||||
// Msg defines the Msg service.
|
|
||||||
service Msg {
|
|
||||||
option (cosmos.msg.v1.service) = true;
|
|
||||||
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
message MsgUpdateParams {
|
|
||||||
option (cosmos.msg.v1.signer) = "authority";
|
|
||||||
|
|
||||||
// authority is the address of the governance account.
|
|
||||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
||||||
|
|
||||||
// params defines the 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.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
message MsgUpdateParamsResponse {}
|
|
@ -8,6 +8,7 @@ import (
|
|||||||
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
|
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
|
||||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
_ "github.com/onsonr/sonr/x/did/types"
|
||||||
io "io"
|
io "io"
|
||||||
math "math"
|
math "math"
|
||||||
math_bits "math/bits"
|
math_bits "math/bits"
|
||||||
@ -292,44 +293,103 @@ func (m *Caveats) GetSupportedThirdParty() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transactions defines the allowlist,denylist for transactions which can be
|
||||||
|
// broadcasted to the network with the Sonr DWN Signed macaroon.
|
||||||
|
type Transactions struct {
|
||||||
|
Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"`
|
||||||
|
Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Transactions) Reset() { *m = Transactions{} }
|
||||||
|
func (m *Transactions) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Transactions) ProtoMessage() {}
|
||||||
|
func (*Transactions) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_06e0b5dfdf5e52ba, []int{5}
|
||||||
|
}
|
||||||
|
func (m *Transactions) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Transactions.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 *Transactions) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Transactions.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Transactions) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Transactions) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Transactions.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Transactions proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Transactions) GetAllowlist() []string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Allowlist
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Transactions) GetDenylist() []string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Denylist
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState")
|
proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState")
|
||||||
proto.RegisterType((*Params)(nil), "macaroon.v1.Params")
|
proto.RegisterType((*Params)(nil), "macaroon.v1.Params")
|
||||||
proto.RegisterType((*Methods)(nil), "macaroon.v1.Methods")
|
proto.RegisterType((*Methods)(nil), "macaroon.v1.Methods")
|
||||||
proto.RegisterType((*Scopes)(nil), "macaroon.v1.Scopes")
|
proto.RegisterType((*Scopes)(nil), "macaroon.v1.Scopes")
|
||||||
proto.RegisterType((*Caveats)(nil), "macaroon.v1.Caveats")
|
proto.RegisterType((*Caveats)(nil), "macaroon.v1.Caveats")
|
||||||
|
proto.RegisterType((*Transactions)(nil), "macaroon.v1.Transactions")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
|
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
|
||||||
|
|
||||||
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
|
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
|
||||||
// 414 bytes of a gzipped FileDescriptorProto
|
// 470 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0xcb, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x6a, 0xdb, 0x30,
|
||||||
0x18, 0xc7, 0x9b, 0xbd, 0x2f, 0x2d, 0xcb, 0x2b, 0xa8, 0xd9, 0x84, 0x6e, 0x8c, 0x6e, 0xf4, 0xe2,
|
0x18, 0xc7, 0xad, 0xb4, 0x38, 0x8b, 0x5a, 0xe8, 0xa6, 0xb6, 0xe0, 0x86, 0xe2, 0x14, 0x5f, 0x56,
|
||||||
0x50, 0x68, 0xd9, 0xbc, 0xed, 0xb6, 0x09, 0x7a, 0x12, 0x46, 0xb7, 0x93, 0x08, 0x23, 0x6b, 0xb3,
|
0x36, 0xb0, 0x49, 0x77, 0xcb, 0xad, 0x1d, 0x6c, 0xa7, 0x41, 0x71, 0x73, 0x1a, 0x83, 0xa2, 0xd8,
|
||||||
0xae, 0x60, 0x9b, 0x92, 0x64, 0xc3, 0x7d, 0x05, 0xbd, 0x78, 0xf4, 0xb8, 0x8f, 0x20, 0xf8, 0x25,
|
0xaa, 0x2d, 0xb0, 0x25, 0x23, 0x29, 0x59, 0xf3, 0x0a, 0x63, 0x87, 0x1d, 0x77, 0xec, 0x23, 0x0c,
|
||||||
0x76, 0xdc, 0xd1, 0x93, 0xc8, 0x76, 0xd0, 0x8f, 0x21, 0x4d, 0xd2, 0xea, 0x74, 0xe0, 0x25, 0x3c,
|
0xf6, 0x12, 0x3d, 0xf6, 0xb8, 0xd3, 0x18, 0xc9, 0x61, 0x7b, 0x8c, 0x61, 0x49, 0x76, 0xda, 0x2d,
|
||||||
0xcd, 0xef, 0xf9, 0xff, 0xfb, 0x7f, 0x1e, 0x02, 0x5b, 0x29, 0x0e, 0x31, 0xa3, 0x34, 0xf3, 0xb7,
|
0xd0, 0x8b, 0x91, 0xbe, 0xdf, 0xf7, 0xff, 0x7f, 0xff, 0x4f, 0x18, 0x1e, 0x94, 0x38, 0xc1, 0x82,
|
||||||
0x03, 0x3f, 0x26, 0x19, 0xe1, 0x09, 0xf7, 0x72, 0x46, 0x05, 0x45, 0x77, 0x25, 0xf2, 0xb6, 0x83,
|
0x73, 0x16, 0xcd, 0x86, 0x51, 0x46, 0x18, 0x91, 0x54, 0x86, 0x95, 0xe0, 0x8a, 0xa3, 0xad, 0x06,
|
||||||
0xf6, 0x43, 0x9c, 0x26, 0x19, 0xf5, 0xe5, 0xa9, 0x78, 0xbb, 0x19, 0xd3, 0x98, 0xca, 0xd2, 0x2f,
|
0x85, 0xb3, 0x61, 0xff, 0x19, 0x2e, 0x29, 0xe3, 0x91, 0xfe, 0x1a, 0xde, 0xdf, 0xcb, 0x78, 0xc6,
|
||||||
0x2a, 0x75, 0xeb, 0x8e, 0xe1, 0xbd, 0x97, 0xca, 0x66, 0x26, 0xb0, 0x20, 0x68, 0x00, 0xcd, 0x1c,
|
0xf5, 0x31, 0xaa, 0x4f, 0xb6, 0xba, 0x93, 0xd2, 0xb4, 0xf6, 0x52, 0xd7, 0xa6, 0x10, 0x9c, 0xc2,
|
||||||
0x33, 0x9c, 0x72, 0x1b, 0xf4, 0x40, 0xff, 0x6e, 0xd8, 0xf0, 0xfe, 0xb0, 0xf5, 0xa6, 0x12, 0x4d,
|
0xed, 0xb7, 0xc6, 0xf7, 0x42, 0x61, 0x45, 0xd0, 0x10, 0xba, 0x15, 0x16, 0xb8, 0x94, 0x1e, 0x38,
|
||||||
0x6e, 0x0f, 0xdf, 0xba, 0x46, 0xa0, 0x1b, 0xdd, 0x2f, 0x00, 0x9a, 0x0a, 0x20, 0x0f, 0x5a, 0x29,
|
0x02, 0xc7, 0x5b, 0x27, 0xbb, 0xe1, 0xbd, 0x39, 0xe1, 0xb9, 0x46, 0x67, 0x9b, 0xb7, 0x3f, 0x07,
|
||||||
0x11, 0x6b, 0x1a, 0x95, 0xf2, 0xe6, 0x85, 0xfc, 0x95, 0x62, 0x41, 0xd9, 0x84, 0x9e, 0x42, 0x93,
|
0x4e, 0x6c, 0x1b, 0x83, 0xef, 0x00, 0xba, 0x06, 0xa0, 0x10, 0x76, 0x4b, 0xa2, 0x72, 0x9e, 0x36,
|
||||||
0x87, 0x34, 0x27, 0xdc, 0xae, 0x5d, 0xf9, 0xdb, 0x4c, 0xa2, 0x40, 0xb7, 0x14, 0xe6, 0x21, 0xde,
|
0xf2, 0xbd, 0x07, 0xf2, 0x77, 0x86, 0xc5, 0x4d, 0x13, 0x7a, 0x09, 0x5d, 0x99, 0xf0, 0x8a, 0x48,
|
||||||
0x12, 0x2c, 0xb8, 0x7d, 0x73, 0xc5, 0xfc, 0xb9, 0x62, 0x41, 0xd9, 0x34, 0xea, 0x7c, 0xda, 0x77,
|
0xaf, 0xb3, 0x66, 0xda, 0x85, 0x46, 0xb1, 0x6d, 0xa9, 0xcd, 0x13, 0x3c, 0x23, 0x58, 0x49, 0x6f,
|
||||||
0x8d, 0x9f, 0xfb, 0x2e, 0x78, 0xff, 0xe3, 0xf3, 0x93, 0xfb, 0xd5, 0xe2, 0x74, 0xea, 0x37, 0xd0,
|
0x63, 0x8d, 0xf9, 0x6b, 0xc3, 0xe2, 0xa6, 0x69, 0x74, 0xf8, 0xf5, 0x66, 0xe0, 0xfc, 0xb9, 0x19,
|
||||||
0xd2, 0x71, 0x90, 0x0d, 0xad, 0x88, 0xac, 0xf0, 0xe6, 0xad, 0x90, 0xa9, 0xeb, 0x41, 0xf9, 0x89,
|
0x80, 0x4f, 0xbf, 0xbf, 0xbd, 0xd8, 0x69, 0x5f, 0xd2, 0xa6, 0xfe, 0x00, 0xbb, 0x36, 0x0e, 0xf2,
|
||||||
0x3a, 0xb0, 0xce, 0x37, 0x79, 0x4e, 0x99, 0x20, 0x91, 0x5d, 0xeb, 0xdd, 0xf4, 0xeb, 0xc1, 0xef,
|
0x60, 0x37, 0x25, 0x57, 0x78, 0x5a, 0x28, 0x9d, 0xba, 0x17, 0x37, 0x57, 0x74, 0x08, 0x7b, 0x72,
|
||||||
0x8b, 0x51, 0xab, 0x34, 0x7f, 0x50, 0x99, 0xeb, 0xc1, 0xdc, 0x39, 0x34, 0x55, 0x7a, 0x84, 0xe0,
|
0x5a, 0x55, 0x5c, 0x28, 0x92, 0x7a, 0x9d, 0xa3, 0x8d, 0xe3, 0x5e, 0xbc, 0x2a, 0x8c, 0x0e, 0x1a,
|
||||||
0xed, 0x12, 0x73, 0xa2, 0x9d, 0x65, 0xfd, 0x1f, 0x5b, 0xfb, 0xdf, 0xcc, 0x6a, 0x03, 0xee, 0x07,
|
0xf3, 0xa7, 0xad, 0xb9, 0x5d, 0x2c, 0x18, 0x43, 0xd7, 0xa4, 0x47, 0x08, 0x6e, 0x4e, 0xb0, 0x24,
|
||||||
0x00, 0x2d, 0x3d, 0x26, 0x1a, 0xc2, 0x47, 0x95, 0x64, 0xb1, 0x4a, 0x18, 0x17, 0x8b, 0x1c, 0x33,
|
0xd6, 0x59, 0x9f, 0x1f, 0xb1, 0xf5, 0xfe, 0xcf, 0x6c, 0x5e, 0x20, 0xf8, 0x0c, 0x60, 0xd7, 0xae,
|
||||||
0xb1, 0xb3, 0x81, 0xf4, 0x6b, 0x54, 0xf0, 0x45, 0xc1, 0xa6, 0x05, 0xba, 0xd4, 0x88, 0x75, 0xc2,
|
0x89, 0x4e, 0xe0, 0x7e, 0x2b, 0xb9, 0xbc, 0xa2, 0x42, 0xaa, 0xcb, 0x0a, 0x0b, 0x35, 0xf7, 0x80,
|
||||||
0x22, 0xad, 0xa9, 0xfd, 0xa5, 0x99, 0x17, 0x4c, 0x6a, 0xae, 0xa5, 0x51, 0x0b, 0x9e, 0x8c, 0x0f,
|
0xf6, 0xdb, 0x6d, 0xe1, 0x9b, 0x9a, 0x9d, 0xd7, 0xe8, 0xa1, 0x46, 0xe5, 0x54, 0xa4, 0x56, 0xd3,
|
||||||
0x27, 0x07, 0x1c, 0x4f, 0x0e, 0xf8, 0x7e, 0x72, 0xc0, 0xc7, 0xb3, 0x63, 0x1c, 0xcf, 0x8e, 0xf1,
|
0xf9, 0x47, 0x33, 0xae, 0x99, 0xd6, 0xac, 0x5b, 0xd2, 0x3e, 0x70, 0x90, 0xc3, 0xed, 0xb1, 0xc0,
|
||||||
0xf5, 0xec, 0x18, 0xaf, 0x1f, 0xc7, 0x89, 0x58, 0x6f, 0x96, 0x5e, 0x48, 0x53, 0x9f, 0x66, 0x9c,
|
0x4c, 0xe2, 0x44, 0x51, 0xce, 0x64, 0xbd, 0x16, 0x2e, 0x0a, 0xfe, 0xb1, 0xa0, 0x52, 0xd9, 0x18,
|
||||||
0x66, 0xcc, 0x97, 0xc7, 0x3b, 0xbf, 0xf2, 0x10, 0xbb, 0x9c, 0xf0, 0xa5, 0x29, 0x1f, 0xe1, 0xb3,
|
0xab, 0x02, 0xea, 0xc3, 0x27, 0x29, 0x61, 0x73, 0x0d, 0xcd, 0xbc, 0xf6, 0x3e, 0xf2, 0x9b, 0x21,
|
||||||
0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xa6, 0x33, 0x5b, 0xd7, 0x02, 0x00, 0x00,
|
0xfb, 0xed, 0x10, 0x75, 0xcf, 0xf9, 0xec, 0xf4, 0x76, 0xe1, 0x83, 0xbb, 0x85, 0x0f, 0x7e, 0x2d,
|
||||||
|
0x7c, 0xf0, 0x65, 0xe9, 0x3b, 0x77, 0x4b, 0xdf, 0xf9, 0xb1, 0xf4, 0x9d, 0xf7, 0xcf, 0x33, 0xaa,
|
||||||
|
0xf2, 0xe9, 0x24, 0x4c, 0x78, 0x19, 0x71, 0x26, 0x39, 0x13, 0x91, 0xfe, 0x5c, 0x47, 0x2b, 0xa7,
|
||||||
|
0x79, 0x45, 0xe4, 0xc4, 0xd5, 0xff, 0xfb, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x19, 0xb5,
|
||||||
|
0x2c, 0xe7, 0x53, 0x03, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Params) Equal(that interface{}) bool {
|
func (this *Params) Equal(that interface{}) bool {
|
||||||
@ -463,6 +523,43 @@ func (this *Caveats) Equal(that interface{}) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
func (this *Transactions) Equal(that interface{}) bool {
|
||||||
|
if that == nil {
|
||||||
|
return this == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
that1, ok := that.(*Transactions)
|
||||||
|
if !ok {
|
||||||
|
that2, ok := that.(Transactions)
|
||||||
|
if ok {
|
||||||
|
that1 = &that2
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if that1 == nil {
|
||||||
|
return this == nil
|
||||||
|
} else if this == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if len(this.Allowlist) != len(that1.Allowlist) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for i := range this.Allowlist {
|
||||||
|
if this.Allowlist[i] != that1.Allowlist[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(this.Denylist) != len(that1.Denylist) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for i := range this.Denylist {
|
||||||
|
if this.Denylist[i] != that1.Denylist[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@ -674,6 +771,47 @@ func (m *Caveats) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Transactions) 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 *Transactions) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Transactions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Denylist) > 0 {
|
||||||
|
for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(m.Denylist[iNdEx])
|
||||||
|
copy(dAtA[i:], m.Denylist[iNdEx])
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denylist[iNdEx])))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Allowlist) > 0 {
|
||||||
|
for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
i -= len(m.Allowlist[iNdEx])
|
||||||
|
copy(dAtA[i:], m.Allowlist[iNdEx])
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Allowlist[iNdEx])))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||||
offset -= sovGenesis(v)
|
offset -= sovGenesis(v)
|
||||||
base := offset
|
base := offset
|
||||||
@ -776,6 +914,27 @@ func (m *Caveats) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Transactions) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Allowlist) > 0 {
|
||||||
|
for _, s := range m.Allowlist {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(m.Denylist) > 0 {
|
||||||
|
for _, s := range m.Denylist {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func sovGenesis(x uint64) (n int) {
|
func sovGenesis(x uint64) (n int) {
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
}
|
}
|
||||||
@ -1365,6 +1524,120 @@ func (m *Caveats) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *Transactions) 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: Transactions: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Transactions: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
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 ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex]))
|
||||||
|
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) {
|
func skipGenesis(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
# `x/oracle`
|
|
||||||
|
|
||||||
The Oracle module is responsible for collecting off-chain data and verifying its authenticity before submitting it to the blockchain. In this case,
|
|
||||||
the data is associated account balances for Ethereum/Bitcoin derived addresses.
|
|
||||||
|
|
||||||
## Concepts
|
|
||||||
|
|
||||||
## State
|
|
||||||
|
|
||||||
Specify and describe structures expected to marshalled into the store, and their keys
|
|
||||||
|
|
||||||
### Account State
|
|
||||||
|
|
||||||
The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key.
|
|
||||||
|
|
||||||
### Credential State
|
|
||||||
|
|
||||||
The Credential state includes the claims about a subject and is stored using the credential ID as the key.
|
|
||||||
|
|
||||||
## State Transitions
|
|
||||||
|
|
||||||
Standard state transition operations triggered by hooks, messages, etc.
|
|
||||||
|
|
||||||
## Messages
|
|
||||||
|
|
||||||
Specify message structure(s) and expected state machine behaviour(s).
|
|
||||||
|
|
||||||
## Begin Block
|
|
||||||
|
|
||||||
Specify any begin-block operations.
|
|
||||||
|
|
||||||
## End Block
|
|
||||||
|
|
||||||
Specify any end-block operations.
|
|
||||||
|
|
||||||
## Hooks
|
|
||||||
|
|
||||||
Describe available hooks to be called by/from this module.
|
|
||||||
|
|
||||||
## Events
|
|
||||||
|
|
||||||
List and describe event tags used.
|
|
||||||
|
|
||||||
## Client
|
|
||||||
|
|
||||||
List and describe CLI commands and gRPC and REST endpoints.
|
|
||||||
|
|
||||||
## Params
|
|
||||||
|
|
||||||
List all module parameters, their types (in JSON) and identitys.
|
|
||||||
|
|
||||||
## Future Improvements
|
|
||||||
|
|
||||||
Describe future improvements of this module.
|
|
||||||
|
|
||||||
## Tests
|
|
||||||
|
|
||||||
Acceptance tests.
|
|
||||||
|
|
||||||
## Appendix
|
|
||||||
|
|
||||||
Supplementary details referenced elsewhere within the spec.
|
|
||||||
his is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
|
||||||
his is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
|
@ -1,31 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/oracle/v1"
|
|
||||||
)
|
|
||||||
|
|
||||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
|
||||||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|
||||||
return &autocliv1.ModuleOptions{
|
|
||||||
Query: &autocliv1.ServiceCommandDescriptor{
|
|
||||||
Service: modulev1.Query_ServiceDesc.ServiceName,
|
|
||||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
||||||
{
|
|
||||||
RpcMethod: "Params",
|
|
||||||
Use: "params",
|
|
||||||
Short: "Query the current consensus parameters",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Tx: &autocliv1.ServiceCommandDescriptor{
|
|
||||||
Service: modulev1.Msg_ServiceDesc.ServiceName,
|
|
||||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
||||||
{
|
|
||||||
RpcMethod: "UpdateParams",
|
|
||||||
Skip: false, // set to true if authority gated
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
package cli
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
|
||||||
|
|
||||||
func GetQueryCmd() *cobra.Command {
|
|
||||||
queryCmd := &cobra.Command{
|
|
||||||
Use: types.ModuleName,
|
|
||||||
Short: "Querying commands for " + types.ModuleName,
|
|
||||||
DisableFlagParsing: true,
|
|
||||||
SuggestionsMinimumDistance: 2,
|
|
||||||
RunE: client.ValidateCmd,
|
|
||||||
}
|
|
||||||
queryCmd.AddCommand(
|
|
||||||
GetCmdParams(),
|
|
||||||
)
|
|
||||||
return queryCmd
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetCmdParams() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "params",
|
|
||||||
Short: "Show all module params",
|
|
||||||
Args: cobra.ExactArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
clientCtx, err := client.GetClientQueryContext(cmd)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
queryClient := types.NewQueryClient(clientCtx)
|
|
||||||
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return clientCtx.PrintProto(res)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
flags.AddQueryFlagsToCmd(cmd)
|
|
||||||
return cmd
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
package cli
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
|
||||||
|
|
||||||
// NewTxCmd returns a root CLI command handler for certain modules
|
|
||||||
// transaction commands.
|
|
||||||
func NewTxCmd() *cobra.Command {
|
|
||||||
txCmd := &cobra.Command{
|
|
||||||
Use: types.ModuleName,
|
|
||||||
Short: types.ModuleName + " subcommands.",
|
|
||||||
DisableFlagParsing: true,
|
|
||||||
SuggestionsMinimumDistance: 2,
|
|
||||||
RunE: client.ValidateCmd,
|
|
||||||
}
|
|
||||||
|
|
||||||
txCmd.AddCommand(
|
|
||||||
MsgUpdateParams(),
|
|
||||||
)
|
|
||||||
return txCmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a CLI command handler for registering a
|
|
||||||
// contract for the module.
|
|
||||||
func MsgUpdateParams() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "update-params [some-value]",
|
|
||||||
Short: "Update the params (must be submitted from the authority)",
|
|
||||||
Args: cobra.ExactArgs(1),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
cliCtx, err := client.GetClientTxContext(cmd)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
senderAddress := cliCtx.GetFromAddress()
|
|
||||||
|
|
||||||
msg := &types.MsgUpdateParams{
|
|
||||||
Authority: senderAddress.String(),
|
|
||||||
Params: types.Params{},
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := msg.Validate(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
flags.AddTxFlagsToCmd(cmd)
|
|
||||||
return cmd
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"cosmossdk.io/core/address"
|
|
||||||
"cosmossdk.io/core/appmodule"
|
|
||||||
"cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/depinject"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
|
||||||
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/oracle/module/v1"
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/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
|
|
||||||
|
|
||||||
DidKeeper didkeeper.Keeper
|
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
|
||||||
StakingKeeper stakingkeeper.Keeper
|
|
||||||
SlashingKeeper slashingkeeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
type ModuleOutputs struct {
|
|
||||||
depinject.Out
|
|
||||||
|
|
||||||
Module appmodule.AppModule
|
|
||||||
Keeper keeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
|
||||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
|
|
||||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr)
|
|
||||||
m := NewAppModule(in.Cdc, k, in.DidKeeper, in.MacaroonKeeper)
|
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (k Keeper) Logger() log.Logger {
|
|
||||||
return k.logger
|
|
||||||
}
|
|
||||||
|
|
||||||
// InitGenesis initializes the module's state from a genesis state.
|
|
||||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
|
||||||
// this line is used by starport scaffolding # genesis/module/init
|
|
||||||
if err := data.Params.Validate(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return k.Params.Set(ctx, data.Params)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExportGenesis exports the module's state to a genesis state.
|
|
||||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
|
||||||
params, err := k.Params.Get(ctx)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/module/export
|
|
||||||
|
|
||||||
return &types.GenesisState{
|
|
||||||
Params: params,
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGenesis(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
|
|
||||||
genesisState := &types.GenesisState{
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/test/state
|
|
||||||
}
|
|
||||||
|
|
||||||
f.k.InitGenesis(f.ctx, genesisState)
|
|
||||||
|
|
||||||
got := f.k.ExportGenesis(f.ctx)
|
|
||||||
require.NotNil(t, got)
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/test/assert
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/collections"
|
|
||||||
storetypes "cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
"cosmossdk.io/orm/model/ormdb"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
|
|
||||||
apiv1 "github.com/onsonr/sonr/api/oracle/v1"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Keeper struct {
|
|
||||||
cdc codec.BinaryCodec
|
|
||||||
|
|
||||||
logger log.Logger
|
|
||||||
|
|
||||||
// state management
|
|
||||||
Schema collections.Schema
|
|
||||||
Params collections.Item[types.Params]
|
|
||||||
OrmDB apiv1.StateStore
|
|
||||||
|
|
||||||
authority string
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewKeeper creates a new Keeper instance
|
|
||||||
func NewKeeper(
|
|
||||||
cdc codec.BinaryCodec,
|
|
||||||
storeService storetypes.KVStoreService,
|
|
||||||
logger log.Logger,
|
|
||||||
authority string,
|
|
||||||
) Keeper {
|
|
||||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
|
||||||
|
|
||||||
sb := collections.NewSchemaBuilder(storeService)
|
|
||||||
|
|
||||||
if authority == "" {
|
|
||||||
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
}
|
|
||||||
|
|
||||||
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
store, err := apiv1.NewStateStore(db)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
k := Keeper{
|
|
||||||
cdc: cdc,
|
|
||||||
logger: logger,
|
|
||||||
|
|
||||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
|
||||||
OrmDB: store,
|
|
||||||
|
|
||||||
authority: authority,
|
|
||||||
}
|
|
||||||
|
|
||||||
schema, err := sb.Build()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
k.Schema = schema
|
|
||||||
|
|
||||||
return k
|
|
||||||
}
|
|
@ -1,142 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
storetypes "cosmossdk.io/store/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/runtime"
|
|
||||||
"github.com/cosmos/cosmos-sdk/testutil"
|
|
||||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
|
||||||
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
|
|
||||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
|
||||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
|
||||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"github.com/stretchr/testify/suite"
|
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
module "github.com/onsonr/sonr/x/oracle"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var maccPerms = map[string][]string{
|
|
||||||
authtypes.FeeCollectorName: nil,
|
|
||||||
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
|
|
||||||
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
|
|
||||||
minttypes.ModuleName: {authtypes.Minter},
|
|
||||||
govtypes.ModuleName: {authtypes.Burner},
|
|
||||||
}
|
|
||||||
|
|
||||||
type testFixture struct {
|
|
||||||
suite.Suite
|
|
||||||
|
|
||||||
ctx sdk.Context
|
|
||||||
k keeper.Keeper
|
|
||||||
msgServer types.MsgServer
|
|
||||||
queryServer types.QueryServer
|
|
||||||
appModule *module.AppModule
|
|
||||||
|
|
||||||
accountkeeper authkeeper.AccountKeeper
|
|
||||||
bankkeeper bankkeeper.BaseKeeper
|
|
||||||
didkeeper didkeeper.Keeper
|
|
||||||
mack macaroonkeeper.Keeper
|
|
||||||
stakingKeeper *stakingkeeper.Keeper
|
|
||||||
mintkeeper mintkeeper.Keeper
|
|
||||||
|
|
||||||
addrs []sdk.AccAddress
|
|
||||||
govModAddr string
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetupTest(t *testing.T) *testFixture {
|
|
||||||
t.Helper()
|
|
||||||
f := new(testFixture)
|
|
||||||
require := require.New(t)
|
|
||||||
|
|
||||||
// Base setup
|
|
||||||
logger := log.NewTestLogger(t)
|
|
||||||
encCfg := moduletestutil.MakeTestEncodingConfig()
|
|
||||||
|
|
||||||
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
|
||||||
|
|
||||||
key := storetypes.NewKVStoreKey(types.ModuleName)
|
|
||||||
storeService := runtime.NewKVStoreService(key)
|
|
||||||
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
|
||||||
|
|
||||||
f.ctx = testCtx.Ctx
|
|
||||||
|
|
||||||
// Register SDK modules.
|
|
||||||
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
|
||||||
|
|
||||||
// Setup Keeper.
|
|
||||||
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr)
|
|
||||||
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
|
||||||
f.queryServer = keeper.NewQuerier(f.k)
|
|
||||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didkeeper, f.mack)
|
|
||||||
return f
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
|
||||||
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
|
|
||||||
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerBaseSDKModules(
|
|
||||||
f *testFixture,
|
|
||||||
encCfg moduletestutil.TestEncodingConfig,
|
|
||||||
storeService store.KVStoreService,
|
|
||||||
logger log.Logger,
|
|
||||||
require *require.Assertions,
|
|
||||||
) {
|
|
||||||
registerModuleInterfaces(encCfg)
|
|
||||||
|
|
||||||
// Auth Keeper.
|
|
||||||
f.accountkeeper = authkeeper.NewAccountKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
authtypes.ProtoBaseAccount,
|
|
||||||
maccPerms,
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
|
||||||
f.govModAddr,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Bank Keeper.
|
|
||||||
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.accountkeeper,
|
|
||||||
nil,
|
|
||||||
f.govModAddr, logger,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Staking Keeper.
|
|
||||||
f.stakingKeeper = stakingkeeper.NewKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
|
||||||
)
|
|
||||||
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
|
||||||
|
|
||||||
// Mint Keeper.
|
|
||||||
f.mintkeeper = mintkeeper.NewKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
|
||||||
authtypes.FeeCollectorName, f.govModAddr,
|
|
||||||
)
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
|
||||||
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
apiv1 "github.com/onsonr/sonr/api/oracle/v1"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestORM(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
|
|
||||||
dt := f.k.OrmDB.BalanceTable()
|
|
||||||
amt := uint64(7)
|
|
||||||
|
|
||||||
err := dt.Insert(f.ctx, &apiv1.Balance{
|
|
||||||
Amount: amt,
|
|
||||||
})
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
require.NoError(t, err)
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ types.QueryServer = Querier{}
|
|
||||||
|
|
||||||
type Querier struct {
|
|
||||||
Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewQuerier(keeper Keeper) Querier {
|
|
||||||
return Querier{Keeper: keeper}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
|
||||||
|
|
||||||
p, err := k.Keeper.Params.Get(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &types.QueryParamsResponse{Params: &p}, nil
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
|
|
||||||
"cosmossdk.io/errors"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type msgServer struct {
|
|
||||||
k Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ types.MsgServer = msgServer{}
|
|
||||||
|
|
||||||
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
|
||||||
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
|
||||||
return &msgServer{k: keeper}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
|
||||||
if ms.k.authority != msg.Authority {
|
|
||||||
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, ms.k.Params.Set(ctx, msg.Params)
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestParams(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
require := require.New(t)
|
|
||||||
|
|
||||||
testCases := []struct {
|
|
||||||
name string
|
|
||||||
request *types.MsgUpdateParams
|
|
||||||
err bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "fail; invalid authority",
|
|
||||||
request: &types.MsgUpdateParams{
|
|
||||||
Authority: f.addrs[0].String(),
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
},
|
|
||||||
err: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "success",
|
|
||||||
request: &types.MsgUpdateParams{
|
|
||||||
Authority: f.govModAddr,
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
},
|
|
||||||
err: false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
tc := tc
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
|
||||||
_, err := f.msgServer.UpdateParams(f.ctx, tc.request)
|
|
||||||
|
|
||||||
if tc.err {
|
|
||||||
require.Error(err)
|
|
||||||
} else {
|
|
||||||
require.NoError(err)
|
|
||||||
|
|
||||||
r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{})
|
|
||||||
require.NoError(err)
|
|
||||||
|
|
||||||
require.EqualValues(&tc.request.Params, r.Params)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,153 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"cosmossdk.io/client/v2/autocli"
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
|
||||||
abci "github.com/cometbft/cometbft/abci/types"
|
|
||||||
"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"
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// ConsensusVersion defines the current x/oracle module consensus version.
|
|
||||||
ConsensusVersion = 1
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # simapp/module/const
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ module.AppModuleBasic = AppModuleBasic{}
|
|
||||||
_ module.AppModuleGenesis = AppModule{}
|
|
||||||
_ module.AppModule = AppModule{}
|
|
||||||
|
|
||||||
_ autocli.HasAutoCLIConfig = AppModule{}
|
|
||||||
)
|
|
||||||
|
|
||||||
// AppModuleBasic defines the basic application module used by the wasm module.
|
|
||||||
type AppModuleBasic struct {
|
|
||||||
cdc codec.Codec
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppModule struct {
|
|
||||||
AppModuleBasic
|
|
||||||
|
|
||||||
keeper keeper.Keeper
|
|
||||||
didk didkeeper.Keeper
|
|
||||||
mack macaroonkeeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAppModule constructor
|
|
||||||
func NewAppModule(
|
|
||||||
cdc codec.Codec,
|
|
||||||
keeper keeper.Keeper,
|
|
||||||
didkeeper didkeeper.Keeper,
|
|
||||||
macaroonkeeper macaroonkeeper.Keeper,
|
|
||||||
) *AppModule {
|
|
||||||
return &AppModule{
|
|
||||||
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
|
||||||
keeper: keeper,
|
|
||||||
didk: didkeeper,
|
|
||||||
mack: macaroonkeeper,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) Name() string {
|
|
||||||
return types.ModuleName
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
|
||||||
return cdc.MustMarshalJSON(&types.GenesisState{
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
|
|
||||||
var data types.GenesisState
|
|
||||||
err := marshaler.UnmarshalJSON(message, &data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := data.Params.Validate(); err != nil {
|
|
||||||
return errorsmod.Wrap(err, "params")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
|
|
||||||
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
|
|
||||||
if err != nil {
|
|
||||||
// same behavior as in cosmos-sdk
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods.
|
|
||||||
/*
|
|
||||||
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
|
|
||||||
return cli.NewTxCmd()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
|
|
||||||
return cli.GetQueryCmd()
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
||||||
types.RegisterLegacyAminoCodec(cdc)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) {
|
|
||||||
types.RegisterInterfaces(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
|
|
||||||
var genesisState types.GenesisState
|
|
||||||
marshaler.MustUnmarshalJSON(message, &genesisState)
|
|
||||||
|
|
||||||
if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage {
|
|
||||||
genState := a.keeper.ExportGenesis(ctx)
|
|
||||||
return marshaler.MustMarshalJSON(genState)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) QuerierRoute() string {
|
|
||||||
return types.QuerierRoute
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) RegisterServices(cfg module.Configurator) {
|
|
||||||
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper))
|
|
||||||
types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper))
|
|
||||||
}
|
|
||||||
|
|
||||||
// ConsensusVersion is a sequence number for state-breaking change of the
|
|
||||||
// module. It should be incremented on each consensus-breaking change
|
|
||||||
// introduced by the module. To avoid wrong/empty versions, the initial version
|
|
||||||
// should be set to 1.
|
|
||||||
func (a AppModule) ConsensusVersion() uint64 {
|
|
||||||
return ConsensusVersion
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
|
||||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
||||||
// this line is used by starport scaffolding # 1
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
amino = codec.NewLegacyAmino()
|
|
||||||
AminoCdc = codec.NewAminoCodec(amino)
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
RegisterLegacyAminoCodec(amino)
|
|
||||||
cryptocodec.RegisterCrypto(amino)
|
|
||||||
sdk.RegisterLegacyAminoCodec(amino)
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
|
||||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
||||||
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
||||||
// this line is used by starport scaffolding # 3
|
|
||||||
|
|
||||||
registry.RegisterImplementations(
|
|
||||||
(*sdk.Msg)(nil),
|
|
||||||
&MsgUpdateParams{},
|
|
||||||
)
|
|
||||||
|
|
||||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/onsonr/sonr/pkg/orm/assettype"
|
|
||||||
)
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/types/import
|
|
||||||
|
|
||||||
// DefaultIndex is the default global index
|
|
||||||
const DefaultIndex uint64 = 1
|
|
||||||
|
|
||||||
// DefaultGenesis returns the default genesis state
|
|
||||||
func DefaultGenesis() *GenesisState {
|
|
||||||
return &GenesisState{
|
|
||||||
// this line is used by starport scaffolding # genesis/types/default
|
|
||||||
Params: DefaultParams(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate performs basic genesis state validation returning an error upon any
|
|
||||||
// failure.
|
|
||||||
func (gs GenesisState) Validate() error {
|
|
||||||
// this line is used by starport scaffolding # genesis/types/validate
|
|
||||||
|
|
||||||
return gs.Params.Validate()
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC
|
|
||||||
func DefaultAssets() []*AssetInfo {
|
|
||||||
return []*AssetInfo{
|
|
||||||
{
|
|
||||||
Name: "Bitcoin",
|
|
||||||
Symbol: "BTC",
|
|
||||||
Hrp: "bc",
|
|
||||||
Index: 0,
|
|
||||||
AssetType: assettype.Native.String(),
|
|
||||||
IconUrl: "https://cdn.sonr.land/BTC.svg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Ethereum",
|
|
||||||
Symbol: "ETH",
|
|
||||||
Hrp: "eth",
|
|
||||||
Index: 64,
|
|
||||||
AssetType: assettype.Native.String(),
|
|
||||||
IconUrl: "https://cdn.sonr.land/ETH.svg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Sonr",
|
|
||||||
Symbol: "SNR",
|
|
||||||
Hrp: "idx",
|
|
||||||
Index: 703,
|
|
||||||
AssetType: assettype.Native.String(),
|
|
||||||
IconUrl: "https://cdn.sonr.land/SNR.svg",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,42 +0,0 @@
|
|||||||
package types_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/oracle/types"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGenesisState_Validate(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
desc string
|
|
||||||
genState *types.GenesisState
|
|
||||||
valid bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
desc: "default is valid",
|
|
||||||
genState: types.DefaultGenesis(),
|
|
||||||
valid: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc: "valid genesis state",
|
|
||||||
genState: &types.GenesisState{
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # types/genesis/validField
|
|
||||||
},
|
|
||||||
valid: true,
|
|
||||||
},
|
|
||||||
// this line is used by starport scaffolding # types/genesis/testcase
|
|
||||||
}
|
|
||||||
for _, tc := range tests {
|
|
||||||
t.Run(tc.desc, func(t *testing.T) {
|
|
||||||
err := tc.genState.Validate()
|
|
||||||
if tc.valid {
|
|
||||||
require.NoError(t, err)
|
|
||||||
} else {
|
|
||||||
require.Error(t, err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/collections"
|
|
||||||
|
|
||||||
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
// ParamsKey saves the current module params.
|
|
||||||
ParamsKey = collections.NewPrefix(0)
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
ModuleName = "oracle"
|
|
||||||
|
|
||||||
StoreKey = ModuleName
|
|
||||||
|
|
||||||
QuerierRoute = ModuleName
|
|
||||||
)
|
|
||||||
|
|
||||||
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
|
||||||
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
|
||||||
{Id: 1, ProtoFileName: "oracle/v1/state.proto"},
|
|
||||||
},
|
|
||||||
Prefix: []byte{0},
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/errors"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ sdk.Msg = &MsgUpdateParams{}
|
|
||||||
|
|
||||||
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
|
||||||
func NewMsgUpdateParams(
|
|
||||||
sender sdk.Address,
|
|
||||||
someValue bool,
|
|
||||||
) *MsgUpdateParams {
|
|
||||||
return &MsgUpdateParams{
|
|
||||||
Authority: sender.String(),
|
|
||||||
Params: Params{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Route returns the name of the module
|
|
||||||
func (msg MsgUpdateParams) Route() string { return ModuleName }
|
|
||||||
|
|
||||||
// Type returns the the action
|
|
||||||
func (msg MsgUpdateParams) Type() string { return "update_params" }
|
|
||||||
|
|
||||||
// GetSignBytes implements the LegacyMsg interface.
|
|
||||||
func (msg MsgUpdateParams) GetSignBytes() []byte {
|
|
||||||
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
|
||||||
func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
|
||||||
addr, _ := sdk.AccAddressFromBech32(msg.Authority)
|
|
||||||
return []sdk.AccAddress{addr}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateBasic does a sanity check on the provided data.
|
|
||||||
func (msg *MsgUpdateParams) Validate() error {
|
|
||||||
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
|
||||||
return errors.Wrap(err, "invalid authority address")
|
|
||||||
}
|
|
||||||
|
|
||||||
return msg.Params.Validate()
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DefaultParams returns default module parameters.
|
|
||||||
func DefaultParams() Params {
|
|
||||||
// TODO:
|
|
||||||
return Params{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stringer method for Params.
|
|
||||||
func (p Params) String() string {
|
|
||||||
bz, err := json.Marshal(p)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(bz)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate does the sanity check on the params.
|
|
||||||
func (p Params) Validate() error {
|
|
||||||
// TODO:
|
|
||||||
return nil
|
|
||||||
}
|
|
@ -1,539 +0,0 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
||||||
// source: oracle/v1/query.proto
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
fmt "fmt"
|
|
||||||
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
|
||||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
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
|
|
||||||
|
|
||||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
|
||||||
type QueryParamsRequest struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
|
||||||
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*QueryParamsRequest) ProtoMessage() {}
|
|
||||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_34238c8dfdfcd7ec, []int{0}
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_QueryParamsRequest.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo
|
|
||||||
|
|
||||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
||||||
type QueryParamsResponse struct {
|
|
||||||
// params defines the parameters of the module.
|
|
||||||
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
|
||||||
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*QueryParamsResponse) ProtoMessage() {}
|
|
||||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_34238c8dfdfcd7ec, []int{1}
|
|
||||||
}
|
|
||||||
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_QueryParamsResponse.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *QueryParamsResponse) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *QueryParamsResponse) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *QueryParamsResponse) GetParams() *Params {
|
|
||||||
if m != nil {
|
|
||||||
return m.Params
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterType((*QueryParamsRequest)(nil), "oracle.v1.QueryParamsRequest")
|
|
||||||
proto.RegisterType((*QueryParamsResponse)(nil), "oracle.v1.QueryParamsResponse")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) }
|
|
||||||
|
|
||||||
var fileDescriptor_34238c8dfdfcd7ec = []byte{
|
|
||||||
// 250 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0x2f, 0x4a, 0x4c,
|
|
||||||
0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f,
|
|
||||||
0xc9, 0x17, 0xe2, 0x84, 0x08, 0xeb, 0x95, 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4,
|
|
||||||
0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15,
|
|
||||||
0x43, 0x14, 0x4a, 0x89, 0x23, 0xf4, 0xa7, 0xa7, 0xe6, 0xa5, 0x16, 0x67, 0x42, 0x25, 0x94, 0x44,
|
|
||||||
0xb8, 0x84, 0x02, 0x41, 0x06, 0x06, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6,
|
|
||||||
0x16, 0x97, 0x28, 0x39, 0x70, 0x09, 0xa3, 0x88, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x69,
|
|
||||||
0x72, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x04, 0xf5, 0xe0, 0xf6,
|
|
||||||
0xeb, 0x41, 0x95, 0x42, 0x15, 0x18, 0x65, 0x73, 0xb1, 0x82, 0x4d, 0x10, 0x4a, 0xe2, 0x62, 0x83,
|
|
||||||
0x48, 0x09, 0xc9, 0x22, 0xa9, 0xc6, 0xb4, 0x53, 0x4a, 0x0e, 0x97, 0x34, 0xc4, 0x72, 0x25, 0xc9,
|
|
||||||
0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x09, 0x0b, 0x09, 0xea, 0x23, 0xfc, 0x02, 0xb1, 0xcc, 0xc9, 0xfe,
|
|
||||||
0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e,
|
|
||||||
0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x54, 0xd3, 0x33, 0x4b, 0x32, 0x4a,
|
|
||||||
0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xf3, 0xf3, 0x8a, 0xf3, 0xf3, 0x8a, 0xf4, 0xc1, 0x44, 0x05,
|
|
||||||
0xcc, 0x90, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x60, 0x18, 0x03, 0x02, 0x00, 0x00,
|
|
||||||
0xff, 0xff, 0x38, 0x25, 0xc7, 0xb6, 0x67, 0x01, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var _ context.Context
|
|
||||||
var _ grpc.ClientConn
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
const _ = grpc.SupportPackageIsVersion4
|
|
||||||
|
|
||||||
// QueryClient is the client API for Query service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
||||||
type QueryClient interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type queryClient struct {
|
|
||||||
cc grpc1.ClientConn
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
|
||||||
return &queryClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
|
||||||
out := new(QueryParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/oracle.v1.Query/Params", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryServer is the server API for Query service.
|
|
||||||
type QueryServer interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedQueryServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
|
||||||
s.RegisterService(&_Query_serviceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(QueryParamsRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(QueryServer).Params(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/oracle.v1.Query/Params",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "oracle.v1.Query",
|
|
||||||
HandlerType: (*QueryServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Params",
|
|
||||||
Handler: _Query_Params_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "oracle/v1/query.proto",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Params != nil {
|
|
||||||
{
|
|
||||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovQuery(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *QueryParamsResponse) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Params != nil {
|
|
||||||
l = m.Params.Size()
|
|
||||||
n += 1 + l + sovQuery(uint64(l))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovQuery(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozQuery(x uint64) (n int) {
|
|
||||||
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: QueryParamsResponse: 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 ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if m.Params == nil {
|
|
||||||
m.Params = &Params{}
|
|
||||||
}
|
|
||||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipQuery(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowQuery
|
|
||||||
}
|
|
||||||
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, ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupQuery
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthQuery
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
||||||
ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow")
|
|
||||||
ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
|
@ -1,153 +0,0 @@
|
|||||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
|
||||||
// source: oracle/v1/query.proto
|
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a reverse proxy.
|
|
||||||
|
|
||||||
It translates gRPC into RESTful JSON APIs.
|
|
||||||
*/
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/golang/protobuf/descriptor"
|
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
|
||||||
"google.golang.org/grpc"
|
|
||||||
"google.golang.org/grpc/codes"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
|
||||||
"google.golang.org/grpc/metadata"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Suppress "imported and not used" errors
|
|
||||||
var _ codes.Code
|
|
||||||
var _ io.Reader
|
|
||||||
var _ status.Status
|
|
||||||
var _ = runtime.String
|
|
||||||
var _ = utilities.NewDoubleArray
|
|
||||||
var _ = descriptor.ForMessage
|
|
||||||
var _ = metadata.Join
|
|
||||||
|
|
||||||
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryParamsRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryParamsRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
msg, err := server.Params(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
|
||||||
// UnaryRPC :call QueryServer directly.
|
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
|
||||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
var stream runtime.ServerTransportStream
|
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but
|
|
||||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
|
||||||
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
|
||||||
conn, err := grpc.Dial(endpoint, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer func() {
|
|
||||||
if err != nil {
|
|
||||||
if cerr := conn.Close(); cerr != nil {
|
|
||||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
go func() {
|
|
||||||
<-ctx.Done()
|
|
||||||
if cerr := conn.Close(); cerr != nil {
|
|
||||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}()
|
|
||||||
|
|
||||||
return RegisterQueryHandler(ctx, mux, conn)
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandler registers the http handlers for service Query to "mux".
|
|
||||||
// The handlers forward requests to the grpc endpoint over "conn".
|
|
||||||
func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
|
||||||
return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn))
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerClient registers the http handlers for service Query
|
|
||||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient".
|
|
||||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient"
|
|
||||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
|
||||||
// "QueryClient" to call the correct interceptors.
|
|
||||||
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
|
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"oracle", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
|
||||||
)
|
|
@ -1,666 +0,0 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
||||||
// source: oracle/v1/state.proto
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "cosmossdk.io/orm"
|
|
||||||
fmt "fmt"
|
|
||||||
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
|
|
||||||
|
|
||||||
type Balance struct {
|
|
||||||
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
|
||||||
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Balance) Reset() { *m = Balance{} }
|
|
||||||
func (m *Balance) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*Balance) ProtoMessage() {}
|
|
||||||
func (*Balance) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_8840885873256d8c, []int{0}
|
|
||||||
}
|
|
||||||
func (m *Balance) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Balance.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 *Balance) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Balance.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Balance) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Balance) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Balance.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_Balance proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *Balance) GetAccount() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Account
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Balance) GetAmount() uint64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Amount
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
type Account struct {
|
|
||||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
||||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
|
|
||||||
Chain string `protobuf:"bytes,3,opt,name=chain,proto3" json:"chain,omitempty"`
|
|
||||||
Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) Reset() { *m = Account{} }
|
|
||||||
func (m *Account) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*Account) ProtoMessage() {}
|
|
||||||
func (*Account) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_8840885873256d8c, []int{1}
|
|
||||||
}
|
|
||||||
func (m *Account) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Account.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Account) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Account) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Account.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_Account proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *Account) GetId() uint64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Id
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) GetAddress() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Address
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) GetChain() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Chain
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) GetNetwork() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Network
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterType((*Balance)(nil), "oracle.v1.Balance")
|
|
||||||
proto.RegisterType((*Account)(nil), "oracle.v1.Account")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { proto.RegisterFile("oracle/v1/state.proto", fileDescriptor_8840885873256d8c) }
|
|
||||||
|
|
||||||
var fileDescriptor_8840885873256d8c = []byte{
|
|
||||||
// 291 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xc1, 0x4a, 0x03, 0x31,
|
|
||||||
0x10, 0x86, 0x9b, 0xed, 0xda, 0xd2, 0x1c, 0x44, 0x82, 0xd5, 0xa8, 0x10, 0x4b, 0xa1, 0x50, 0xb0,
|
|
||||||
0x6c, 0x28, 0xde, 0x7a, 0x11, 0xfb, 0x08, 0x7b, 0x14, 0x2f, 0x69, 0x36, 0xd8, 0xc5, 0x6e, 0xa6,
|
|
||||||
0x24, 0x69, 0xd5, 0x97, 0x90, 0x3e, 0x81, 0xcf, 0xe3, 0xb1, 0xe0, 0xc5, 0xa3, 0xec, 0xbe, 0x81,
|
|
||||||
0x4f, 0x20, 0x9b, 0x4d, 0xbd, 0x0c, 0xfc, 0x33, 0xdf, 0xfc, 0xff, 0x30, 0xb8, 0x0f, 0x46, 0xc8,
|
|
||||||
0x95, 0xe2, 0xdb, 0x29, 0xb7, 0x4e, 0x38, 0x95, 0xac, 0x0d, 0x38, 0x20, 0xbd, 0xa6, 0x9d, 0x6c,
|
|
||||||
0xa7, 0x97, 0xe7, 0x12, 0x6c, 0x01, 0x96, 0x83, 0x29, 0x6a, 0x0a, 0x4c, 0xd1, 0x30, 0xc3, 0x47,
|
|
||||||
0xdc, 0x9d, 0x8b, 0x95, 0xd0, 0x52, 0x11, 0x8a, 0xbb, 0x42, 0x4a, 0xd8, 0x68, 0x47, 0xd1, 0x00,
|
|
||||||
0x8d, 0x7b, 0xe9, 0x41, 0x92, 0x33, 0xdc, 0x11, 0x85, 0x1f, 0x44, 0x03, 0x34, 0x8e, 0xd3, 0xa0,
|
|
||||||
0x66, 0xd7, 0xbf, 0x1f, 0x5f, 0xef, 0xed, 0x0b, 0xdc, 0xfb, 0xdf, 0x24, 0xf8, 0x80, 0x9e, 0x20,
|
|
||||||
0x8a, 0x86, 0x3b, 0x84, 0xbb, 0xf7, 0x61, 0x72, 0x8c, 0xa3, 0x3c, 0xf3, 0xce, 0x71, 0x1a, 0xe5,
|
|
||||||
0x99, 0x8f, 0xcb, 0x32, 0xa3, 0xac, 0xf5, 0xae, 0x75, 0x5c, 0x23, 0xc9, 0x29, 0x3e, 0x92, 0x4b,
|
|
||||||
0x91, 0x6b, 0xda, 0xf6, 0xfd, 0x46, 0xd4, 0xbc, 0x56, 0xee, 0x05, 0xcc, 0x33, 0x8d, 0x1b, 0x3e,
|
|
||||||
0xc8, 0xd9, 0x8d, 0x3f, 0x63, 0x84, 0xe3, 0x3a, 0x81, 0x5c, 0xe1, 0x7e, 0x30, 0x9a, 0xf8, 0xc5,
|
|
||||||
0x49, 0xc0, 0xea, 0x83, 0x68, 0x34, 0xbf, 0xfb, 0x2c, 0x19, 0xda, 0x97, 0x0c, 0xfd, 0x94, 0x0c,
|
|
||||||
0xed, 0x2a, 0xd6, 0xda, 0x57, 0xac, 0xf5, 0x5d, 0xb1, 0xd6, 0xc3, 0xe8, 0x29, 0x77, 0xcb, 0xcd,
|
|
||||||
0x22, 0x91, 0x50, 0x70, 0xd0, 0x16, 0xb4, 0xe1, 0xbe, 0xbc, 0xf2, 0xf0, 0x5e, 0xf7, 0xb6, 0x56,
|
|
||||||
0x76, 0xd1, 0xf1, 0x8f, 0xbb, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x85, 0x67, 0x6c, 0x75,
|
|
||||||
0x01, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Balance) 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 *Balance) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Amount != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.Amount))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x10
|
|
||||||
}
|
|
||||||
if len(m.Account) > 0 {
|
|
||||||
i -= len(m.Account)
|
|
||||||
copy(dAtA[i:], m.Account)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Account)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if len(m.Network) > 0 {
|
|
||||||
i -= len(m.Network)
|
|
||||||
copy(dAtA[i:], m.Network)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Network)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
}
|
|
||||||
if len(m.Chain) > 0 {
|
|
||||||
i -= len(m.Chain)
|
|
||||||
copy(dAtA[i:], m.Chain)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Chain)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.Address) > 0 {
|
|
||||||
i -= len(m.Address)
|
|
||||||
copy(dAtA[i:], m.Address)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Address)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if m.Id != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovState(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Balance) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Account)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
if m.Amount != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.Amount))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Account) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Id != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.Id))
|
|
||||||
}
|
|
||||||
l = len(m.Address)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Chain)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Network)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovState(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozState(x uint64) (n int) {
|
|
||||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (m *Balance) 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 ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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: Balance: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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 ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Account = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
|
||||||
}
|
|
||||||
m.Amount = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Amount |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipState(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (m *Account) 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 ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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: Account: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
||||||
}
|
|
||||||
m.Id = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Id |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
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 ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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 ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Address = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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 ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Chain = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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 ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Network = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipState(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipState(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, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
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, ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupState
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
||||||
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
|
||||||
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
|
@ -1,601 +0,0 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
||||||
// source: oracle/v1/tx.proto
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/cosmos/cosmos-proto"
|
|
||||||
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
||||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
|
||||||
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
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
|
|
||||||
|
|
||||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
type MsgUpdateParams struct {
|
|
||||||
// authority is the address of the governance account.
|
|
||||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
|
||||||
// params defines the 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_31571edce0094a5d, []int{0}
|
|
||||||
}
|
|
||||||
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.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
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_31571edce0094a5d, []int{1}
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterType((*MsgUpdateParams)(nil), "oracle.v1.MsgUpdateParams")
|
|
||||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "oracle.v1.MsgUpdateParamsResponse")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { proto.RegisterFile("oracle/v1/tx.proto", fileDescriptor_31571edce0094a5d) }
|
|
||||||
|
|
||||||
var fileDescriptor_31571edce0094a5d = []byte{
|
|
||||||
// 317 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2f, 0x4a, 0x4c,
|
|
||||||
0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2,
|
|
||||||
0x84, 0x88, 0xe9, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0xe7, 0x16,
|
|
||||||
0xa7, 0x83, 0x94, 0xe4, 0x16, 0xa7, 0x43, 0xd4, 0x48, 0x89, 0x23, 0xf4, 0xa5, 0xa7, 0xe6, 0xa5,
|
|
||||||
0x16, 0x67, 0x16, 0x43, 0x25, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a,
|
|
||||||
0x2a, 0x09, 0x31, 0x27, 0x1e, 0x22, 0x01, 0xe1, 0x40, 0xa4, 0x94, 0xba, 0x18, 0xb9, 0xf8, 0x7d,
|
|
||||||
0x8b, 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc,
|
|
||||||
0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35,
|
|
||||||
0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x6a, 0x74, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e,
|
|
||||||
0x0e, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x42, 0x28, 0x15, 0xd2, 0xe7, 0x62, 0x2b, 0x00, 0x9b,
|
|
||||||
0x20, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa8, 0x07, 0xf7, 0x8a, 0x1e, 0xc4, 0x68, 0x27,
|
|
||||||
0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xca, 0xac, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0x18,
|
|
||||||
0xa0, 0x24, 0xc9, 0x25, 0x8e, 0xe6, 0x96, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3,
|
|
||||||
0x18, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0x21, 0x3f, 0x2e, 0x1e, 0x14, 0xa7, 0x4a, 0x21, 0x59, 0x81,
|
|
||||||
0xa6, 0x55, 0x4a, 0x09, 0xb7, 0x1c, 0xcc, 0x58, 0x29, 0xd6, 0x86, 0xe7, 0x1b, 0xb4, 0x18, 0x9d,
|
|
||||||
0xec, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f,
|
|
||||||
0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x35, 0x3d, 0xb3, 0x24,
|
|
||||||
0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x3f, 0xaf, 0x38, 0x3f, 0xaf, 0x48, 0x1f, 0x4c,
|
|
||||||
0x54, 0xe8, 0x43, 0xa3, 0xa0, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x9a, 0xc6, 0x80,
|
|
||||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0xf5, 0x6d, 0x1c, 0xd1, 0x01, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var _ context.Context
|
|
||||||
var _ grpc.ClientConn
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
const _ = grpc.SupportPackageIsVersion4
|
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
||||||
type MsgClient interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type msgClient struct {
|
|
||||||
cc grpc1.ClientConn
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewMsgClient(cc grpc1.ClientConn) MsgClient {
|
|
||||||
return &msgClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
|
||||||
out := new(MsgUpdateParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/oracle.v1.Msg/UpdateParams", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgServer is the server API for Msg service.
|
|
||||||
type MsgServer interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedMsgServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
|
||||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
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: "/oracle.v1.Msg/UpdateParams",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "oracle.v1.Msg",
|
|
||||||
HandlerType: (*MsgServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "UpdateParams",
|
|
||||||
Handler: _Msg_UpdateParams_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "oracle/v1/tx.proto",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
{
|
|
||||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
if len(m.Authority) > 0 {
|
|
||||||
i -= len(m.Authority)
|
|
||||||
copy(dAtA[i:], m.Authority)
|
|
||||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovTx(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParams) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Authority)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovTx(uint64(l))
|
|
||||||
}
|
|
||||||
l = m.Params.Size()
|
|
||||||
n += 1 + l + sovTx(uint64(l))
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovTx(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozTx(x uint64) (n int) {
|
|
||||||
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipTx(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipTx(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipTx(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
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, ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
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, ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupTx
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthTx
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
||||||
ErrIntOverflowTx = fmt.Errorf("proto: integer overflow")
|
|
||||||
ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user