hyperweb-io / hyperweb-io/telescope

Invalid string format. Only non-negative integers in decimal representation supported.

Open
#642 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
154
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Dear Telescope team,

I have the following definition in a proto file:

```proto
message QueryOpenEstResponse {
string weight_balance_ratio = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
```

The issue that I'm having is that such field can be a negative number as it's allowed in CosmosSDK but since it's decoded using Decimal.fromAtomics after running `yarn codegen`:

```js
case 2:
message.weightBalanceRatio = Decimal.fromAtomics(reader.string(), 18).toString();
```

I get an error trying to decode its value:
```
Error: Invalid string format. Only non-negative integers in decimal representation supported.
at new Decimal (decimal.js:103:1)
at Decimal.fromAtomics (decimal.js:59:1)
at Object.decode (query.ts:2215:48)
at eval (query.rpc.Query.ts:119:54)
```

Do you guys have any alternative for this?
Thank you

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.