Coder Social home page Coder Social logo

fix field/method conflict about cosmos-proto HOT 4 OPEN

cosmos avatar cosmos commented on June 2, 2024
fix field/method conflict

from cosmos-proto.

Comments (4)

aaronc avatar aaronc commented on June 2, 2024

Getting these warnings now:

2021/12/15 11:12:07 Message cosmos.base.abci.v1beta1.StringEvent contains the reserved field name cosmos.base.abci.v1beta1.StringEvent.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.crypto.ProofOp contains the reserved field name tendermint.crypto.ProofOp.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.abci.RequestCheckTx contains the reserved field name tendermint.abci.RequestCheckTx.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.abci.Event contains the reserved field name tendermint.abci.Event.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.abci.Evidence contains the reserved field name tendermint.abci.Evidence.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.types.Vote contains the reserved field name tendermint.types.Vote.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.
2021/12/15 11:12:07 Message tendermint.types.Proposal contains the reserved field name tendermint.types.Proposal.type which conflicts with protoreflect.Message interface implementation.
This field will be suffixed with an underscore '_'.
If you can change the message field name, please do so.
In a future iteration of pulsar we may make a breaking change to this practice in order to be compliant with field naming of the original golang protobuf implementation.

7 instances. Is this enough to merit finding another work-around?

from cosmos-proto.

aaronc avatar aaronc commented on June 2, 2024

Plus a bunch of errors:

cosmos/tx/signing/v1beta1/signing.pulsar.go:1154:42: v.ProtoReflect undefined (type *SignatureDescriptor_Data_Single has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1160:42: v.ProtoReflect undefined (type *SignatureDescriptor_Data_Multi has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1235:78: (*SignatureDescriptor_Data_Single)(nil).ProtoReflect undefined (type *SignatureDescriptor_Data_Single has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1237:47: v.Single.ProtoReflect undefined (type *SignatureDescriptor_Data_Single has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1239:78: (*SignatureDescriptor_Data_Single)(nil).ProtoReflect undefined (type *SignatureDescriptor_Data_Single has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1243:77: (*SignatureDescriptor_Data_Multi)(nil).ProtoReflect undefined (type *SignatureDescriptor_Data_Multi has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1245:46: v.Multi.ProtoReflect undefined (type *SignatureDescriptor_Data_Multi has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1247:77: (*SignatureDescriptor_Data_Multi)(nil).ProtoReflect undefined (type *SignatureDescriptor_Data_Multi has no field or method ProtoReflect)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1270:36: impossible type assertion:
        *SignatureDescriptor_Data_Single does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1273:36: impossible type assertion:
        *SignatureDescriptor_Data_Multi does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
cosmos/tx/signing/v1beta1/signing.pulsar.go:1273:36: too many errors

from cosmos-proto.

aaronc avatar aaronc commented on June 2, 2024

Let's reopen this. I think it would be good to do the painful thing and not have to have the warning about fields getting renamed

from cosmos-proto.

aaronc avatar aaronc commented on June 2, 2024

If there is a type with a field method conflict, we should do codegen using a struct for the fast refletion wrapper instead of an alias to avoid the field method conflict.

Currently we're generating a fast reflection wrapper like this

type fastReflection_A A

This causes a field method conflict because Type would be a struct field and an interface method on the wrapper. Using a struct instead of an alias for the wrapper would avoid this. Ex:

type fastReflection_A struct {
  a A
}

We should only use a struct when there is a conflict, because an alias is more performant otherwise.

from cosmos-proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.