diff --git a/CHANGELOG.md b/CHANGELOG.md index b87fe794b297..e8c260970ef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,9 +116,11 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (baseapp) [#19970](https://github.com/cosmos/cosmos-sdk/pull/19970) Fix default config values to use no-op mempool as default. * (crypto) [#20027](https://github.com/cosmos/cosmos-sdk/pull/20027) secp256r1 keys now implement gogoproto's customtype interface. * (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled. +* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. ### API Breaking Changes +* (x/crisis) [#20043](https://github.com/cosmos/cosmos-sdk/pull/20043) Changed `NewMsgVerifyInvariant` to accept a string as argument instead of an `AccAddress`. * (x/genutil) [#19926](https://github.com/cosmos/cosmos-sdk/pull/19926) Removal of the Address.String() method and related changes: * Added an address codec as an argument to `CollectTxs`, `GenAppStateFromConfig`, and `AddGenesisAccount`. * Removed the `ValidatorAddressCodec` argument from `CollectGenTxsCmd`, now utilizing the context for this purpose. diff --git a/README.md b/README.md index 83445d9cd5f2..607f7d345848 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The Cosmos SDK is a framework for building blockchain applications. [CometBFT (B ## Quick Start -To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK [High-Level Intro](https://docs.cosmos.network/main/learn/intro/overview). +To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK [High-Level Intro](https://docs.cosmos.network/v0.50/learn/intro/overview). If you want to get started quickly and learn how to build on top of Cosmos SDK, visit [Cosmos SDK Tutorials](https://tutorials.cosmos.network). You can also fork the tutorial's repository to get started building your own Cosmos SDK application. @@ -66,15 +66,15 @@ The version matrix below shows which versions of the Cosmos SDK, modules and lib #### Core Dependencies -Core Dependencies are the core libraries that a application may depend on. +Core Dependencies are the core libraries that a application may depend on. > Note: the ❌ signals that the version of the Cosmos SDK does not need to import the dependency. | Cosmos SDK | cosmossdk.io/core | cosmossdk.io/api | cosmossdk.io/math | cosmossdk.io/errors | cosmossdk.io/depinject | cosmossdk.io/log | cosmossdk.io/store | -|------------|-------------------|------------------|-------------------|---------------------|------------------------|------------------|--------------------| +| ---------- | ----------------- | ---------------- | ----------------- | ------------------- | ---------------------- | ---------------- | ------------------ | | 0.50.z | 0.11.z | 0.7.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | -| 0.47.z | 0.5.z | 0.3.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | ❌ | -| 0.46.z | ❌ | ❌ | 1.y.z | 1.y.z | ❌ | ❌ | ❌ | +| 0.47.z | 0.5.z | 0.3.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | ❌ | +| 0.46.z | ❌ | ❌ | 1.y.z | 1.y.z | ❌ | ❌ | ❌ | #### Module Dependencies @@ -82,30 +82,26 @@ Module Dependencies are the modules that a application may depend on and which v > Note: The version table only goes back to 0.50.x, this is due to the reason that modules were not spun out into their own go.mods until 0.50.z. ❌ signals that the module was not spun out into its own go.mod file. - | Cosmos SDK | 0.50.z | 0.y.z | -|-----------------------------|-----------|-------| -| cosmossdk.io/x/auth | ❌ | | -| cosmossdk.io/x/accounts | ❌ | | -| cosmossdk.io/x/bank | ❌ | | +| --------------------------- | --------- | ----- | +| cosmossdk.io/x/auth | ❌ | | +| cosmossdk.io/x/accounts | ❌ | | +| cosmossdk.io/x/bank | ❌ | | | cosmossdk.io/x/circuit | 0.1.z | | -| cosmossdk.io/x/consensus | ❌ | | -| cosmossdk.io/x/distribution | ❌ | | +| cosmossdk.io/x/consensus | ❌ | | +| cosmossdk.io/x/distribution | ❌ | | | cosmossdk.io/x/evidence | 0.1.z | | | cosmossdk.io/x/feegrant | 0.1.z | | -| cosmossdk.io/x/gov | ❌ | | -| cosmossdk.io/x/group | ❌ | | -| cosmossdk.io/x/mint | ❌ | | +| cosmossdk.io/x/gov | ❌ | | +| cosmossdk.io/x/group | ❌ | | +| cosmossdk.io/x/mint | ❌ | | | cosmossdk.io/x/nft | 0.1.z | | -| cosmossdk.io/x/protcolpool | ❌ | | -| cosmossdk.io/x/slashing | ❌ | | -| cosmossdk.io/x/staking | ❌ | | +| cosmossdk.io/x/protcolpool | ❌ | | +| cosmossdk.io/x/slashing | ❌ | | +| cosmossdk.io/x/staking | ❌ | | | cosmossdk.io/x/tx | =< 0.13.z | | | cosmossdk.io/x/upgrade | 0.1.z | | - - - ## Disambiguation This Cosmos SDK project is not related to the [React-Cosmos](https://github.com/react-cosmos/react-cosmos) project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here. diff --git a/api/cosmos/auth/v1beta1/tx.pulsar.go b/api/cosmos/auth/v1beta1/tx.pulsar.go index 4a364ba532ff..6e9de52a99fd 100644 --- a/api/cosmos/auth/v1beta1/tx.pulsar.go +++ b/api/cosmos/auth/v1beta1/tx.pulsar.go @@ -11,6 +11,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" io "io" reflect "reflect" sync "sync" @@ -871,6 +872,1557 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var _ protoreflect.List = (*_MsgNonAtomicExec_2_list)(nil) + +type _MsgNonAtomicExec_2_list struct { + list *[]*anypb.Any +} + +func (x *_MsgNonAtomicExec_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgNonAtomicExec_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgNonAtomicExec_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgNonAtomicExec_2_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgNonAtomicExec_2_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgNonAtomicExec protoreflect.MessageDescriptor + fd_MsgNonAtomicExec_signer protoreflect.FieldDescriptor + fd_MsgNonAtomicExec_msgs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_MsgNonAtomicExec = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("MsgNonAtomicExec") + fd_MsgNonAtomicExec_signer = md_MsgNonAtomicExec.Fields().ByName("signer") + fd_MsgNonAtomicExec_msgs = md_MsgNonAtomicExec.Fields().ByName("msgs") +} + +var _ protoreflect.Message = (*fastReflection_MsgNonAtomicExec)(nil) + +type fastReflection_MsgNonAtomicExec MsgNonAtomicExec + +func (x *MsgNonAtomicExec) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExec)(x) +} + +func (x *MsgNonAtomicExec) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[2] + 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_MsgNonAtomicExec_messageType fastReflection_MsgNonAtomicExec_messageType +var _ protoreflect.MessageType = fastReflection_MsgNonAtomicExec_messageType{} + +type fastReflection_MsgNonAtomicExec_messageType struct{} + +func (x fastReflection_MsgNonAtomicExec_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExec)(nil) +} +func (x fastReflection_MsgNonAtomicExec_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExec) +} +func (x fastReflection_MsgNonAtomicExec_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExec +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNonAtomicExec) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExec +} + +// 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_MsgNonAtomicExec) Type() protoreflect.MessageType { + return _fastReflection_MsgNonAtomicExec_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNonAtomicExec) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExec) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNonAtomicExec) Interface() protoreflect.ProtoMessage { + return (*MsgNonAtomicExec)(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_MsgNonAtomicExec) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgNonAtomicExec_signer, value) { + return + } + } + if len(x.Msgs) != 0 { + value := protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{list: &x.Msgs}) + if !f(fd_MsgNonAtomicExec_msgs, 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_MsgNonAtomicExec) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + return x.Signer != "" + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + return len(x.Msgs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + x.Signer = "" + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + x.Msgs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + if len(x.Msgs) == 0 { + return protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{}) + } + listValue := &_MsgNonAtomicExec_2_list{list: &x.Msgs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + x.Signer = value.Interface().(string) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + lv := value.List() + clv := lv.(*_MsgNonAtomicExec_2_list) + x.Msgs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + if x.Msgs == nil { + x.Msgs = []*anypb.Any{} + } + value := &_MsgNonAtomicExec_2_list{list: &x.Msgs} + return protoreflect.ValueOfList(value) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + panic(fmt.Errorf("field signer of message cosmos.auth.v1beta1.MsgNonAtomicExec is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + return protoreflect.ValueOfString("") + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.MsgNonAtomicExec", 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNonAtomicExec) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Msgs) > 0 { + for _, e := range x.Msgs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgNonAtomicExec) + 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.Msgs) > 0 { + for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Msgs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + 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().(*MsgNonAtomicExec) + 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: MsgNonAtomicExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNonAtomicExec: 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 Signer", 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.Signer = 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 Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Msgs = append(x.Msgs, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Msgs[len(x.Msgs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_NonAtomicExecResult protoreflect.MessageDescriptor + fd_NonAtomicExecResult_error protoreflect.FieldDescriptor + fd_NonAtomicExecResult_resp protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_NonAtomicExecResult = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("NonAtomicExecResult") + fd_NonAtomicExecResult_error = md_NonAtomicExecResult.Fields().ByName("error") + fd_NonAtomicExecResult_resp = md_NonAtomicExecResult.Fields().ByName("resp") +} + +var _ protoreflect.Message = (*fastReflection_NonAtomicExecResult)(nil) + +type fastReflection_NonAtomicExecResult NonAtomicExecResult + +func (x *NonAtomicExecResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_NonAtomicExecResult)(x) +} + +func (x *NonAtomicExecResult) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[3] + 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_NonAtomicExecResult_messageType fastReflection_NonAtomicExecResult_messageType +var _ protoreflect.MessageType = fastReflection_NonAtomicExecResult_messageType{} + +type fastReflection_NonAtomicExecResult_messageType struct{} + +func (x fastReflection_NonAtomicExecResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_NonAtomicExecResult)(nil) +} +func (x fastReflection_NonAtomicExecResult_messageType) New() protoreflect.Message { + return new(fastReflection_NonAtomicExecResult) +} +func (x fastReflection_NonAtomicExecResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NonAtomicExecResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NonAtomicExecResult) Descriptor() protoreflect.MessageDescriptor { + return md_NonAtomicExecResult +} + +// 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_NonAtomicExecResult) Type() protoreflect.MessageType { + return _fastReflection_NonAtomicExecResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NonAtomicExecResult) New() protoreflect.Message { + return new(fastReflection_NonAtomicExecResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NonAtomicExecResult) Interface() protoreflect.ProtoMessage { + return (*NonAtomicExecResult)(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_NonAtomicExecResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Error != "" { + value := protoreflect.ValueOfString(x.Error) + if !f(fd_NonAtomicExecResult_error, value) { + return + } + } + if x.Resp != nil { + value := protoreflect.ValueOfMessage(x.Resp.ProtoReflect()) + if !f(fd_NonAtomicExecResult_resp, 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_NonAtomicExecResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + return x.Error != "" + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + return x.Resp != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + x.Error = "" + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + x.Resp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + value := x.Error + return protoreflect.ValueOfString(value) + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + value := x.Resp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + x.Error = value.Interface().(string) + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + x.Resp = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + if x.Resp == nil { + x.Resp = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Resp.ProtoReflect()) + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + panic(fmt.Errorf("field error of message cosmos.auth.v1beta1.NonAtomicExecResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + return protoreflect.ValueOfString("") + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.NonAtomicExecResult", 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_NonAtomicExecResult) 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_NonAtomicExecResult) 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_NonAtomicExecResult) 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_NonAtomicExecResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NonAtomicExecResult) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Error) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Resp != nil { + l = options.Size(x.Resp) + 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().(*NonAtomicExecResult) + 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 x.Resp != nil { + encoded, err := options.Marshal(x.Resp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Error) > 0 { + i -= len(x.Error) + copy(dAtA[i:], x.Error) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) + 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().(*NonAtomicExecResult) + 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: NonAtomicExecResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NonAtomicExecResult: 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 Error", 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.Error = 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 Resp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Resp == nil { + x.Resp = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MsgNonAtomicExecResponse_1_list)(nil) + +type _MsgNonAtomicExecResponse_1_list struct { + list *[]*NonAtomicExecResult +} + +func (x *_MsgNonAtomicExecResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NonAtomicExecResult) + (*x.list)[i] = concreteValue +} + +func (x *_MsgNonAtomicExecResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NonAtomicExecResult) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgNonAtomicExecResponse_1_list) AppendMutable() protoreflect.Value { + v := new(NonAtomicExecResult) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgNonAtomicExecResponse_1_list) NewElement() protoreflect.Value { + v := new(NonAtomicExecResult) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgNonAtomicExecResponse protoreflect.MessageDescriptor + fd_MsgNonAtomicExecResponse_results protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_MsgNonAtomicExecResponse = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("MsgNonAtomicExecResponse") + fd_MsgNonAtomicExecResponse_results = md_MsgNonAtomicExecResponse.Fields().ByName("results") +} + +var _ protoreflect.Message = (*fastReflection_MsgNonAtomicExecResponse)(nil) + +type fastReflection_MsgNonAtomicExecResponse MsgNonAtomicExecResponse + +func (x *MsgNonAtomicExecResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExecResponse)(x) +} + +func (x *MsgNonAtomicExecResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[4] + 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_MsgNonAtomicExecResponse_messageType fastReflection_MsgNonAtomicExecResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgNonAtomicExecResponse_messageType{} + +type fastReflection_MsgNonAtomicExecResponse_messageType struct{} + +func (x fastReflection_MsgNonAtomicExecResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExecResponse)(nil) +} +func (x fastReflection_MsgNonAtomicExecResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExecResponse) +} +func (x fastReflection_MsgNonAtomicExecResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExecResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNonAtomicExecResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExecResponse +} + +// 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_MsgNonAtomicExecResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgNonAtomicExecResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNonAtomicExecResponse) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExecResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNonAtomicExecResponse) Interface() protoreflect.ProtoMessage { + return (*MsgNonAtomicExecResponse)(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_MsgNonAtomicExecResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Results) != 0 { + value := protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{list: &x.Results}) + if !f(fd_MsgNonAtomicExecResponse_results, 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_MsgNonAtomicExecResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + return len(x.Results) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + x.Results = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + if len(x.Results) == 0 { + return protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{}) + } + listValue := &_MsgNonAtomicExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + lv := value.List() + clv := lv.(*_MsgNonAtomicExecResponse_1_list) + x.Results = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + if x.Results == nil { + x.Results = []*NonAtomicExecResult{} + } + value := &_MsgNonAtomicExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + list := []*NonAtomicExecResult{} + return protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.MsgNonAtomicExecResponse", 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNonAtomicExecResponse) + 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.Results) > 0 { + for _, e := range x.Results { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgNonAtomicExecResponse) + 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.Results) > 0 { + for iNdEx := len(x.Results) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Results[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 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().(*MsgNonAtomicExecResponse) + 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: MsgNonAtomicExecResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNonAtomicExecResponse: 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 Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Results = append(x.Results, &NonAtomicExecResult{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Results[len(x.Results)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -964,6 +2516,131 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{1} } +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +type MsgNonAtomicExec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Msgs []*anypb.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (x *MsgNonAtomicExec) Reset() { + *x = MsgNonAtomicExec{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNonAtomicExec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNonAtomicExec) ProtoMessage() {} + +// Deprecated: Use MsgNonAtomicExec.ProtoReflect.Descriptor instead. +func (*MsgNonAtomicExec) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgNonAtomicExec) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +func (x *MsgNonAtomicExec) GetMsgs() []*anypb.Any { + if x != nil { + return x.Msgs + } + return nil +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +type NonAtomicExecResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Resp *anypb.Any `protobuf:"bytes,2,opt,name=resp,proto3" json:"resp,omitempty"` +} + +func (x *NonAtomicExecResult) Reset() { + *x = NonAtomicExecResult{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NonAtomicExecResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NonAtomicExecResult) ProtoMessage() {} + +// Deprecated: Use NonAtomicExecResult.ProtoReflect.Descriptor instead. +func (*NonAtomicExecResult) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *NonAtomicExecResult) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *NonAtomicExecResult) GetResp() *anypb.Any { + if x != nil { + return x.Resp + } + return nil +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +type MsgNonAtomicExecResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*NonAtomicExecResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *MsgNonAtomicExecResponse) Reset() { + *x = MsgNonAtomicExecResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNonAtomicExecResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNonAtomicExecResponse) ProtoMessage() {} + +// Deprecated: Use MsgNonAtomicExecResponse.ProtoReflect.Descriptor instead. +func (*MsgNonAtomicExecResponse) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgNonAtomicExecResponse) GetResults() []*NonAtomicExecResult { + if x != nil { + return x.Results + } + return nil +} + var File_cosmos_auth_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_auth_v1beta1_tx_proto_rawDesc = []byte{ @@ -971,47 +2648,77 @@ var file_cosmos_auth_v1beta1_tx_proto_rawDesc = []byte{ 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, - 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xbf, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x34, 0x82, 0xe7, - 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, - 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x70, 0x0a, - 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x34, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x12, 0x30, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, + 0x45, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x42, 0x1b, 0xca, 0xb4, 0x2d, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x13, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, + 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x28, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x22, 0x5e, 0x0a, 0x18, 0x4d, 0x73, + 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x6f, + 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0xd7, 0x01, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0d, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, + 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x1a, 0x2d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, + 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, - 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, - 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, - 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, + 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1026,21 +2733,30 @@ func file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_auth_v1beta1_tx_proto_rawDescData } -var file_cosmos_auth_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_auth_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_cosmos_auth_v1beta1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: cosmos.auth.v1beta1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: cosmos.auth.v1beta1.MsgUpdateParamsResponse - (*Params)(nil), // 2: cosmos.auth.v1beta1.Params + (*MsgUpdateParams)(nil), // 0: cosmos.auth.v1beta1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.auth.v1beta1.MsgUpdateParamsResponse + (*MsgNonAtomicExec)(nil), // 2: cosmos.auth.v1beta1.MsgNonAtomicExec + (*NonAtomicExecResult)(nil), // 3: cosmos.auth.v1beta1.NonAtomicExecResult + (*MsgNonAtomicExecResponse)(nil), // 4: cosmos.auth.v1beta1.MsgNonAtomicExecResponse + (*Params)(nil), // 5: cosmos.auth.v1beta1.Params + (*anypb.Any)(nil), // 6: google.protobuf.Any } var file_cosmos_auth_v1beta1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.auth.v1beta1.MsgUpdateParams.params:type_name -> cosmos.auth.v1beta1.Params - 0, // 1: cosmos.auth.v1beta1.Msg.UpdateParams:input_type -> cosmos.auth.v1beta1.MsgUpdateParams - 1, // 2: cosmos.auth.v1beta1.Msg.UpdateParams:output_type -> cosmos.auth.v1beta1.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 5, // 0: cosmos.auth.v1beta1.MsgUpdateParams.params:type_name -> cosmos.auth.v1beta1.Params + 6, // 1: cosmos.auth.v1beta1.MsgNonAtomicExec.msgs:type_name -> google.protobuf.Any + 6, // 2: cosmos.auth.v1beta1.NonAtomicExecResult.resp:type_name -> google.protobuf.Any + 3, // 3: cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results:type_name -> cosmos.auth.v1beta1.NonAtomicExecResult + 0, // 4: cosmos.auth.v1beta1.Msg.UpdateParams:input_type -> cosmos.auth.v1beta1.MsgUpdateParams + 2, // 5: cosmos.auth.v1beta1.Msg.NonAtomicExec:input_type -> cosmos.auth.v1beta1.MsgNonAtomicExec + 1, // 6: cosmos.auth.v1beta1.Msg.UpdateParams:output_type -> cosmos.auth.v1beta1.MsgUpdateParamsResponse + 4, // 7: cosmos.auth.v1beta1.Msg.NonAtomicExec:output_type -> cosmos.auth.v1beta1.MsgNonAtomicExecResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_auth_v1beta1_tx_proto_init() } @@ -1074,6 +2790,42 @@ func file_cosmos_auth_v1beta1_tx_proto_init() { return nil } } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgNonAtomicExec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NonAtomicExecResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgNonAtomicExecResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1081,7 +2833,7 @@ func file_cosmos_auth_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_auth_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/auth/v1beta1/tx_grpc.pb.go b/api/cosmos/auth/v1beta1/tx_grpc.pb.go index f6330fcec421..c079d602fb3f 100644 --- a/api/cosmos/auth/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/tx_grpc.pb.go @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/cosmos.auth.v1beta1.Msg/UpdateParams" + Msg_UpdateParams_FullMethodName = "/cosmos.auth.v1beta1.Msg/UpdateParams" + Msg_NonAtomicExec_FullMethodName = "/cosmos.auth.v1beta1.Msg/NonAtomicExec" ) // MsgClient is the client API for Msg service. @@ -31,6 +32,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) } type msgClient struct { @@ -50,6 +53,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) { + out := new(MsgNonAtomicExecResponse) + err := c.cc.Invoke(ctx, Msg_NonAtomicExec_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -59,6 +71,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) mustEmbedUnimplementedMsgServer() } @@ -69,6 +83,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NonAtomicExec not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -100,6 +117,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_NonAtomicExec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNonAtomicExec) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NonAtomicExec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_NonAtomicExec_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NonAtomicExec(ctx, req.(*MsgNonAtomicExec)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -111,6 +146,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "NonAtomicExec", + Handler: _Msg_NonAtomicExec_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/auth/v1beta1/tx.proto", diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index eabfebff70a5..135a07fcf397 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -56,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19976](https://github.com/cosmos/cosmos-sdk/pull/19976) Add encoder for `cosmos.base.v1beta1.DecCoin`. * [#19377](https://github.com/cosmos/cosmos-sdk/pull/19377) Partly fix comment parsing in autocli. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Simplify key flag parsing logic in flag handler. +* [#20033](https://github.com/cosmos/cosmos-sdk/pull/20033) Respect output format from client ctx. ### API Breaking Changes diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go index 7c46025fbfbe..8ec112229ebd 100644 --- a/client/v2/autocli/common.go +++ b/client/v2/autocli/common.go @@ -11,6 +11,8 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + "github.com/cosmos/cosmos-sdk/client" ) type cmdType int @@ -224,11 +226,21 @@ func enhanceCustomCmd(builder *Builder, cmd *cobra.Command, cmdType cmdType, mod // outOrStdoutFormat formats the output based on the output flag and writes it to the command's output stream. func (b *Builder) outOrStdoutFormat(cmd *cobra.Command, out []byte) error { + clientCtx := client.Context{} + if v := cmd.Context().Value(client.ClientContextKey); v != nil { + clientCtx = *(v.(*client.Context)) + } + flagSet := cmd.Flags() + if clientCtx.OutputFormat == "" || flagSet.Changed(flags.FlagOutput) { + output, _ := flagSet.GetString(flags.FlagOutput) + clientCtx = clientCtx.WithOutputFormat(output) + } + var err error - outputType := cmd.Flag(flags.FlagOutput) + outputType := clientCtx.OutputFormat // if the output type is text, convert the json to yaml // if output type is json or nil, default to json - if outputType != nil && outputType.Value.String() == flags.OutputFormatText { + if outputType == flags.OutputFormatText { out, err = yaml.JSONToYAML(out) if err != nil { return err diff --git a/client/v2/go.mod b/client/v2/go.mod index bbaefd535743..98077da2def4 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.4 @@ -47,7 +47,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 4b7075529528..7ae92b9ec64e 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -124,8 +124,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/collections/CHANGELOG.md b/collections/CHANGELOG.md index a0633d328e9f..fda6ca900b30 100644 --- a/collections/CHANGELOG.md +++ b/collections/CHANGELOG.md @@ -33,19 +33,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features -* [#19343](https://github.com/cosmos/cosmos-sdk/pull/19343) – Simplify IndexedMap creation by allowing to infer indexes through reflection. -* [#18933](https://github.com/cosmos/cosmos-sdk/pull/18933) – Add LookupMap implementation. It is basic wrapping of the standard Map methods but is not iterable. -* [#17656](https://github.com/cosmos/cosmos-sdk/pull/17656) – Introduces `Vec`, a collection type that allows to represent a growable array on top of a KVStore. +* [#19343](https://github.com/cosmos/cosmos-sdk/pull/19343) Simplify IndexedMap creation by allowing to infer indexes through reflection. +* [#18933](https://github.com/cosmos/cosmos-sdk/pull/18933) Add LookupMap implementation. It is basic wrapping of the standard Map methods but is not iterable. +* [#17656](https://github.com/cosmos/cosmos-sdk/pull/17656) Introduces `Vec`, a collection type that allows to represent a growable array on top of a KVStore. +* [#19861](https://github.com/cosmos/cosmos-sdk/pull/19861) Add `NewJSONValueCodec` value codec as an alternative for `codec.CollValue` from the SDK for non protobuf types. ## [v0.4.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.4.0) ### Features -* [#17024](https://github.com/cosmos/cosmos-sdk/pull/17024) - Introduces `Triple`, a composite key with three keys. +* [#17024](https://github.com/cosmos/cosmos-sdk/pull/17024) Introduces `Triple`, a composite key with three keys. ### API Breaking -* [#17290](https://github.com/cosmos/cosmos-sdk/pull/17290) - Collections iteration methods (Iterate, Walk) will not error when the collection is empty. +* [#17290](https://github.com/cosmos/cosmos-sdk/pull/17290) Collections iteration methods (Iterate, Walk) will not error when the collection is empty. ### Improvements @@ -55,20 +56,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features -* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16607) - Introduces `Clear` method for `Map` and `KeySet` +* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16607) Introduces `Clear` method for `Map` and `KeySet` * [#16773](https://github.com/cosmos/cosmos-sdk/pull/16773) - * Adds `AltValueCodec` which provides a way to decode a value in two ways. - * Adds the possibility to specify an alternative way to decode the values of `KeySet`, `indexes.Multi`, `indexes.ReversePair`. + * Adds `AltValueCodec` which provides a way to decode a value in two ways. + * Adds the possibility to specify an alternative way to decode the values of `KeySet`, `indexes.Multi`, `indexes.ReversePair`. ## [v0.2.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.2.0) ### Features -* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) – Makes the generic Collection interface public, still highly unstable. +* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) Makes the generic Collection interface public, still highly unstable. ### API Breaking -* [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) – In the `Walk` method the call back function being passed is allowed to error. +* [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) In the `Walk` method the call back function being passed is allowed to error. ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.1.0) diff --git a/collections/json.go b/collections/json.go new file mode 100644 index 000000000000..6b6866ecfbdc --- /dev/null +++ b/collections/json.go @@ -0,0 +1,58 @@ +package collections + +import ( + "encoding/json" + "fmt" + + "cosmossdk.io/collections/codec" +) + +func NewJSONValueCodec[T any]() codec.ValueCodec[T] { + return jsonValue[T]{ + typeName: fmt.Sprintf("%T", new(T)), + } +} + +type jsonValue[T any] struct { + typeName string +} + +// Decode implements codec.ValueCodec. +func (jsonValue[T]) Decode(b []byte) (T, error) { + var t T + if err := json.Unmarshal(b, &t); err != nil { + return t, err + } + + return t, nil +} + +// DecodeJSON implements codec.ValueCodec. +func (jsonValue[T]) DecodeJSON(b []byte) (T, error) { + var t T + if err := json.Unmarshal(b, &t); err != nil { + return t, err + } + + return t, nil +} + +// Encode implements codec.ValueCodec. +func (jsonValue[T]) Encode(value T) ([]byte, error) { + return json.Marshal(value) +} + +// EncodeJSON implements codec.ValueCodec. +func (jsonValue[T]) EncodeJSON(value T) ([]byte, error) { + return json.Marshal(value) +} + +// Stringify implements codec.ValueCodec. +func (jsonValue[T]) Stringify(value T) string { + return fmt.Sprintf("%v", value) +} + +// ValueType implements codec.ValueCodec. +func (jv jsonValue[T]) ValueType() string { + return fmt.Sprintf("json(%s)", jv.typeName) +} diff --git a/go.mod b/go.mod index 668ee0e48882..d9e6cfd397d1 100644 --- a/go.mod +++ b/go.mod @@ -15,11 +15,11 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 github.com/99designs/keyring v1.2.2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 diff --git a/go.sum b/go.sum index a8df3ad45873..9db5895ec33f 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -121,8 +121,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index a565ebfa831b..5416e5ee964d 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -381,7 +381,7 @@ func BootstrapStateCmd[T types.Application](appCreator types.AppCreator[T]) *cob height = app.CommitMultiStore().LastCommitID().Version } - return node.BootstrapState(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, uint64(height), nil) + return node.BootstrapStateWithGenProvider(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, getGenDocProvider(cfg), uint64(height), nil) }, } diff --git a/simapp/app.go b/simapp/app.go index 1c077ed7fb21..27b7add32317 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -287,11 +287,8 @@ func NewSimApp( // add keepers accountsKeeper, err := accounts.NewKeeper( appCodec, - runtime.NewEnvironment(runtime.NewKVStoreService(keys[accounts.StoreKey]), logger), + runtime.NewEnvironment(runtime.NewKVStoreService(keys[accounts.StoreKey]), logger, runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), signingCtx.AddressCodec(), - appCodec, - app.MsgServiceRouter(), - app.GRPCQueryRouter(), appCodec.InterfaceRegistry(), // TESTING: do not add accountstd.AddAccount("counter", counter.NewAccount), @@ -309,7 +306,7 @@ func NewSimApp( } app.AccountsKeeper = accountsKeeper - app.AuthKeeper = authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), logger), appCodec, authtypes.ProtoBaseAccount, maccPerms, signingCtx.AddressCodec(), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountsKeeper) + app.AuthKeeper = authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), logger), appCodec, authtypes.ProtoBaseAccount, accountsKeeper, maccPerms, signingCtx.AddressCodec(), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) app.BankKeeper = bankkeeper.NewBaseKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), logger), @@ -431,7 +428,7 @@ func NewSimApp( app.ModuleManager = module.NewManager( genutil.NewAppModule(appCodec, app.AuthKeeper, app.StakingKeeper, app, txConfig, genutiltypes.DefaultMessageValidator), accounts.NewAppModule(appCodec, app.AccountsKeeper), - auth.NewAppModule(appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + auth.NewAppModule(appCodec, app.AuthKeeper, app.AccountsKeeper, authsims.RandomGenesisAccounts), vesting.NewAppModule(app.AuthKeeper, app.BankKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AuthKeeper), feegrantmodule.NewAppModule(appCodec, app.AuthKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), @@ -523,7 +520,7 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, app.AccountsKeeper, authsims.RandomGenesisAccounts), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) diff --git a/simapp/app_config.go b/simapp/app_config.go index 95d978c7a6cc..1ac042beaa76 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -31,6 +31,7 @@ import ( vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" "cosmossdk.io/x/accounts" + _ "cosmossdk.io/x/accounts" // import for side-effects _ "cosmossdk.io/x/auth/tx/config" // import for side-effects authtypes "cosmossdk.io/x/auth/types" _ "cosmossdk.io/x/auth/vesting" // import for side-effects diff --git a/simapp/app_di.go b/simapp/app_di.go index b223e8e4f797..2630778ebbc2 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -260,7 +260,7 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, &app.AccountsKeeper, authsims.RandomGenesisAccounts), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) diff --git a/simapp/go.mod b/simapp/go.mod index 36fa6263788b..8acf519d189f 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -29,9 +29,9 @@ require ( cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-20240226161501-23359a0b6d91 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.51.0 diff --git a/simapp/go.sum b/simapp/go.sum index 256e6f6fc6d0..efe1f4a3075a 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -197,8 +197,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -325,8 +325,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index d3e09afb3891..3e9e098d664d 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -108,8 +108,8 @@ schema = 3 version = "v0.0.0-20230807174530-cc333fc44b06" hash = "sha256-yZdBXkTVzPxRYntI9I2Gu4gkI11m52Nwl8RNNdlXSrA=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.6" - hash = "sha256-2boDIBhWeQM7c9mAKB23cJ7bHYGf1+Dl0QeFDtO8Usk=" + version = "v0.38.7-0.20240412124004-1f67e396cf45" + hash = "sha256-BYBhYbEiifnEfYzTDnV994yue23vM0wBgfDb18teVV8=" [mod."github.com/cometbft/cometbft-db"] version = "v0.11.0" hash = "sha256-qs3J+9ZW7gStN2W+5SQf/JSmgX5Q5kmIau1BLxze5iE=" @@ -141,8 +141,8 @@ schema = 3 version = "v0.13.3" hash = "sha256-4f73odipfgWku0/gK2UtXbrBXvj8kT9sg4IhnfAP/S0=" [mod."github.com/creachadair/atomicfile"] - version = "v0.3.3" - hash = "sha256-sm0lJGGjpm27HQlOc8C3QgWHjlyjJZ/tKIO5qpSNH7E=" + version = "v0.3.4" + hash = "sha256-iV1Q8QAp3Y28bUa198jXnvV5wpITvuqUkU4aRIytVDI=" [mod."github.com/creachadair/tomledit"] version = "v0.0.26" hash = "sha256-kpn/KpzYdlYMV9vq+AYEJq80S2tbT3xdU1gp6H4WoA8=" @@ -153,8 +153,8 @@ schema = 3 version = "v1.1.2-0.20180830191138-d8f796af33cc" hash = "sha256-fV9oI51xjHdOmEx6+dlq7Ku2Ag+m/bmbzPo6A4Y74qc=" [mod."github.com/decred/dcrd/dcrec/secp256k1/v4"] - version = "v4.2.0" - hash = "sha256-Mw+axGW3RzaRFzcYc7/9/gpqZgWXZHeyT2c4USFtAQA=" + version = "v4.3.0" + hash = "sha256-ADbhI5Ad+q3OxooIiYeLAq5mMONk1gPIAnTch9zKsIM=" [mod."github.com/desertbit/timer"] version = "v0.0.0-20180107155436-c41aec40b27f" hash = "sha256-abLOtEcomAqCWLphd2X6WkD/ED764w6sa6unox4BXss=" @@ -402,8 +402,8 @@ schema = 3 version = "v0.6.0" hash = "sha256-TAD0mm7msYHo99yoNijeYzlDD0i1Vg3uTetpkDUWQo8=" [mod."github.com/prometheus/common"] - version = "v0.50.0" - hash = "sha256-zDhmdO4gGiyKyLuNrMnsoY3pkb9fGZIAHcjP8j26HQI=" + version = "v0.52.2" + hash = "sha256-XQUvk9/Kwf9NDlDUVl7mOWRD7z7z9QEbLH/rNU4D2nI=" [mod."github.com/prometheus/procfs"] version = "v0.13.0" hash = "sha256-J31K36TkIiQU2EGOcmqDa+dkoKXiVuxafPVT4rKbEsg=" @@ -505,29 +505,29 @@ schema = 3 version = "v1.11.0" hash = "sha256-Lb6rHHfR62Ozg2j2JZy3MKOMKdsfzd1IYTR57r3Mhp0=" [mod."golang.org/x/crypto"] - version = "v0.21.0" - hash = "sha256-Z4k1LvFh4Jai7HUe6TTuXSG3VnuiRpMwdARIdZZqSYk=" + version = "v0.22.0" + hash = "sha256-2+u9nd32+Bi7EEv7QFc12CRTbfV7DApNv+yKIr7+lTw=" [mod."golang.org/x/exp"] - version = "v0.0.0-20240314144324-c7f7c6466f7f" - hash = "sha256-RVQIpS6Plx4r82w39/Zn/j0vbSrqcZ3vjVzXMjh772A=" + version = "v0.0.0-20240318143956-a85f2c67cd81" + hash = "sha256-HjEmpjgXqIuGc5rsTVkg6OPAN2fGhfkska7cwRu1qaw=" [mod."golang.org/x/mod"] - version = "v0.15.0" - hash = "sha256-ANSnGmd525BfnkMZpCmu6deMPFGADtnZx3lmZpdm2aM=" + version = "v0.16.0" + hash = "sha256-aN1Cz5Wqd9YCjK8nFW6JWn+n1HfFoEcgYZmGO/FYtbw=" [mod."golang.org/x/net"] - version = "v0.22.0" - hash = "sha256-pcefO4noO9I6mATKBWF6shgIjZvFg0kDsV1Jo/NsFns=" + version = "v0.24.0" + hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ=" [mod."golang.org/x/oauth2"] version = "v0.18.0" hash = "sha256-TX4CvtvHU+SGSmqlxaQqlgJjlJiOtLGYAZa0zeBfZak=" [mod."golang.org/x/sync"] - version = "v0.6.0" - hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI=" + version = "v0.7.0" + hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" [mod."golang.org/x/sys"] - version = "v0.18.0" - hash = "sha256-bIFhfFp7Sj0E1gcE3X3l/jecCfSRLgrkb8f0Yr6tVR0=" + version = "v0.19.0" + hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" [mod."golang.org/x/term"] - version = "v0.18.0" - hash = "sha256-lpze9arFZIhBV8Ht3VZyoiUwqPkeH2IwfXt8M3xljiM=" + version = "v0.19.0" + hash = "sha256-wFwEMwhtsr0C4mqjxukjMM7lxJLYPvb7gAPO95xyhyg=" [mod."golang.org/x/text"] version = "v0.14.0" hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg=" @@ -535,8 +535,8 @@ schema = 3 version = "v0.5.0" hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU=" [mod."golang.org/x/tools"] - version = "v0.18.0" - hash = "sha256-JVz7W13vMPfpGQ1yW+LBlT6INu3ebpjvXyChmAkm5bQ=" + version = "v0.19.0" + hash = "sha256-Xf05Ao398gBzxn5C8H6x+XsLjFLIm+UUfpDekQYA0cw=" [mod."google.golang.org/api"] version = "v0.162.0" hash = "sha256-+AsT4DPjefEmPPelZoSHuQ8nCHhmhhUWU4UGnJ/8+fg=" @@ -544,17 +544,17 @@ schema = 3 version = "v1.6.8" hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" [mod."google.golang.org/genproto"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" - hash = "sha256-XxWl5Ejw/HOet2bm+hqiYj6ZzBCMq6qT6PhVHRsDazk=" + version = "v0.0.0-20240227224415-6ceb2ff114de" + hash = "sha256-G+tvsCTXxzk3sS6HbBxPN1DYaN1tPOqKsa60mI05Feg=" [mod."google.golang.org/genproto/googleapis/api"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" + version = "v0.0.0-20240227224415-6ceb2ff114de" hash = "sha256-H3d2ZhPJI9RH5EK9NsxUAFmT6tr2DgGV9SjZgqJ80r4=" [mod."google.golang.org/genproto/googleapis/rpc"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" - hash = "sha256-XF1eaB8Uwjuii1SVpiZABBhrpszJy5ujOtN+7qAAouM=" + version = "v0.0.0-20240401170217-c3f982113cda" + hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" diff --git a/tests/go.mod b/tests/go.mod index 305a28684890..83e56a0e7b17 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -18,9 +18,9 @@ require ( cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 // this version is not used as it is always replaced by the latest Cosmos SDK version @@ -30,7 +30,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) @@ -47,7 +47,7 @@ require ( cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-20240226161501-23359a0b6d91 github.com/google/go-cmp v0.6.0 - github.com/jhump/protoreflect v1.15.6 + github.com/jhump/protoreflect v1.16.0 ) require ( @@ -74,7 +74,7 @@ require ( github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bufbuild/protocompile v0.8.0 // indirect + github.com/bufbuild/protocompile v0.10.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index a43f5ce5eb0f..9657cf2e34a7 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -199,8 +199,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -266,8 +266,8 @@ github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipus github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bufbuild/protocompile v0.8.0 h1:9Kp1q6OkS9L4nM3FYbr8vlJnEwtbpDPQlQOVXfR+78s= -github.com/bufbuild/protocompile v0.8.0/go.mod h1:+Etjg4guZoAqzVk2czwEQP12yaxLJ8DxuqCJ9qHdH94= +github.com/bufbuild/protocompile v0.10.0 h1:+jW/wnLMLxaCEG8AX9lD0bQ5v9h1RUiMKOBOT5ll9dM= +github.com/bufbuild/protocompile v0.10.0/go.mod h1:G9qQIQo0xZ6Uyj6CMNz0saGmx2so+KONo8/KrELABiY= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -679,8 +679,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jhump/protoreflect v1.15.6 h1:WMYJbw2Wo+KOWwZFvgY0jMoVHM6i4XIvRs2RcBj5VmI= -github.com/jhump/protoreflect v1.15.6/go.mod h1:jCHoyYQIJnaabEYnbGwyo9hUqfyUMTbJw/tAut5t97E= +github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= +github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -1630,8 +1630,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 h1:V7Da7qt0MkY3noVANIMVBk28nOnijADeOR3i5Hcvpj4= +google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/integration/auth/keeper/msg_server_test.go b/tests/integration/auth/keeper/msg_server_test.go new file mode 100644 index 000000000000..f2c629becf01 --- /dev/null +++ b/tests/integration/auth/keeper/msg_server_test.go @@ -0,0 +1,286 @@ +package keeper_test + +import ( + "context" + "fmt" + "strings" + "testing" + + "gotest.tools/v3/assert" + + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/accounts" + baseaccount "cosmossdk.io/x/accounts/defaults/base" + "cosmossdk.io/x/auth" + authkeeper "cosmossdk.io/x/auth/keeper" + authsims "cosmossdk.io/x/auth/simulation" + "cosmossdk.io/x/auth/types" + authtypes "cosmossdk.io/x/auth/types" + "cosmossdk.io/x/bank" + "cosmossdk.io/x/bank/keeper" + bankkeeper "cosmossdk.io/x/bank/keeper" + "cosmossdk.io/x/bank/testutil" + banktypes "cosmossdk.io/x/bank/types" + minttypes "cosmossdk.io/x/mint/types" + "cosmossdk.io/x/tx/signing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil/integration" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" +) + +type fixture struct { + app *integration.App + + cdc codec.Codec + ctx sdk.Context + + authKeeper authkeeper.AccountKeeper + accountsKeeper accounts.Keeper + bankKeeper bankkeeper.Keeper +} + +var _ signing.SignModeHandler = directHandler{} + +type directHandler struct{} + +func (s directHandler) Mode() signingv1beta1.SignMode { + return signingv1beta1.SignMode_SIGN_MODE_DIRECT +} + +func (s directHandler) GetSignBytes(_ context.Context, _ signing.SignerData, _ signing.TxData) ([]byte, error) { + panic("not implemented") +} + +func initFixture(t *testing.T) *fixture { + t.Helper() + keys := storetypes.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, accounts.StoreKey, + ) + encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{}, accounts.AppModule{}) + cdc := encodingCfg.Codec + + logger := log.NewTestLogger(t) + cms := integration.CreateMultiStore(keys, logger) + + newCtx := sdk.NewContext(cms, true, logger) + + router := baseapp.NewMsgServiceRouter() + router.SetInterfaceRegistry(cdc.InterfaceRegistry()) + queryRouter := baseapp.NewGRPCQueryRouter() + queryRouter.SetInterfaceRegistry(cdc.InterfaceRegistry()) + + handler := directHandler{} + account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler)) + accountsKeeper, err := accounts.NewKeeper( + cdc, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[accounts.StoreKey]), log.NewNopLogger(), runtime.EnvWithRouterService(queryRouter, router)), + addresscodec.NewBech32Codec("cosmos"), + cdc.InterfaceRegistry(), + account, + ) + assert.NilError(t, err) + + authority := authtypes.NewModuleAddress("gov") + + authKeeper := authkeeper.NewAccountKeeper( + runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), + cdc, + authtypes.ProtoBaseAccount, + accountsKeeper, + map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), + sdk.Bech32MainPrefix, + authority.String(), + ) + + blockedAddresses := map[string]bool{ + authKeeper.GetAuthority(): false, + } + bankKeeper := keeper.NewBaseKeeper( + runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), log.NewNopLogger()), + cdc, + authKeeper, + blockedAddresses, + authority.String(), + ) + + params := banktypes.DefaultParams() + assert.NilError(t, bankKeeper.SetParams(newCtx, params)) + + accountsModule := accounts.NewAppModule(cdc, accountsKeeper) + authModule := auth.NewAppModule(cdc, authKeeper, accountsKeeper, authsims.RandomGenesisAccounts) + bankModule := bank.NewAppModule(cdc, bankKeeper, authKeeper) + + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, + encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), + encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), + map[string]appmodule.AppModule{ + accounts.ModuleName: accountsModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + }) + + authtypes.RegisterInterfaces(cdc.InterfaceRegistry()) + banktypes.RegisterInterfaces(cdc.InterfaceRegistry()) + + authtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), authkeeper.NewMsgServerImpl(authKeeper)) + authtypes.RegisterQueryServer(integrationApp.QueryHelper(), authkeeper.NewQueryServer(authKeeper)) + + banktypes.RegisterMsgServer(router, bankkeeper.NewMsgServerImpl(bankKeeper)) + + return &fixture{ + app: integrationApp, + cdc: cdc, + ctx: newCtx, + accountsKeeper: accountsKeeper, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + } +} + +func TestAsyncExec(t *testing.T) { + t.Parallel() + f := initFixture(t) + + addrs := simtestutil.CreateIncrementalAccounts(2) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))) + + assert.NilError(t, testutil.FundAccount(f.ctx, f.bankKeeper, addrs[0], sdk.NewCoins(sdk.NewInt64Coin("stake", 500)))) + + msg := &banktypes.MsgSend{ + FromAddress: addrs[0].String(), + ToAddress: addrs[1].String(), + Amount: coins, + } + msg2 := &banktypes.MsgSend{ + FromAddress: addrs[1].String(), + ToAddress: addrs[0].String(), + Amount: coins, + } + failingMsg := &banktypes.MsgSend{ + FromAddress: addrs[0].String(), + ToAddress: addrs[1].String(), + Amount: sdk.NewCoins(sdk.NewCoin("stake", sdkmath.ZeroInt())), // No amount specified + } + + msgAny, err := codectypes.NewAnyWithValue(msg) + assert.NilError(t, err) + + msgAny2, err := codectypes.NewAnyWithValue(msg2) + assert.NilError(t, err) + + failingMsgAny, err := codectypes.NewAnyWithValue(failingMsg) + assert.NilError(t, err) + + testCases := []struct { + name string + req *types.MsgNonAtomicExec + expectErr bool + expErrMsg string + }{ + { + name: "empty signer address", + req: &types.MsgNonAtomicExec{ + Signer: "", + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "empty signer address string is not allowed", + }, + { + name: "invalid signer address", + req: &types.MsgNonAtomicExec{ + Signer: "invalid", + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "invalid signer address", + }, + { + name: "empty msgs", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "messages cannot be empty", + }, + { + name: "valid msg", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny}, + }, + expectErr: false, + }, + { + name: "multiple messages being executed", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, msgAny}, + }, + expectErr: false, + }, + { + name: "multiple messages with different signers", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, msgAny2}, + }, + expectErr: false, + expErrMsg: "unauthorized: sender does not match expected sender", + }, + { + name: "multi msg with one failing being executed", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, failingMsgAny}, + }, + expectErr: false, + expErrMsg: "invalid coins", + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + res, err := f.app.RunMsg( + tc.req, + integration.WithAutomaticFinalizeBlock(), + integration.WithAutomaticCommit(), + ) + if tc.expectErr { + assert.ErrorContains(t, err, tc.expErrMsg) + } else { + assert.NilError(t, err) + assert.Assert(t, res != nil) + + // check the result + result := authtypes.MsgNonAtomicExecResponse{} + err = f.cdc.Unmarshal(res.Value, &result) + assert.NilError(t, err) + + if tc.expErrMsg != "" { + for _, res := range result.Results { + if res.Error != "" { + assert.Assert(t, strings.Contains(res.Error, tc.expErrMsg), fmt.Sprintf("res.Error %s does not contain %s", res.Error, tc.expErrMsg)) + } + continue + } + } + } + }) + } +} diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index ec399463c11d..2f126d5ab386 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -13,6 +14,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" _ "cosmossdk.io/x/auth/tx/config" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" @@ -78,15 +80,19 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { minttypes.ModuleName: {authtypes.Minter}, } + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - nil, ) blockedAddresses := map[string]bool{ @@ -101,7 +107,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { authority.String(), ) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index 386e5edab56a..cd2d89333f0d 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -95,11 +95,11 @@ func initFixture(t *testing.T) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ @@ -122,7 +122,7 @@ func initFixture(t *testing.T) *fixture { cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[distrtypes.StoreKey]), logger), accountKeeper, bankKeeper, stakingKeeper, poolKeeper, distrtypes.ModuleName, authority.String(), ) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) distrModule := distribution.NewAppModule(cdc, distrKeeper, accountKeeper, bankKeeper, stakingKeeper, poolKeeper) diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index d0b890abe627..62b3a6362d76 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -115,11 +115,11 @@ func initFixture(tb testing.TB) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ @@ -144,7 +144,7 @@ func initFixture(tb testing.TB) *fixture { router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, cdc.InterfaceRegistry()) diff --git a/tests/integration/example/example_test.go b/tests/integration/example/example_test.go index b995e00b18c4..bc87760e114b 100644 --- a/tests/integration/example/example_test.go +++ b/tests/integration/example/example_test.go @@ -3,7 +3,9 @@ package integration_test import ( "fmt" "io" + "testing" + "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" "cosmossdk.io/core/appmodule" @@ -12,6 +14,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/mint" mintkeeper "cosmossdk.io/x/mint/keeper" @@ -42,19 +45,23 @@ func Example() { cms := integration.CreateMultiStore(keys, logger) newCtx := sdk.NewContext(cms, true, logger) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encodingCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, addresscodec.NewBech32Codec("cosmos"), "cosmos", authority, - nil, ) // subspace is nil because we don't test params (which is legacy anyway) - authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) // here bankkeeper and staking keeper is nil because we are not testing them // subspace is nil because we don't test params (which is legacy anyway) @@ -134,19 +141,23 @@ func Example_oneModule() { cms := integration.CreateMultiStore(keys, logger) newCtx := sdk.NewContext(cms, true, logger) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encodingCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, addresscodec.NewBech32Codec("cosmos"), "cosmos", authority, - nil, ) // subspace is nil because we don't test params (which is legacy anyway) - authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) // create the application and register all the modules from the previous step integrationApp := integration.NewIntegrationApp( diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 426e80037dde..55d3b2154c33 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -82,11 +82,11 @@ func initFixture(tb testing.TB) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ @@ -132,7 +132,7 @@ func initFixture(tb testing.TB) *fixture { err = govKeeper.Params.Set(newCtx, v1.DefaultParams()) assert.NilError(tb, err) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) govModule := gov.NewAppModule(cdc, govKeeper, accountKeeper, bankKeeper, poolKeeper) diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index 09fec08e575e..a9c325ab348e 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -83,11 +83,11 @@ func initFixture(tb testing.TB) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index c67341031eb1..35b9f6300966 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -132,11 +132,11 @@ func initFixture(tb testing.TB) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ @@ -152,7 +152,7 @@ func initFixture(tb testing.TB) *fixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[types.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) diff --git a/tests/integration/staking/keeper/deterministic_test.go b/tests/integration/staking/keeper/deterministic_test.go index 3c90367d4025..12182e992d66 100644 --- a/tests/integration/staking/keeper/deterministic_test.go +++ b/tests/integration/staking/keeper/deterministic_test.go @@ -96,11 +96,11 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), - acctsModKeeper, ) blockedAddresses := map[string]bool{ @@ -116,7 +116,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) diff --git a/tests/sims/nft/app_config.go b/tests/sims/nft/app_config.go index 156056fe4bdf..52edcb502b93 100644 --- a/tests/sims/nft/app_config.go +++ b/tests/sims/nft/app_config.go @@ -1,7 +1,7 @@ package nft import ( - _ "cosmossdk.io/x/accounts" + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index 11ecf6b1a7a7..6fff73f43823 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -82,7 +82,7 @@ require ( cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 // indirect cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -106,7 +106,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect diff --git a/tests/starship/tests/go.sum b/tests/starship/tests/go.sum index 37b721a6da81..f19905d71c51 100644 --- a/tests/starship/tests/go.sum +++ b/tests/starship/tests/go.sum @@ -199,8 +199,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index bd80418bd33e..8b2dd6dd19c2 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.1.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index b1dd2c57e532..0e7ecf54e7ab 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 9eed1285d429..1d1e2a3e33ad 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -23,7 +23,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.1.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 52e782e83794..8e98d63ab405 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= cosmossdk.io/x/upgrade v0.1.2-0.20240403102038-f63e5fdf7c96 h1:aJHYOadskHueWvIPgPkhhZxbN74sRiRY+E5ynsv0uSE= cosmossdk.io/x/upgrade v0.1.2-0.20240403102038-f63e5fdf7c96/go.mod h1:zRrWkouBVAq8o4eLB5EuMo8hLXF121zcdGamwQ6wf/w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 2468db63ca24..7de61967a97d 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.1.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index 0887b02add5a..618a783127db 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/x/accounts/cli/cli.go b/x/accounts/cli/cli.go index ed7de6d51618..a8ebbd914d21 100644 --- a/x/accounts/cli/cli.go +++ b/x/accounts/cli/cli.go @@ -49,7 +49,10 @@ func GetTxInitCmd() *cobra.Command { if err != nil { return err } - sender := clientCtx.GetFromAddress() + sender, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } // we need to convert the message from json to a protobuf message // to know which message to use, we need to know the account type @@ -67,7 +70,7 @@ func GetTxInitCmd() *cobra.Command { return err } msg := v1.MsgInit{ - Sender: sender.String(), + Sender: sender, AccountType: args[0], Message: msgBytes, } @@ -89,7 +92,10 @@ func GetExecuteCmd() *cobra.Command { if err != nil { return err } - sender := clientCtx.GetFromAddress() + sender, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } schema, err := getSchemaForAccount(clientCtx, args[0]) if err != nil { @@ -101,7 +107,7 @@ func GetExecuteCmd() *cobra.Command { return err } msg := v1.MsgExecute{ - Sender: sender.String(), + Sender: sender, Target: args[0], Message: msgBytes, } diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index ca699d48ebdf..662b507c7acc 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -20,7 +20,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -38,7 +38,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index 13ac00c9387e..f1bad3ce981b 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -13,8 +13,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -110,8 +110,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/x/accounts/depinject.go b/x/accounts/depinject.go index 8714d98ba1d9..1c7e9919fdf8 100644 --- a/x/accounts/depinject.go +++ b/x/accounts/depinject.go @@ -34,9 +34,10 @@ type ModuleInputs struct { Cdc codec.Codec Environment appmodule.Environment AddressCodec address.Codec - ExecRouter MsgRouter - QueryRouter QueryRouter Registry cdctypes.InterfaceRegistry + + // TODO: Add a way to inject custom accounts. + // Currently only the base account is supported. } type ModuleOutputs struct { @@ -61,10 +62,7 @@ func (s directHandler) GetSignBytes(_ context.Context, _ signing.SignerData, _ s func ProvideModule(in ModuleInputs) ModuleOutputs { handler := directHandler{} account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler)) - accountskeeper, err := NewKeeper( - in.Cdc, in.Environment, in.AddressCodec, in.Cdc, - in.ExecRouter, in.QueryRouter, in.Registry, account, - ) + accountskeeper, err := NewKeeper(in.Cdc, in.Environment, in.AddressCodec, in.Registry, account) if err != nil { panic(err) } diff --git a/x/accounts/genesis_test.go b/x/accounts/genesis_test.go index f81bd669b565..0c5c25b13304 100644 --- a/x/accounts/genesis_test.go +++ b/x/accounts/genesis_test.go @@ -1,7 +1,6 @@ package accounts import ( - "context" "testing" "github.com/cosmos/gogoproto/types" @@ -16,7 +15,6 @@ func TestGenesis(t *testing.T) { acc, err := NewTestAccount(deps) return "test", acc, err }) - k.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { return nil }) // we init two accounts of the same type // we set counter to 10 diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 68d121255350..605121a6c4dd 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.3.1 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 @@ -44,7 +44,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index 939199ac2c28..b1fbb366190e 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/accounts/internal/implementation/implementation.go b/x/accounts/internal/implementation/implementation.go index cb55359d04a7..47457af718d1 100644 --- a/x/accounts/internal/implementation/implementation.go +++ b/x/accounts/internal/implementation/implementation.go @@ -30,7 +30,7 @@ type AccountCreatorFunc = func(deps Dependencies) (string, Account, error) // MakeAccountsMap creates a map of account names to account implementations // from a list of account creator functions. func MakeAccountsMap( - cdc codec.BinaryCodec, + cdc codec.Codec, addressCodec address.Codec, env appmodule.Environment, accounts []AccountCreatorFunc, diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 667f6c19a742..6dd4004d7b0f 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -8,8 +8,6 @@ import ( "errors" "fmt" - gogoproto "github.com/cosmos/gogoproto/proto" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/runtime/protoiface" "cosmossdk.io/collections" @@ -37,47 +35,23 @@ var ( AccountByNumber = collections.NewPrefix(2) ) -// QueryRouter represents a router which can be used to route queries to the correct module. -// It returns the handler given the message name, if multiple handlers are returned, then -// it is up to the caller to choose which one to call. -type QueryRouter interface { - HybridHandlerByRequestName(name string) []func(ctx context.Context, req, resp implementation.ProtoMsg) error -} - -// MsgRouter represents a router which can be used to route messages to the correct module. -type MsgRouter interface { - HybridHandlerByMsgName(msgName string) func(ctx context.Context, req, resp implementation.ProtoMsg) error - ResponseNameByMsgName(name string) string -} - -// SignerProvider defines an interface used to get the expected sender from a message. -type SignerProvider interface { - // GetMsgV1Signers returns the signers of the message. - GetMsgV1Signers(msg gogoproto.Message) ([][]byte, proto.Message, error) -} - type InterfaceRegistry interface { RegisterInterface(name string, iface any, impls ...protoiface.MessageV1) RegisterImplementations(iface any, impls ...protoiface.MessageV1) } func NewKeeper( - cdc codec.BinaryCodec, + cdc codec.Codec, env appmodule.Environment, addressCodec address.Codec, - signerProvider SignerProvider, - execRouter MsgRouter, - queryRouter QueryRouter, ir InterfaceRegistry, accounts ...accountstd.AccountCreatorFunc, ) (Keeper, error) { sb := collections.NewSchemaBuilder(env.KVStoreService) keeper := Keeper{ environment: env, + codec: cdc, addressCodec: addressCodec, - msgRouter: execRouter, - signerProvider: signerProvider, - queryRouter: queryRouter, makeSendCoinsMsg: defaultCoinsTransferMsgFunc(addressCodec), Schema: collections.Schema{}, AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), @@ -103,9 +77,7 @@ type Keeper struct { // deps coming from the runtime environment appmodule.Environment addressCodec address.Codec - msgRouter MsgRouter // todo use env - signerProvider SignerProvider - queryRouter QueryRouter // todo use env + codec codec.Codec makeSendCoinsMsg coinsTransferMsgFunc accounts map[string]implementation.Implementation @@ -302,7 +274,7 @@ func (k Keeper) makeAccountContext(ctx context.Context, accountNumber uint64, ac sender, funds, k.sendModuleMessage, - k.sendModuleMessageUntyped, + k.SendModuleMessageUntyped, k.queryModule, ) } @@ -336,7 +308,7 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages if err != nil { return nil, err } - resp, err := k.sendModuleMessageUntyped(ctx, sender, msg) + resp, err := k.SendModuleMessageUntyped(ctx, sender, msg) if err != nil { return nil, fmt.Errorf("failed to execute message %d: %s", i, err.Error()) } @@ -349,20 +321,14 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages return anyResponses, nil } -// sendModuleMessageUntyped can be used to send a message towards a module. +// SendModuleMessageUntyped can be used to send a message towards a module. // It should be used when the response type is not known by the caller. -func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error) { - // we need to fetch the response type from the request message type. - // this is because the response type is not known. - respName := k.msgRouter.ResponseNameByMsgName(implementation.MessageName(msg)) - if respName == "" { - return nil, fmt.Errorf("could not find response type for message %T", msg) - } - // get response type - resp, err := implementation.FindMessageByName(respName) +func (k Keeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error) { + resp, err := k.environment.RouterService.MessageRouterService().InvokeUntyped(ctx, msg) if err != nil { return nil, err } + // send the message return resp, k.sendModuleMessage(ctx, sender, msg, resp) } @@ -372,7 +338,7 @@ func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg // is not trying to impersonate another account. func (k Keeper) sendModuleMessage(ctx context.Context, sender []byte, msg, msgResp implementation.ProtoMsg) error { // do sender assertions. - wantSenders, _, err := k.signerProvider.GetMsgV1Signers(msg) + wantSenders, _, err := k.codec.GetMsgV1Signers(msg) if err != nil { return fmt.Errorf("cannot get signers: %w", err) } @@ -382,27 +348,14 @@ func (k Keeper) sendModuleMessage(ctx context.Context, sender []byte, msg, msgRe if !bytes.Equal(sender, wantSenders[0]) { return fmt.Errorf("%w: sender does not match expected sender", ErrUnauthorized) } - messageName := implementation.MessageName(msg) - handler := k.msgRouter.HybridHandlerByMsgName(messageName) - if handler == nil { - return fmt.Errorf("unknown message: %s", messageName) - } - return handler(ctx, msg, msgResp) + return k.environment.RouterService.MessageRouterService().InvokeTyped(ctx, msg, msgResp) } // queryModule is the entrypoint for an account to query a module. // It will try to find the query handler for the given query and execute it. // If multiple query handlers are found, it will return an error. func (k Keeper) queryModule(ctx context.Context, queryReq, queryResp implementation.ProtoMsg) error { - queryName := implementation.MessageName(queryReq) - handlers := k.queryRouter.HybridHandlerByRequestName(queryName) - if len(handlers) == 0 { - return fmt.Errorf("unknown query: %s", queryName) - } - if len(handlers) > 1 { - return fmt.Errorf("multiple handlers for query: %s", queryName) - } - return handlers[0](ctx, queryReq, queryResp) + return k.environment.RouterService.QueryRouterService().InvokeTyped(ctx, queryReq, queryResp) } // maybeSendFunds will send the provided coins between the provided addresses, if amt diff --git a/x/accounts/keeper_test.go b/x/accounts/keeper_test.go index be02ccb27502..b0532cd766c4 100644 --- a/x/accounts/keeper_test.go +++ b/x/accounts/keeper_test.go @@ -1,15 +1,11 @@ package accounts import ( - "context" "testing" "github.com/cosmos/gogoproto/types" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/collections" "cosmossdk.io/x/accounts/accountstd" "cosmossdk.io/x/accounts/internal/implementation" @@ -17,13 +13,6 @@ import ( func TestKeeper_Init(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { - _, ok := req.(*bankv1beta1.QueryBalanceRequest) - require.True(t, ok) - _, ok = resp.(*bankv1beta1.QueryBalanceResponse) - require.True(t, ok) - return nil - }) t.Run("ok", func(t *testing.T) { sender := []byte("sender") @@ -52,7 +41,6 @@ func TestKeeper_Init(t *testing.T) { func TestKeeper_Execute(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { return nil }) // create account sender := []byte("sender") @@ -71,20 +59,6 @@ func TestKeeper_Execute(t *testing.T) { }) t.Run("exec module", func(t *testing.T) { - m.msgRouter = mockExec(func(ctx context.Context, msg, msgResp implementation.ProtoMsg) error { - concrete, ok := msg.(*bankv1beta1.MsgSend) - require.True(t, ok) - require.Equal(t, concrete.ToAddress, "recipient") - _, ok = msgResp.(*bankv1beta1.MsgSendResponse) - require.True(t, ok) - return nil - }) - - m.signerProvider = mockSigner(func(msg implementation.ProtoMsg) ([]byte, error) { - require.Equal(t, msg.(*bankv1beta1.MsgSend).FromAddress, string(accAddr)) - return accAddr, nil - }) - resp, err := m.Execute(ctx, accAddr, sender, &types.Int64Value{Value: 1000}, nil) require.NoError(t, err) require.True(t, implementation.Equal(&types.Empty{}, resp)) @@ -93,9 +67,6 @@ func TestKeeper_Execute(t *testing.T) { func TestKeeper_Query(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { - return nil - }) // create account sender := []byte("sender") @@ -114,21 +85,6 @@ func TestKeeper_Query(t *testing.T) { }) t.Run("query module", func(t *testing.T) { - // we inject the module query function, which accepts only a specific type of message - // we force the response - m.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { - concrete, ok := req.(*bankv1beta1.QueryBalanceRequest) - require.True(t, ok) - require.Equal(t, string(accAddr), concrete.Address) - require.Equal(t, concrete.Denom, "atom") - copyResp := &bankv1beta1.QueryBalanceResponse{Balance: &basev1beta1.Coin{ - Denom: "atom", - Amount: "1000", - }} - proto.Merge(resp.(proto.Message), copyResp) - return nil - }) - resp, err := m.Query(ctx, accAddr, &types.StringValue{Value: "atom"}) require.NoError(t, err) require.True(t, implementation.Equal(&types.Int64Value{Value: 1000}, resp)) diff --git a/x/accounts/msg_server_test.go b/x/accounts/msg_server_test.go index 1b96e415247c..23d4cc66c684 100644 --- a/x/accounts/msg_server_test.go +++ b/x/accounts/msg_server_test.go @@ -1,15 +1,12 @@ package accounts import ( - "context" "testing" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/wrapperspb" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "cosmossdk.io/x/accounts/accountstd" "cosmossdk.io/x/accounts/internal/implementation" v1 "cosmossdk.io/x/accounts/v1" @@ -17,13 +14,6 @@ import ( func TestMsgServer(t *testing.T) { k, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - k.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { - _, ok := req.(*bankv1beta1.QueryBalanceRequest) - require.True(t, ok) - proto.Merge(resp.(proto.Message), &bankv1beta1.QueryBalanceResponse{}) - return nil - }) - s := NewMsgServer(k) // create diff --git a/x/accounts/query_server_test.go b/x/accounts/query_server_test.go index bc4913458a28..91a14caba3d4 100644 --- a/x/accounts/query_server_test.go +++ b/x/accounts/query_server_test.go @@ -1,7 +1,6 @@ package accounts import ( - "context" "testing" "github.com/cosmos/gogoproto/types" @@ -16,9 +15,6 @@ import ( func TestQueryServer(t *testing.T) { k, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - k.queryRouter = mockQuery(func(ctx context.Context, req, resp implementation.ProtoMsg) error { - return nil - }) ms := NewMsgServer(k) qs := NewQueryServer(k) diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go index 0fec9839686d..837b9b8ccfe3 100644 --- a/x/accounts/utils_test.go +++ b/x/accounts/utils_test.go @@ -6,16 +6,23 @@ import ( gogoproto "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/collections/colltest" "cosmossdk.io/core/address" "cosmossdk.io/core/event" "cosmossdk.io/log" "cosmossdk.io/x/accounts/internal/implementation" + "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ address.Codec = (*addressCodec)(nil) @@ -35,56 +42,63 @@ func (e eventService) EmitKV(eventType string, attrs ...event.Attribute) error { func (e eventService) EventManager(ctx context.Context) event.Manager { return e } -var _ InterfaceRegistry = (*interfaceRegistry)(nil) - -type interfaceRegistry struct{} - -func (i interfaceRegistry) RegisterInterface(string, any, ...protoiface.MessageV1) {} - -func (i interfaceRegistry) RegisterImplementations(any, ...protoiface.MessageV1) {} - func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Keeper, context.Context) { t.Helper() + + addressCodec := addressCodec{} + ir, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{ + ProtoFiles: gogoproto.HybridResolver, + SigningOptions: signing.Options{ + FileResolver: gogoproto.HybridResolver, + TypeResolver: protoregistry.GlobalTypes, + AddressCodec: addressCodec, + ValidatorAddressCodec: addressCodec, + }, + }) + if err != nil { + t.Fatal(err) + } + msgRouter := baseapp.NewMsgServiceRouter() + msgRouter.SetInterfaceRegistry(ir) + queryRouter := baseapp.NewGRPCQueryRouter() + queryRouter.SetInterfaceRegistry(ir) + + ir.RegisterImplementations((*sdk.Msg)(nil), + &bankv1beta1.MsgSend{}, + &bankv1beta1.MsgBurn{}, + &bankv1beta1.MsgSetSendEnabled{}, + &bankv1beta1.MsgMultiSend{}, + &bankv1beta1.MsgUpdateParams{}, + ) + queryRouter.RegisterService(&bankv1beta1.Query_ServiceDesc, &bankQueryServer{}) + msgRouter.RegisterService(&bankv1beta1.Msg_ServiceDesc, &bankMsgServer{}) + ss, ctx := colltest.MockStore() - env := runtime.NewEnvironment(ss, log.NewNopLogger()) + env := runtime.NewEnvironment(ss, log.NewNopLogger(), runtime.EnvWithRouterService( + queryRouter, + msgRouter, + )) env.EventService = eventService{} - m, err := NewKeeper(nil, env, addressCodec{}, nil, nil, nil, interfaceRegistry{}, accounts...) + m, err := NewKeeper(codec.NewProtoCodec(ir), env, addressCodec, ir, accounts...) require.NoError(t, err) return m, ctx } -var _ QueryRouter = (*mockQuery)(nil) - -type mockQuery func(ctx context.Context, req, resp implementation.ProtoMsg) error - -func (m mockQuery) HybridHandlerByRequestName(_ string) []func(ctx context.Context, req, resp implementation.ProtoMsg) error { - return []func(ctx context.Context, req, resp protoiface.MessageV1) error{func(ctx context.Context, req, resp protoiface.MessageV1) error { - return m(ctx, req, resp) - }} +type bankQueryServer struct { + bankv1beta1.UnimplementedQueryServer } -var _ SignerProvider = (*mockSigner)(nil) - -type mockSigner func(msg implementation.ProtoMsg) ([]byte, error) - -func (m mockSigner) GetMsgV1Signers(msg gogoproto.Message) ([][]byte, proto.Message, error) { - s, err := m(msg) - if err != nil { - return nil, nil, err - } - return [][]byte{s}, nil, nil +func (b bankQueryServer) Balance(context.Context, *bankv1beta1.QueryBalanceRequest) (*bankv1beta1.QueryBalanceResponse, error) { + return &bankv1beta1.QueryBalanceResponse{Balance: &basev1beta1.Coin{ + Denom: "atom", + Amount: "1000", + }}, nil } -var _ MsgRouter = (*mockExec)(nil) - -type mockExec func(ctx context.Context, msg, msgResp implementation.ProtoMsg) error - -func (m mockExec) HybridHandlerByMsgName(_ string) func(ctx context.Context, req, resp protoiface.MessageV1) error { - return func(ctx context.Context, req, resp protoiface.MessageV1) error { - return m(ctx, req, resp) - } +type bankMsgServer struct { + bankv1beta1.UnimplementedMsgServer } -func (m mockExec) ResponseNameByMsgName(name string) string { - return name + "Response" +func (b bankMsgServer) Send(context.Context, *bankv1beta1.MsgSend) (*bankv1beta1.MsgSendResponse, error) { + return &bankv1beta1.MsgSendResponse{}, nil } diff --git a/x/auth/ante/testutil/expected_keepers_mocks.go b/x/auth/ante/testutil/expected_keepers_mocks.go index 091ae6477359..ebe73dfecac7 100644 --- a/x/auth/ante/testutil/expected_keepers_mocks.go +++ b/x/auth/ante/testutil/expected_keepers_mocks.go @@ -9,11 +9,49 @@ import ( reflect "reflect" address "cosmossdk.io/core/address" + appmodule "cosmossdk.io/core/appmodule" types "cosmossdk.io/x/auth/types" types0 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" ) +// MockHasEnvironment is a mock of HasEnvironment interface. +type MockHasEnvironment struct { + ctrl *gomock.Controller + recorder *MockHasEnvironmentMockRecorder +} + +// MockHasEnvironmentMockRecorder is the mock recorder for MockHasEnvironment. +type MockHasEnvironmentMockRecorder struct { + mock *MockHasEnvironment +} + +// NewMockHasEnvironment creates a new mock instance. +func NewMockHasEnvironment(ctrl *gomock.Controller) *MockHasEnvironment { + mock := &MockHasEnvironment{ctrl: ctrl} + mock.recorder = &MockHasEnvironmentMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockHasEnvironment) EXPECT() *MockHasEnvironmentMockRecorder { + return m.recorder +} + +// Environment mocks base method. +func (m *MockHasEnvironment) Environment() appmodule.Environment { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Environment") + ret0, _ := ret[0].(appmodule.Environment) + return ret0 +} + +// Environment indicates an expected call of Environment. +func (mr *MockHasEnvironmentMockRecorder) Environment() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Environment", reflect.TypeOf((*MockHasEnvironment)(nil).Environment)) +} + // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller @@ -51,6 +89,20 @@ func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddressCodec", reflect.TypeOf((*MockAccountKeeper)(nil).AddressCodec)) } +// Environment mocks base method. +func (m *MockAccountKeeper) Environment() appmodule.Environment { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Environment") + ret0, _ := ret[0].(appmodule.Environment) + return ret0 +} + +// Environment indicates an expected call of Environment. +func (mr *MockAccountKeeperMockRecorder) Environment() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Environment", reflect.TypeOf((*MockAccountKeeper)(nil).Environment)) +} + // GetAccount mocks base method. func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types0.AccAddress) types0.AccountI { m.ctrl.T.Helper() diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 85ff7257dbcb..d002ecb77049 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -51,6 +51,7 @@ type AnteTestSuite struct { txBuilder client.TxBuilder accountKeeper keeper.AccountKeeper bankKeeper *authtestutil.MockBankKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper txBankKeeper *txtestutil.MockBankKeeper feeGrantKeeper *antetestutil.MockFeegrantKeeper encCfg moduletestutil.TestEncodingConfig @@ -60,10 +61,12 @@ type AnteTestSuite struct { func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { t.Helper() suite := &AnteTestSuite{} + // gomock initializations ctrl := gomock.NewController(t) suite.bankKeeper = authtestutil.NewMockBankKeeper(ctrl) suite.txBankKeeper = txtestutil.NewMockBankKeeper(ctrl) suite.feeGrantKeeper = antetestutil.NewMockFeegrantKeeper(ctrl) + suite.acctsModKeeper = authtestutil.NewMockAccountsModKeeper(ctrl) key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) @@ -80,8 +83,8 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { } suite.accountKeeper = keeper.NewAccountKeeper( - runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), suite.encCfg.Codec, types.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec("cosmos"), - sdk.Bech32MainPrefix, types.NewModuleAddress("gov").String(), nil, + runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), suite.encCfg.Codec, types.ProtoBaseAccount, suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), + sdk.Bech32MainPrefix, types.NewModuleAddress("gov").String(), ) suite.accountKeeper.GetModuleAccount(suite.ctx, types.FeeCollectorName) err := suite.accountKeeper.Params.Set(suite.ctx, types.DefaultParams()) diff --git a/x/auth/depinject.go b/x/auth/depinject.go index d8f4ca497f84..834912a4de30 100644 --- a/x/auth/depinject.go +++ b/x/auth/depinject.go @@ -27,11 +27,11 @@ func init() { type ModuleInputs struct { depinject.In - AccountsModKeeper types.AccountsModKeeper - Config *modulev1.Module - Environment appmodule.Environment - Cdc codec.Codec + Config *modulev1.Module + Environment appmodule.Environment + Cdc codec.Codec + AccountsModKeeper types.AccountsModKeeper AddressCodec address.Codec RandomGenesisAccountsFn types.RandomGenesisAccountsFn `optional:"true"` @@ -70,8 +70,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { panic(err) } - k := keeper.NewAccountKeeper(in.Environment, in.Cdc, in.AccountI, maccPerms, in.AddressCodec, in.Config.Bech32Prefix, auth, in.AccountsModKeeper) - m := NewAppModule(in.Cdc, k, in.RandomGenesisAccountsFn) + k := keeper.NewAccountKeeper(in.Environment, in.Cdc, in.AccountI, in.AccountsModKeeper, maccPerms, in.AddressCodec, in.Config.Bech32Prefix, auth) + m := NewAppModule(in.Cdc, k, in.AccountsModKeeper, in.RandomGenesisAccountsFn) return ModuleOutputs{AccountKeeper: k, Module: m} } diff --git a/x/auth/go.mod b/x/auth/go.mod index c379c7ed239d..9acb33574510 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -14,8 +14,8 @@ require ( cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/tx v0.13.1 - github.com/cometbft/cometbft v0.38.6 + cosmossdk.io/x/tx v0.13.2 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 diff --git a/x/auth/go.sum b/x/auth/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index f6f7657f50b7..c04b4da279b3 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -6,6 +6,7 @@ import ( "sync/atomic" "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" "pgregory.net/rapid" @@ -16,6 +17,7 @@ import ( "cosmossdk.io/x/auth" authcodec "cosmossdk.io/x/auth/codec" "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -33,13 +35,14 @@ type DeterministicTestSuite struct { accountNumberLanes uint64 - key *storetypes.KVStoreKey - environment appmodule.Environment - ctx sdk.Context - queryClient types.QueryClient - accountKeeper keeper.AccountKeeper - encCfg moduletestutil.TestEncodingConfig - maccPerms map[string][]string + key *storetypes.KVStoreKey + environment appmodule.Environment + ctx sdk.Context + queryClient types.QueryClient + accountKeeper keeper.AccountKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper + encCfg moduletestutil.TestEncodingConfig + maccPerms map[string][]string } var ( @@ -62,6 +65,11 @@ func (suite *DeterministicTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) suite.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(suite.T()) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + suite.acctsModKeeper = acctsModKeeper + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -75,11 +83,11 @@ func (suite *DeterministicTestSuite) SetupTest() { env, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), - nil, ) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.encCfg.InterfaceRegistry) @@ -296,11 +304,11 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccounts() { suite.environment, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), - nil, ) suite.setModuleAccounts(suite.ctx, ak, maccs) @@ -344,11 +352,11 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccountByName() { suite.environment, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), - nil, ) suite.setModuleAccounts(suite.ctx, ak, []string{mName}) diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 1991bae32bf4..1474acbe9eb1 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -115,8 +116,8 @@ var _ AccountKeeperI = &AccountKeeper{} // and don't have to fit into any predefined structure. This auth module does not use account permissions internally, though other modules // may use auth.Keeper to access the accounts permissions map. func NewAccountKeeper( - env appmodule.Environment, cdc codec.BinaryCodec, proto func() sdk.AccountI, - maccPerms map[string][]string, ac address.Codec, bech32Prefix, authority string, accountsModKeeper types.AccountsModKeeper, + env appmodule.Environment, cdc codec.BinaryCodec, proto func() sdk.AccountI, accountsModKeeper types.AccountsModKeeper, + maccPerms map[string][]string, ac address.Codec, bech32Prefix, authority string, ) AccountKeeper { permAddrs := make(map[string]types.PermissionsForAddress) for name, perms := range maccPerms { @@ -131,12 +132,12 @@ func NewAccountKeeper( environment: env, proto: proto, cdc: cdc, + AccountsModKeeper: accountsModKeeper, permAddrs: permAddrs, authority: authority, Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), AccountNumber: collections.NewSequence(sb, types.GlobalAccountNumberKey, "account_number"), Accounts: collections.NewIndexedMap(sb, types.AddressStoreKeyPrefix, "accounts", sdk.AccAddressKey, codec.CollInterfaceValue[sdk.AccountI](cdc), NewAccountIndexes(sb)), - AccountsModKeeper: accountsModKeeper, } schema, err := sb.Build() if err != nil { @@ -281,6 +282,43 @@ func (ak AccountKeeper) GetParams(ctx context.Context) (params types.Params) { return params } +func (ak AccountKeeper) NonAtomicMsgsExec(ctx context.Context, signer sdk.AccAddress, msgs []sdk.Msg) ([]*types.NonAtomicExecResult, error) { + msgResponses := make([]*types.NonAtomicExecResult, 0, len(msgs)) + + for _, msg := range msgs { + if m, ok := msg.(sdk.HasValidateBasic); ok { + if err := m.ValidateBasic(); err != nil { + value := &types.NonAtomicExecResult{Error: err.Error()} + msgResponses = append(msgResponses, value) + continue + } + } + + if err := ak.environment.BranchService.Execute(ctx, func(ctx context.Context) error { + result, err := ak.AccountsModKeeper.SendModuleMessageUntyped(ctx, signer, msg) + if err != nil { + // If an error occurs during message execution, append error response + response := &types.NonAtomicExecResult{Resp: nil, Error: err.Error()} + msgResponses = append(msgResponses, response) + } else { + resp, err := codectypes.NewAnyWithValue(result) + if err != nil { + response := &types.NonAtomicExecResult{Resp: nil, Error: err.Error()} + msgResponses = append(msgResponses, response) + } + response := &types.NonAtomicExecResult{Resp: resp, Error: ""} + msgResponses = append(msgResponses, response) + } + + return nil + }); err != nil { + return nil, err + } + } + + return msgResponses, nil +} + // Environment returns the module's environment. func (ak AccountKeeper) Environment() appmodule.Environment { return ak.environment diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index 78267c01d3ca..579556b8739c 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -12,6 +13,7 @@ import ( "cosmossdk.io/x/auth" authcodec "cosmossdk.io/x/auth/codec" "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -40,10 +42,11 @@ type KeeperTestSuite struct { ctx sdk.Context - queryClient types.QueryClient - accountKeeper keeper.AccountKeeper - msgServer types.MsgServer - encCfg moduletestutil.TestEncodingConfig + queryClient types.QueryClient + accountKeeper keeper.AccountKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper + msgServer types.MsgServer + encCfg moduletestutil.TestEncodingConfig } func (suite *KeeperTestSuite) SetupTest() { @@ -55,6 +58,11 @@ func (suite *KeeperTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) suite.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(suite.T()) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + suite.acctsModKeeper = acctsModKeeper + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -68,11 +76,11 @@ func (suite *KeeperTestSuite) SetupTest() { env, suite.encCfg.Codec, types.ProtoBaseAccount, + acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), - nil, ) suite.msgServer = keeper.NewMsgServerImpl(suite.accountKeeper) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.encCfg.InterfaceRegistry) diff --git a/x/auth/keeper/msg_server.go b/x/auth/keeper/msg_server.go index c66785af36c4..50e3a65b5c39 100644 --- a/x/auth/keeper/msg_server.go +++ b/x/auth/keeper/msg_server.go @@ -2,9 +2,12 @@ package keeper import ( "context" + "errors" "fmt" "cosmossdk.io/x/auth/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var _ types.MsgServer = msgServer{} @@ -20,6 +23,35 @@ func NewMsgServerImpl(ak AccountKeeper) types.MsgServer { } } +func (ms msgServer) NonAtomicExec(goCtx context.Context, msg *types.MsgNonAtomicExec) (*types.MsgNonAtomicExecResponse, error) { + if msg.Signer == "" { + return nil, errors.New("empty signer address string is not allowed") + } + + signer, err := ms.ak.AddressCodec().StringToBytes(msg.Signer) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid signer address: %s", err) + } + + if len(msg.Msgs) == 0 { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("messages cannot be empty") + } + + msgs, err := msg.GetMessages() + if err != nil { + return nil, err + } + + results, err := ms.ak.NonAtomicMsgsExec(goCtx, signer, msgs) + if err != nil { + return nil, err + } + + return &types.MsgNonAtomicExecResponse{ + Results: results, + }, nil +} + func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if ms.ak.authority != msg.Authority { return nil, fmt.Errorf( diff --git a/x/auth/module.go b/x/auth/module.go index 9adf511a096e..8459fd4aa610 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -40,6 +40,7 @@ var ( type AppModule struct { accountKeeper keeper.AccountKeeper randGenAccountsFn types.RandomGenesisAccountsFn + accountsModKeeper types.AccountsModKeeper cdc codec.Codec } @@ -47,10 +48,11 @@ type AppModule struct { func (am AppModule) IsAppModule() {} // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, accountKeeper keeper.AccountKeeper, randGenAccountsFn types.RandomGenesisAccountsFn) AppModule { +func NewAppModule(cdc codec.Codec, accountKeeper keeper.AccountKeeper, ak types.AccountsModKeeper, randGenAccountsFn types.RandomGenesisAccountsFn) AppModule { return AppModule{ accountKeeper: accountKeeper, randGenAccountsFn: randGenAccountsFn, + accountsModKeeper: ak, cdc: cdc, } } diff --git a/x/auth/proto/cosmos/auth/v1beta1/tx.proto b/x/auth/proto/cosmos/auth/v1beta1/tx.proto index 4089d047be56..172525f1d251 100644 --- a/x/auth/proto/cosmos/auth/v1beta1/tx.proto +++ b/x/auth/proto/cosmos/auth/v1beta1/tx.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.auth.v1beta1; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; @@ -18,6 +19,9 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + rpc NonAtomicExec(MsgNonAtomicExec) returns (MsgNonAtomicExecResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -41,3 +45,23 @@ message MsgUpdateParams { // // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} + +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +message MsgNonAtomicExec { + option (cosmos.msg.v1.signer) = "signer"; + + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +message NonAtomicExecResult { + string error = 1; + google.protobuf.Any resp = 2; +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +message MsgNonAtomicExecResponse { + repeated NonAtomicExecResult results = 1; +} diff --git a/x/auth/testutil/app_config.go b/x/auth/testutil/app_config.go index f72850c4bf1a..d7ddcd09c3ff 100644 --- a/x/auth/testutil/app_config.go +++ b/x/auth/testutil/app_config.go @@ -3,7 +3,7 @@ package testutil import ( _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring - _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring + _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring`` _ "cosmossdk.io/x/auth/vesting" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring _ "cosmossdk.io/x/staking" // import as blank for app wiring diff --git a/x/auth/testutil/expected_keepers_mocks.go b/x/auth/testutil/expected_keepers_mocks.go index 2604271001d9..8d4b1f2891be 100644 --- a/x/auth/testutil/expected_keepers_mocks.go +++ b/x/auth/testutil/expected_keepers_mocks.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + protoiface "google.golang.org/protobuf/runtime/protoiface" ) // MockBankKeeper is a mock of BankKeeper interface. @@ -82,7 +83,6 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAd return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } - // MockAccountsModKeeper is a mock of AccountsModKeeper interface. type MockAccountsModKeeper struct { ctrl *gomock.Controller @@ -107,17 +107,30 @@ func (m *MockAccountsModKeeper) EXPECT() *MockAccountsModKeeperMockRecorder { } // IsAccountsModuleAccount mocks base method. -func (m *MockAccountsModKeeper) IsAccountsModuleAccount(ctx context.Context, addr []byte) bool { +func (m *MockAccountsModKeeper) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, addr) + ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, accountAddr) ret0, _ := ret[0].(bool) return ret0 } // IsAccountsModuleAccount indicates an expected call of IsAccountsModuleAccount. -func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, accountAddr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, accountAddr) } +// SendModuleMessageUntyped mocks base method. +func (m *MockAccountsModKeeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendModuleMessageUntyped", ctx, sender, msg) + ret0, _ := ret[0].(protoiface.MessageV1) + ret1, _ := ret[1].(error) + return ret0, ret1 +} +// SendModuleMessageUntyped indicates an expected call of SendModuleMessageUntyped. +func (mr *MockAccountsModKeeperMockRecorder) SendModuleMessageUntyped(ctx, sender, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendModuleMessageUntyped", reflect.TypeOf((*MockAccountsModKeeper)(nil).SendModuleMessageUntyped), ctx, sender, msg) +} diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 685d9eb85dc5..08accef30af9 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -58,5 +58,6 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) { registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, + &MsgNonAtomicExec{}, ) } diff --git a/x/auth/types/expected_keepers.go b/x/auth/types/expected_keepers.go index f7821d91251b..10f3cc4f3331 100644 --- a/x/auth/types/expected_keepers.go +++ b/x/auth/types/expected_keepers.go @@ -3,6 +3,8 @@ package types import ( "context" + "google.golang.org/protobuf/runtime/protoiface" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -15,5 +17,6 @@ type BankKeeper interface { // AccountsModKeeper defines the contract for x/accounts APIs type AccountsModKeeper interface { + SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool } diff --git a/x/auth/types/msgs.go b/x/auth/types/msgs.go new file mode 100644 index 000000000000..6900aab97713 --- /dev/null +++ b/x/auth/types/msgs.go @@ -0,0 +1,20 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// GetMessages returns the cache values from the MsgNonAtomicExec.Msgs if present. +func (msg MsgNonAtomicExec) GetMessages() ([]sdk.Msg, error) { + msgs := make([]sdk.Msg, len(msg.Msgs)) + for i, msgAny := range msg.Msgs { + msg, ok := msgAny.GetCachedValue().(sdk.Msg) + if !ok { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("messages contains %T which is not a sdk.Msg", msgAny) + } + msgs[i] = msg + } + + return msgs, nil +} diff --git a/x/auth/types/tx.pb.go b/x/auth/types/tx.pb.go index 1bda98a785f8..960a79d6585b 100644 --- a/x/auth/types/tx.pb.go +++ b/x/auth/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -130,36 +131,203 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +type MsgNonAtomicExec struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *MsgNonAtomicExec) Reset() { *m = MsgNonAtomicExec{} } +func (m *MsgNonAtomicExec) String() string { return proto.CompactTextString(m) } +func (*MsgNonAtomicExec) ProtoMessage() {} +func (*MsgNonAtomicExec) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{2} +} +func (m *MsgNonAtomicExec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNonAtomicExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNonAtomicExec.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 *MsgNonAtomicExec) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNonAtomicExec.Merge(m, src) +} +func (m *MsgNonAtomicExec) XXX_Size() int { + return m.Size() +} +func (m *MsgNonAtomicExec) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNonAtomicExec.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNonAtomicExec proto.InternalMessageInfo + +func (m *MsgNonAtomicExec) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgNonAtomicExec) GetMsgs() []*types.Any { + if m != nil { + return m.Msgs + } + return nil +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +type NonAtomicExecResult struct { + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Resp *types.Any `protobuf:"bytes,2,opt,name=resp,proto3" json:"resp,omitempty"` +} + +func (m *NonAtomicExecResult) Reset() { *m = NonAtomicExecResult{} } +func (m *NonAtomicExecResult) String() string { return proto.CompactTextString(m) } +func (*NonAtomicExecResult) ProtoMessage() {} +func (*NonAtomicExecResult) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{3} +} +func (m *NonAtomicExecResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NonAtomicExecResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NonAtomicExecResult.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 *NonAtomicExecResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_NonAtomicExecResult.Merge(m, src) +} +func (m *NonAtomicExecResult) XXX_Size() int { + return m.Size() +} +func (m *NonAtomicExecResult) XXX_DiscardUnknown() { + xxx_messageInfo_NonAtomicExecResult.DiscardUnknown(m) +} + +var xxx_messageInfo_NonAtomicExecResult proto.InternalMessageInfo + +func (m *NonAtomicExecResult) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *NonAtomicExecResult) GetResp() *types.Any { + if m != nil { + return m.Resp + } + return nil +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +type MsgNonAtomicExecResponse struct { + Results []*NonAtomicExecResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (m *MsgNonAtomicExecResponse) Reset() { *m = MsgNonAtomicExecResponse{} } +func (m *MsgNonAtomicExecResponse) String() string { return proto.CompactTextString(m) } +func (*MsgNonAtomicExecResponse) ProtoMessage() {} +func (*MsgNonAtomicExecResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{4} +} +func (m *MsgNonAtomicExecResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNonAtomicExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNonAtomicExecResponse.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 *MsgNonAtomicExecResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNonAtomicExecResponse.Merge(m, src) +} +func (m *MsgNonAtomicExecResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgNonAtomicExecResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNonAtomicExecResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNonAtomicExecResponse proto.InternalMessageInfo + +func (m *MsgNonAtomicExecResponse) GetResults() []*NonAtomicExecResult { + if m != nil { + return m.Results + } + return nil +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.auth.v1beta1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.auth.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgNonAtomicExec)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExec") + proto.RegisterType((*NonAtomicExecResult)(nil), "cosmos.auth.v1beta1.NonAtomicExecResult") + proto.RegisterType((*MsgNonAtomicExecResponse)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExecResponse") } func init() { proto.RegisterFile("cosmos/auth/v1beta1/tx.proto", fileDescriptor_c2d62bd9c4c212e5) } var fileDescriptor_c2d62bd9c4c212e5 = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, - 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, - 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x87, 0xda, 0x91, 0x5b, 0x9c, 0xae, - 0x5f, 0x66, 0x08, 0xa2, 0xa0, 0x12, 0x82, 0x89, 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x2a, - 0x24, 0x87, 0xcd, 0x3d, 0x60, 0xeb, 0xc1, 0xf2, 0x4a, 0xfb, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, - 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, - 0x41, 0x2a, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, - 0x6d, 0xd1, 0x15, 0x81, 0x3a, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, - 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x8e, 0x8b, 0xad, 0x00, 0x6c, 0x82, 0x04, 0x93, 0x02, - 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x16, 0xef, 0xea, 0x41, 0x2c, 0x71, 0xe2, 0x3c, 0x71, 0x4f, - 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x56, 0x26, 0x4d, 0xcf, 0x37, 0x68, - 0x21, 0xcc, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x11, 0x62, 0x82, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0xc4, 0x13, 0x68, 0xae, 0x55, 0x92, 0xe4, 0x12, 0x47, 0x13, 0x0a, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, - 0x2b, 0x4e, 0x35, 0x2a, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x4a, 0xe2, 0xe2, 0x41, 0xf1, 0x9f, - 0x0a, 0x56, 0x77, 0xa1, 0x19, 0x22, 0xa5, 0x43, 0x8c, 0x2a, 0x98, 0x55, 0x52, 0xac, 0x0d, 0x20, - 0xaf, 0x38, 0x19, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, - 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x14, 0x34, 0x3e, - 0x8b, 0x53, 0xb2, 0xf5, 0x32, 0xf3, 0x61, 0x7e, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, - 0x47, 0x85, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x09, 0xbc, 0x34, 0x3c, 0x02, 0x00, 0x00, + // 520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0xd1, 0x36, 0x28, 0x17, 0x10, 0xe0, 0x46, 0x6a, 0x9a, 0x22, 0x53, 0x22, 0x90, 0xa2, + 0x88, 0x9c, 0x49, 0x8a, 0x18, 0x3a, 0x20, 0xc5, 0x52, 0xc7, 0x20, 0x64, 0xd4, 0x85, 0x01, 0x64, + 0xc7, 0xc7, 0x61, 0xb5, 0xf6, 0x59, 0xf7, 0x5d, 0xaa, 0x64, 0x43, 0x8c, 0x4c, 0x8c, 0xfc, 0x04, + 0xc6, 0x0c, 0xdd, 0x59, 0x2b, 0xa6, 0x8a, 0x05, 0x26, 0x84, 0x92, 0x21, 0x7f, 0x03, 0xf9, 0xee, + 0xdc, 0x2a, 0x91, 0x51, 0xbb, 0xd8, 0xbe, 0x7b, 0xef, 0xfb, 0xbe, 0xf7, 0xee, 0x9d, 0xf1, 0xfd, + 0x21, 0x87, 0x98, 0x83, 0xe3, 0x8f, 0xe4, 0x07, 0xe7, 0xa4, 0x1b, 0x50, 0xe9, 0x77, 0x1d, 0x39, + 0x26, 0xa9, 0xe0, 0x92, 0x5b, 0x9b, 0x1a, 0x25, 0x19, 0x4a, 0x0c, 0xda, 0xa8, 0x31, 0xce, 0xb8, + 0xc2, 0x9d, 0xec, 0x4b, 0x53, 0x1b, 0xdb, 0x8c, 0x73, 0x76, 0x4c, 0x1d, 0xb5, 0x0a, 0x46, 0xef, + 0x1d, 0x3f, 0x99, 0xe4, 0x90, 0xee, 0xf2, 0x4e, 0xd7, 0x98, 0x96, 0x1a, 0xda, 0x32, 0xe3, 0x63, + 0x60, 0xce, 0x49, 0x37, 0x7b, 0x19, 0xe0, 0x9e, 0x1f, 0x47, 0x09, 0x77, 0xd4, 0xd3, 0x6c, 0xd9, + 0x45, 0x52, 0x95, 0x32, 0x85, 0x37, 0xbf, 0x23, 0x7c, 0x67, 0x00, 0xec, 0x30, 0x0d, 0x7d, 0x49, + 0x5f, 0xf9, 0xc2, 0x8f, 0xc1, 0x7a, 0x8e, 0x2b, 0x19, 0x83, 0x8b, 0x48, 0x4e, 0xea, 0x68, 0x17, + 0xb5, 0x2a, 0x6e, 0xfd, 0xe7, 0x69, 0xa7, 0x66, 0x44, 0xf4, 0xc3, 0x50, 0x50, 0x80, 0xd7, 0x52, + 0x44, 0x09, 0xf3, 0x2e, 0xa9, 0xd6, 0x0b, 0x5c, 0x4e, 0x55, 0x87, 0xfa, 0x8d, 0x5d, 0xd4, 0xaa, + 0xf6, 0x76, 0x48, 0xc1, 0x49, 0x10, 0x3d, 0xc4, 0xad, 0x9c, 0xfd, 0x79, 0x50, 0xfa, 0xb6, 0x98, + 0xb6, 0x91, 0x67, 0xaa, 0xf6, 0x9f, 0x7d, 0x5a, 0x4c, 0xdb, 0x97, 0xfd, 0x3e, 0x2f, 0xa6, 0xed, + 0x87, 0xba, 0x43, 0x07, 0xc2, 0x23, 0x67, 0xac, 0x4d, 0xac, 0xa8, 0x6d, 0x6e, 0xe3, 0xad, 0x95, + 0x2d, 0x8f, 0x42, 0xca, 0x13, 0xa0, 0xcd, 0xaf, 0x08, 0xdf, 0x1d, 0x00, 0x7b, 0xc9, 0x93, 0xbe, + 0xe4, 0x71, 0x34, 0x3c, 0x18, 0xd3, 0xa1, 0xf5, 0x14, 0x97, 0x21, 0x62, 0x09, 0x15, 0x57, 0x5a, + 0x33, 0x3c, 0xeb, 0x00, 0xaf, 0xc7, 0xc0, 0x32, 0x57, 0x6b, 0xad, 0x6a, 0xaf, 0x46, 0x74, 0x68, + 0x24, 0x0f, 0x8d, 0xf4, 0x93, 0x89, 0xbb, 0xf3, 0xe3, 0xb4, 0x63, 0x72, 0x21, 0x81, 0x0f, 0xf4, + 0xc2, 0xee, 0x00, 0x98, 0xa7, 0xca, 0xf7, 0xab, 0x99, 0x3d, 0xd3, 0xb3, 0x79, 0x88, 0x37, 0x97, + 0x64, 0x79, 0x14, 0x46, 0xc7, 0xd2, 0xaa, 0xe1, 0x0d, 0x2a, 0x04, 0x37, 0xda, 0x3c, 0xbd, 0xb0, + 0x5a, 0x78, 0x5d, 0x50, 0x48, 0xcd, 0xb1, 0x16, 0x0a, 0xf0, 0x14, 0xa3, 0xf9, 0x16, 0xd7, 0x57, + 0x0d, 0xe7, 0xa7, 0x61, 0xb9, 0xf8, 0xa6, 0x50, 0x53, 0xa0, 0x8e, 0x94, 0x93, 0x56, 0x61, 0x3e, + 0x05, 0xb2, 0xbc, 0xbc, 0xb0, 0xf7, 0x0b, 0xe1, 0xb5, 0x01, 0x30, 0x2b, 0xc0, 0xb7, 0x96, 0xae, + 0xcc, 0xa3, 0xc2, 0x56, 0x2b, 0xb9, 0x34, 0x9e, 0x5c, 0x87, 0x75, 0xa1, 0x97, 0xe2, 0xdb, 0xcb, + 0xc9, 0x3d, 0xfe, 0x5f, 0xf9, 0x12, 0xad, 0xd1, 0xb9, 0x16, 0x2d, 0x1f, 0xd3, 0xd8, 0xf8, 0x98, + 0x5d, 0x42, 0x77, 0xef, 0x6c, 0x66, 0xa3, 0xf3, 0x99, 0x8d, 0xfe, 0xce, 0x6c, 0xf4, 0x65, 0x6e, + 0x97, 0xce, 0xe7, 0x76, 0xe9, 0xf7, 0xdc, 0x2e, 0xbd, 0x31, 0x7f, 0x22, 0x84, 0x47, 0x24, 0xe2, + 0xf9, 0x2d, 0x94, 0x93, 0x94, 0x42, 0x50, 0x56, 0x11, 0xec, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, + 0xa1, 0x5a, 0xf2, 0x18, 0x11, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -179,6 +347,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) } type msgClient struct { @@ -198,6 +368,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) { + out := new(MsgNonAtomicExecResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Msg/NonAtomicExec", 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 x/auth module @@ -205,6 +384,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -214,6 +395,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) NonAtomicExec(ctx context.Context, req *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NonAtomicExec not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -237,6 +421,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_NonAtomicExec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNonAtomicExec) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NonAtomicExec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Msg/NonAtomicExec", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NonAtomicExec(ctx, req.(*MsgNonAtomicExec)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.auth.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -245,6 +447,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "NonAtomicExec", + Handler: _Msg_NonAtomicExec_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/auth/v1beta1/tx.proto", @@ -313,6 +519,129 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgNonAtomicExec) 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 *MsgNonAtomicExec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNonAtomicExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NonAtomicExecResult) 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 *NonAtomicExecResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NonAtomicExecResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintTx(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgNonAtomicExecResponse) 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 *MsgNonAtomicExecResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNonAtomicExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -348,6 +677,57 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgNonAtomicExec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *NonAtomicExecResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgNonAtomicExecResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -519,6 +899,324 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgNonAtomicExec) 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: MsgNonAtomicExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNonAtomicExec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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 + } + m.Msgs = append(m.Msgs, &types.Any{}) + if err := m.Msgs[len(m.Msgs)-1].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 *NonAtomicExecResult) 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: NonAtomicExecResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NonAtomicExecResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", 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.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resp", 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 m.Resp == nil { + m.Resp = &types.Any{} + } + if err := m.Resp.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 *MsgNonAtomicExecResponse) 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: MsgNonAtomicExecResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNonAtomicExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", 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 + } + m.Results = append(m.Results, &NonAtomicExecResult{}) + if err := m.Results[len(m.Results)-1].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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/vesting/testutil/expected_keepers_mocks.go b/x/auth/vesting/testutil/expected_keepers_mocks.go index 1df8f8ebbf2b..e7ff4c4d66ec 100644 --- a/x/auth/vesting/testutil/expected_keepers_mocks.go +++ b/x/auth/vesting/testutil/expected_keepers_mocks.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + protoiface "google.golang.org/protobuf/runtime/protoiface" ) // MockBankKeeper is a mock of BankKeeper interface. @@ -81,3 +82,55 @@ func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt inter mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } + +// MockAccountsModKeeper is a mock of AccountsModKeeper interface. +type MockAccountsModKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountsModKeeperMockRecorder +} + +// MockAccountsModKeeperMockRecorder is the mock recorder for MockAccountsModKeeper. +type MockAccountsModKeeperMockRecorder struct { + mock *MockAccountsModKeeper +} + +// NewMockAccountsModKeeper creates a new mock instance. +func NewMockAccountsModKeeper(ctrl *gomock.Controller) *MockAccountsModKeeper { + mock := &MockAccountsModKeeper{ctrl: ctrl} + mock.recorder = &MockAccountsModKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountsModKeeper) EXPECT() *MockAccountsModKeeperMockRecorder { + return m.recorder +} + +// IsAccountsModuleAccount mocks base method. +func (m *MockAccountsModKeeper) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, accountAddr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsAccountsModuleAccount indicates an expected call of IsAccountsModuleAccount. +func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, accountAddr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, accountAddr) +} + +// SendModuleMessageUntyped mocks base method. +func (m *MockAccountsModKeeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendModuleMessageUntyped", ctx, sender, msg) + ret0, _ := ret[0].(protoiface.MessageV1) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendModuleMessageUntyped indicates an expected call of SendModuleMessageUntyped. +func (mr *MockAccountsModKeeperMockRecorder) SendModuleMessageUntyped(ctx, sender, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendModuleMessageUntyped", reflect.TypeOf((*MockAccountsModKeeper)(nil).SendModuleMessageUntyped), ctx, sender, msg) +} diff --git a/x/auth/vesting/types/expected_keepers.go b/x/auth/vesting/types/expected_keepers.go index 59172579de02..d52848119f5e 100644 --- a/x/auth/vesting/types/expected_keepers.go +++ b/x/auth/vesting/types/expected_keepers.go @@ -3,6 +3,8 @@ package types import ( context "context" + "cosmossdk.io/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -13,3 +15,7 @@ type BankKeeper interface { SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool } + +type AccountsModKeeper interface { + types.AccountsModKeeper +} diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 350bba50bec2..18459338da7c 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/x/auth/keeper" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/auth/vesting" + vestingtestutil "cosmossdk.io/x/auth/vesting/testutil" "cosmossdk.io/x/auth/vesting/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" @@ -46,6 +48,10 @@ func (s *VestingAccountTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := vestingtestutil.NewMockAccountsModKeeper(ctrl) + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -59,10 +65,11 @@ func (s *VestingAccountTestSuite) SetupTest() { env, encCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", - authtypes.NewModuleAddress("gov").String(), nil, + authtypes.NewModuleAddress("gov").String(), ) } diff --git a/x/authz/go.mod b/x/authz/go.mod index f3cda496f8d0..a0bc60f1c71f 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -15,9 +15,9 @@ require ( cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/x/tx v0.13.2 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 diff --git a/x/authz/go.sum b/x/authz/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 3feafa900325..8d580f5e1f8b 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -220,8 +220,18 @@ func (k Keeper) DeleteGrant(ctx context.Context, grantee, granter sdk.AccAddress skey := grantStoreKey(grantee, granter, msgType) grant, found := k.getGrant(ctx, skey) if !found { + granterAddr, err := k.authKeeper.AddressCodec().BytesToString(granter) + if err != nil { + return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, + "could not convert granter address to string") + } + granteeAddr, err := k.authKeeper.AddressCodec().BytesToString(grantee) + if err != nil { + return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, + "could not convert grantee address to string") + } return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, - "failed to delete grant with given granter: %s, grantee: %s & msgType: %s ", granter.String(), grantee.String(), msgType) + "failed to delete grant with given granter: %s, grantee: %s & msgType: %s ", granterAddr, granteeAddr, msgType) } if grant.Expiration != nil { diff --git a/x/bank/go.mod b/x/bank/go.mod index c84db1fc7274..ab3df67b1ce3 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -13,7 +13,7 @@ require ( cosmossdk.io/store v1.0.2 cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -33,7 +33,7 @@ require ( buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -146,7 +146,7 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.15.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.7.0 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/bank/testutil/expected_keepers_mocks.go b/x/bank/testutil/expected_keepers_mocks.go index 0b3ded8ec673..058c4e2d7e36 100644 --- a/x/bank/testutil/expected_keepers_mocks.go +++ b/x/bank/testutil/expected_keepers_mocks.go @@ -216,17 +216,3 @@ func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) * mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc) } - -// IsAccountsModuleAccount mocks base method. -func (m *MockAccountKeeper) IsAccountsModuleAccount(ctx context.Context, addr []byte) bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, addr) - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsAccountsModuleAccount indicates an expected call of IsAccountsModuleAccount. -func (mr *MockAccountKeeperMockRecorder) IsAccountsModuleAccount(ctx, addr interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).IsAccountsModuleAccount), ctx, addr) -} diff --git a/x/bank/types/codec.go b/x/bank/types/codec.go index eea6b27dbdcf..e63d77e583f0 100644 --- a/x/bank/types/codec.go +++ b/x/bank/types/codec.go @@ -26,6 +26,8 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) { &MsgSend{}, &MsgMultiSend{}, &MsgUpdateParams{}, + &MsgBurn{}, + &MsgSetSendEnabled{}, ) msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) diff --git a/x/circuit/depinject.go b/x/circuit/depinject.go index 1ec1d4d9662d..c8e4a085ede2 100644 --- a/x/circuit/depinject.go +++ b/x/circuit/depinject.go @@ -51,10 +51,15 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } + authorityAddr, err := in.AddressCodec.BytesToString(authority) + if err != nil { + panic(err) + } + circuitkeeper := keeper.NewKeeper( in.Environment, in.Cdc, - authority.String(), + authorityAddr, in.AddressCodec, ) m := NewAppModule(in.Cdc, circuitkeeper) diff --git a/x/circuit/go.mod b/x/circuit/go.mod index f21819e97b9f..4ab23f2efaa2 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -28,7 +28,7 @@ require ( cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -45,7 +45,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/circuit/keeper/genesis_test.go b/x/circuit/keeper/genesis_test.go index e77c474923ca..b628b0514876 100644 --- a/x/circuit/keeper/genesis_test.go +++ b/x/circuit/keeper/genesis_test.go @@ -18,7 +18,6 @@ import ( codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) @@ -43,14 +42,16 @@ func (s *GenesisTestSuite) SetupTest() { sdkCtx := testCtx.Ctx s.ctx = sdkCtx s.cdc = codec.NewProtoCodec(encCfg.InterfaceRegistry) - authority := authtypes.NewModuleAddress("gov") ac := addresscodec.NewBech32Codec("cosmos") - bz, err := ac.StringToBytes(authority.String()) + authority, err := ac.BytesToString(authtypes.NewModuleAddress("gov")) + s.Require().NoError(err) + + bz, err := ac.StringToBytes(authority) s.Require().NoError(err) s.addrBytes = bz - s.keeper = keeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), s.cdc, authority.String(), ac) + s.keeper = keeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), s.cdc, authority, ac) } func (s *GenesisTestSuite) TestInitExportGenesis() { @@ -62,8 +63,10 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { s.Require().NoError(err) var accounts []*types.GenesisAccountPermissions + addr, err := addresscodec.NewBech32Codec("cosmos").BytesToString(s.addrBytes) + s.Require().NoError(err) genAccsPerms := types.GenesisAccountPermissions{ - Address: sdk.AccAddress(s.addrBytes).String(), + Address: addr, Permissions: &perms, } accounts = append(accounts, &genAccsPerms) diff --git a/x/circuit/keeper/keeper_test.go b/x/circuit/keeper/keeper_test.go index 38ce34b1e14a..37a93547b63e 100644 --- a/x/circuit/keeper/keeper_test.go +++ b/x/circuit/keeper/keeper_test.go @@ -46,9 +46,11 @@ func initFixture(t *testing.T) *fixture { mockStoreKey := storetypes.NewKVStoreKey("test") env := runtime.NewEnvironment(runtime.NewKVStoreService(mockStoreKey), log.NewNopLogger()) - k := keeper.NewKeeper(env, encCfg.Codec, authtypes.NewModuleAddress("gov").String(), ac) + authority, err := ac.BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + k := keeper.NewKeeper(env, encCfg.Codec, authority, ac) - bz, err := ac.StringToBytes(authtypes.NewModuleAddress("gov").String()) + bz, err := ac.StringToBytes(authority) require.NoError(t, err) return &fixture{ diff --git a/x/consensus/depinject.go b/x/consensus/depinject.go index 695c609e172d..03729f90ab0a 100644 --- a/x/consensus/depinject.go +++ b/x/consensus/depinject.go @@ -2,6 +2,7 @@ package consensus import ( modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" + "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" "cosmossdk.io/depinject/appconfig" @@ -28,9 +29,10 @@ func init() { type ModuleInputs struct { depinject.In - Config *modulev1.Module - Cdc codec.Codec - Environment appmodule.Environment + Config *modulev1.Module + Cdc codec.Codec + Environment appmodule.Environment + AddressCodec address.Codec } type ModuleOutputs struct { @@ -48,7 +50,12 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } - k := keeper.NewKeeper(in.Cdc, in.Environment, authority.String()) + authorityAddr, err := in.AddressCodec.BytesToString(authority) + if err != nil { + panic(err) + } + + k := keeper.NewKeeper(in.Cdc, in.Environment, authorityAddr) m := NewAppModule(in.Cdc, k) baseappOpt := func(app *baseapp.BaseApp) { app.SetParamStore(k.ParamsStore) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index 64edfe1018f4..782da78c9c8a 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -36,7 +36,10 @@ func (s *KeeperTestSuite) SetupTest() { encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}) env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) - keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, env, authtypes.NewModuleAddress("gov").String()) + authority, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + s.Require().NoError(err) + + keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, env, authority) s.ctx = ctx s.consensusParamsKeeper = &keeper diff --git a/x/crisis/depinject.go b/x/crisis/depinject.go index 3879333c1602..1aac71f65f9d 100644 --- a/x/crisis/depinject.go +++ b/x/crisis/depinject.go @@ -66,13 +66,18 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } + authorityAddr, err := in.AddressCodec.BytesToString(authority) + if err != nil { + panic(err) + } + k := keeper.NewKeeper( in.Codec, in.StoreService, invalidCheckPeriod, in.BankKeeper, feeCollectorName, - authority.String(), + authorityAddr, in.AddressCodec, ) diff --git a/x/crisis/keeper/msg_server_test.go b/x/crisis/keeper/msg_server_test.go index ea60b9ac9fe8..fc7abcee47f7 100644 --- a/x/crisis/keeper/msg_server_test.go +++ b/x/crisis/keeper/msg_server_test.go @@ -39,7 +39,9 @@ func (s *KeeperTestSuite) SetupTest() { storeService := runtime.NewKVStoreService(key) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, crisis.AppModule{}) - keeper := keeper.NewKeeper(encCfg.Codec, storeService, 5, supplyKeeper, "", sdk.AccAddress([]byte("addr1_______________")).String(), addresscodec.NewBech32Codec("cosmos")) + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString([]byte("addr1_______________")) + s.Require().NoError(err) + keeper := keeper.NewKeeper(encCfg.Codec, storeService, 5, supplyKeeper, "", addr, addresscodec.NewBech32Codec("cosmos")) s.ctx = testCtx.Ctx s.keeper = keeper @@ -57,6 +59,8 @@ func (s *KeeperTestSuite) TestMsgVerifyInvariant() { testutil.CreateKeyringAccounts(s.T(), kr, 1) sender := testutil.CreateKeyringAccounts(s.T(), kr, 1)[0] + senderAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(sender.Address) + s.Require().NoError(err) s.supplyKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(2) s.keeper.RegisterRoute("bank", "total-supply", func(sdk.Context) (string, bool) { return "", false }) @@ -90,7 +94,7 @@ func (s *KeeperTestSuite) TestMsgVerifyInvariant() { { name: "unregistered invariant route", input: &types.MsgVerifyInvariant{ - Sender: sender.Address.String(), + Sender: senderAddr, InvariantModuleName: "module", InvariantRoute: "invalidroute", }, @@ -100,7 +104,7 @@ func (s *KeeperTestSuite) TestMsgVerifyInvariant() { { name: "valid invariant", input: &types.MsgVerifyInvariant{ - Sender: sender.Address.String(), + Sender: senderAddr, InvariantModuleName: "bank", InvariantRoute: "total-supply", }, diff --git a/x/crisis/types/msgs.go b/x/crisis/types/msgs.go index b62eaaf023a0..ed8542ea33ca 100644 --- a/x/crisis/types/msgs.go +++ b/x/crisis/types/msgs.go @@ -10,9 +10,9 @@ var ( ) // NewMsgVerifyInvariant creates a new MsgVerifyInvariant object -func NewMsgVerifyInvariant(sender sdk.AccAddress, invModeName, invRoute string) *MsgVerifyInvariant { +func NewMsgVerifyInvariant(sender, invModeName, invRoute string) *MsgVerifyInvariant { return &MsgVerifyInvariant{ - Sender: sender.String(), + Sender: sender, InvariantModuleName: invModeName, InvariantRoute: invRoute, } diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 7fe828d73477..82cd281aec73 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -35,7 +35,7 @@ require ( buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -52,7 +52,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index ab6432216994..dff07630ef10 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -120,8 +120,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/distribution/migrations/v4/migrate_funds_test.go b/x/distribution/migrations/v4/migrate_funds_test.go index 43516921b4cd..470fc3cd07cc 100644 --- a/x/distribution/migrations/v4/migrate_funds_test.go +++ b/x/distribution/migrations/v4/migrate_funds_test.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -46,16 +47,22 @@ func TestFundsMigration(t *testing.T) { authority, err := addressCodec.BytesToString(authtypes.NewModuleAddress("gov")) require.NoError(t, err) + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) + poolKeeper := distrtestutil.NewMockPoolKeeper(ctrl) + // create account keeper accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addressCodec, sdk.Bech32MainPrefix, authority, - nil, ) // create bank keeper @@ -67,11 +74,6 @@ func TestFundsMigration(t *testing.T) { authority, ) - // gomock initializations - ctrl := gomock.NewController(t) - stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) - poolKeeper := distrtestutil.NewMockPoolKeeper(ctrl) - // create distribution keeper distrKeeper := keeper.NewKeeper( encCfg.Codec, diff --git a/x/epochs/go.mod b/x/epochs/go.mod index d5e4338a5538..1d9e0cd2212a 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.1.0 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -29,7 +29,7 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 6ef06c257210..f886ba03f7d5 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -116,8 +116,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 8c1bc9eefd84..b46a81d3ad0b 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -32,7 +32,7 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 7c65e84bde44..ec8a56718b99 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 7b05aac9bb12..2f4a7ecfdebe 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -15,7 +15,7 @@ require ( cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -36,7 +36,7 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 6817d2a7fdae..31e23c9b507d 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/gov/go.mod b/x/gov/go.mod index cf6c5ae424ee..5c585e07e6c7 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -19,7 +19,7 @@ require ( cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/chzyer/readline v1.5.1 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -39,7 +39,7 @@ require ( require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 6817d2a7fdae..31e23c9b507d 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/group/go.mod b/x/group/go.mod index 6d765f73fc48..dbfd32d1b062 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -18,7 +18,7 @@ require ( cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/cockroachdb/apd/v2 v2.0.2 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 @@ -40,7 +40,7 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 25667d2579d0..ddb88aa18c9a 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/group/migrations/v2/migrate_test.go b/x/group/migrations/v2/migrate_test.go index 942a47ca097a..1530dfba75ec 100644 --- a/x/group/migrations/v2/migrate_test.go +++ b/x/group/migrations/v2/migrate_test.go @@ -103,10 +103,11 @@ func createOldPolicyAccount(ctx sdk.Context, storeKey storetypes.StoreKey, cdc c if err != nil { return nil, nil, err } + // gomock initializations ctrl := gomock.NewController(&testing.T{}) acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) - accountKeeper := authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, nil, addressCodec, sdk.Bech32MainPrefix, authorityStrAddr, acctsModKeeper) + accountKeeper := authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, acctsModKeeper, nil, addressCodec, sdk.Bech32MainPrefix, authorityStrAddr) oldPolicyAccounts := make([]*authtypes.ModuleAccount, len(policies)) for i, policyAddr := range policies { diff --git a/x/mint/go.mod b/x/mint/go.mod index 5c22eef4f3e9..0ca266b455c1 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -31,7 +31,7 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -48,7 +48,7 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/mint/simulation/proposals.go b/x/mint/simulation/proposals.go index e1d5471bf970..be6320ac8326 100644 --- a/x/mint/simulation/proposals.go +++ b/x/mint/simulation/proposals.go @@ -32,10 +32,15 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, ac coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") + authorityAddr, err := ac.BytesToString(authority) + if err != nil { + return nil, err + } + params := types.DefaultParams() params.BlocksPerYear = uint64(simtypes.RandIntBetween(r, 1, 1000000)) params.GoalBonded = sdkmath.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 100)), 2) @@ -45,7 +50,7 @@ func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, _ coreaddress.C params.MintDenom = simtypes.RandStringOfLength(r, 10) return &types.MsgUpdateParams{ - Authority: authority.String(), + Authority: authorityAddr, Params: params, }, nil } diff --git a/x/mint/simulation/proposals_test.go b/x/mint/simulation/proposals_test.go index 2f7ee4f85439..767bbfad1508 100644 --- a/x/mint/simulation/proposals_test.go +++ b/x/mint/simulation/proposals_test.go @@ -11,12 +11,12 @@ import ( "cosmossdk.io/x/mint/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) func TestProposalMsgs(t *testing.T) { + ac := codectestutil.CodecOptions{}.GetAddressCodec() // initialize parameters s := rand.NewSource(1) r := rand.New(s) @@ -33,12 +33,15 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, ac) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) - assert.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateParams.Authority) + authority, err := ac.BytesToString(address.Module("gov")) + assert.NilError(t, err) + + assert.Equal(t, authority, msgUpdateParams.Authority) assert.Equal(t, uint64(122877), msgUpdateParams.Params.BlocksPerYear) assert.DeepEqual(t, sdkmath.LegacyNewDecWithPrec(95, 2), msgUpdateParams.Params.GoalBonded) assert.DeepEqual(t, sdkmath.LegacyNewDecWithPrec(94, 2), msgUpdateParams.Params.InflationMax) diff --git a/x/nft/go.mod b/x/nft/go.mod index 72bed743e9b3..a1d56bd5529f 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -29,7 +29,7 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -47,7 +47,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/params/go.mod b/x/params/go.mod index d0c43d733ca2..f30dc86a9dc4 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 @@ -33,7 +33,7 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 5bd04358dd4b..a8e175be2d91 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -31,7 +31,7 @@ require ( cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -49,7 +49,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index 65a14ecaaf9c..cca14bddb007 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -15,7 +15,7 @@ require ( cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/bits-and-blooms/bitset v1.10.0 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -34,7 +34,7 @@ require ( buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index a1632dddc43b..4c742306d10e 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -120,8 +120,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index 35fca38e2661..d4ab17a35582 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -28,7 +28,11 @@ func (k Keeper) HasValidatorSigningInfo(ctx context.Context, consAddr sdk.ConsAd func (k Keeper) JailUntil(ctx context.Context, consAddr sdk.ConsAddress, jailTime time.Time) error { signInfo, err := k.ValidatorSigningInfo.Get(ctx, consAddr) if err != nil { - return errorsmod.Wrap(err, fmt.Sprintf("cannot jail validator with consensus address %s that does not have any signing information", consAddr.String())) + addr, err := k.sk.ConsensusAddressCodec().BytesToString(consAddr) + if err != nil { + return types.ErrNoSigningInfoFound.Wrapf("could not convert consensus address to string. Error: %s", err.Error()) + } + return errorsmod.Wrap(err, fmt.Sprintf("cannot jail validator with consensus address %s that does not have any signing information", addr)) } signInfo.JailedUntil = jailTime @@ -39,7 +43,11 @@ func (k Keeper) JailUntil(ctx context.Context, consAddr sdk.ConsAddress, jailTim func (k Keeper) Tombstone(ctx context.Context, consAddr sdk.ConsAddress) error { signInfo, err := k.ValidatorSigningInfo.Get(ctx, consAddr) if err != nil { - return types.ErrNoSigningInfoFound.Wrap(fmt.Sprintf("cannot tombstone validator with consensus address %s that does not have any signing information", consAddr.String())) + addr, err := k.sk.ConsensusAddressCodec().BytesToString(consAddr) + if err != nil { + return types.ErrNoSigningInfoFound.Wrapf("could not convert consensus address to string. Error: %s", err.Error()) + } + return types.ErrNoSigningInfoFound.Wrap(fmt.Sprintf("cannot tombstone validator with consensus address %s that does not have any signing information", addr)) } if signInfo.Tombstoned { diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index ff0c65bb17ef..b616bc9e6c4e 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -121,15 +121,18 @@ func (s *KeeperTestSuite) TestPerformConsensusPubKeyUpdate() { oldConsAddr := sdk.ConsAddress(pks[0].Address()) newConsAddr := sdk.ConsAddress(pks[1].Address()) + consAddr, err := s.stakingKeeper.ConsensusAddressCodec().BytesToString(newConsAddr) + s.Require().NoError(err) + newInfo := slashingtypes.NewValidatorSigningInfo( - newConsAddr.String(), + consAddr, int64(4), time.Unix(2, 0).UTC(), false, int64(10), ) - err := slashingKeeper.ValidatorSigningInfo.Set(ctx, oldConsAddr, newInfo) + err = slashingKeeper.ValidatorSigningInfo.Set(ctx, oldConsAddr, newInfo) require.NoError(err) s.stakingKeeper.EXPECT().ValidatorIdentifier(gomock.Any(), oldConsAddr).Return(oldConsAddr, nil) diff --git a/x/staking/go.mod b/x/staking/go.mod index 13470f82b9fd..810f2a390c3f 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -12,7 +12,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 github.com/cosmos/gogoproto v1.4.12 @@ -35,7 +35,7 @@ require ( buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 94a3a961df88..d0025696aaa3 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 85ba84072ce4..85e7fba8808f 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/store v1.0.2 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 @@ -43,7 +43,7 @@ require ( cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 7c53bbeb3ea9..dceb2dd1d3f0 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -200,8 +200,8 @@ cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.2 h1:Kh90UH30bhnnUdJH+CmWLyaH8IKdY6BBGY3EkdOk82o= +cosmossdk.io/x/tx v0.13.2/go.mod h1:yhPokDCfXVIuAtyp49IFlWB5YAXUgD7Zek+ZHwsHzvU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -320,8 +320,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=