confio / cosmjs-types

JS and TS types relating to Protocol Buffers used by Cosmos-SDK and other related projects
Apache License 2.0
36 stars 42 forks source link

Update checking #65

Closed happylolonly closed 1 year ago

happylolonly commented 1 year ago

Maybe here better check as just !value? We had a bug because value was undefined.

image

https://github.com/confio/cosmjs-types/blob/main/src/cosmos/gov/v1beta1/gov.ts#L412

webmaster128 commented 1 year ago

The field must be a string which is checked at compile time: https://github.com/confio/cosmjs-types/blob/main/src/cosmos/gov/v1beta1/gov.ts#L201 Using TypeScript fixes this, right? The entire CosmJS stack will not be very nice to you in case you provide arguments in the wrong type.

happylolonly commented 1 year ago

yes, seems TS would prevent this. we using 0.4.1 version, looks it wasn't type. will try to update in future

webmaster128 commented 1 year ago

You mean cosmjs-types 0.4.1? There it is the same type: https://github.com/confio/cosmjs-types/blob/v0.4.1/src/cosmos/gov/v1beta1/gov.ts#L160

Is your app in TypeScript?

happylolonly commented 1 year ago

yes, sorry, was our issue. not specified body type

happylolonly commented 1 year ago

https://github.com/cybercongress/soft3.js/blob/main/src/signingcyberclient.ts#L767

added your types, now should validate correct

thanks