telescope icon indicating copy to clipboard operation
telescope copied to clipboard

Can't use lcdClients options

Open nowooj opened this issue 8 months ago • 4 comments

node's lcd wants snake_case, but lcdClients supports camelCase.

According to the issues below, we can get snake_case response by using prototypes.parser.keepCase as true. https://github.com/hyperweb-io/telescope/issues/194

typeUrl of ProtoMsg is defined as type_url, which seems to cause a problem in GlobalDecoderRegistry.register.

nowooj avatar Mar 14 '25 01:03 nowooj

Can you share your full configuration, maybe a repository?

pyramation avatar Mar 14 '25 19:03 pyramation

You can see this in the fix/lcd branch of the repository here. https://github.com/xpladev/xplajs/tree/fix/lcd

The problem occurs with camel case, as in the example code below. https://github.com/xpladev/xplajs/blob/a8dcfaa924bf6c84df82ab62f25c278ddb849265/libs/xplajs/src/ethermint/types/v1/account.ts#L107-L116

nowooj avatar Mar 17 '25 02:03 nowooj

what is the expected output vs. the current output? Which particular area is broken?

pyramation avatar Apr 15 '25 03:04 pyramation

First, you can check the json of the script I ran here. https://github.com/xpladev/xplajs/blob/a8dcfaa924bf6c84df82ab62f25c278ddb849265/scripts/xpla.telescope.json#L15-L17

According to the link above, EthAccountProtoMsg should be snake case, but it was generated as camelCase in toProtoMsg.

Expected output

toProtoMsg(message: EthAccount): EthAccountProtoMsg {
    return {
      type_url: "/ethermint.types.v1.EthAccount",
      value: EthAccount.encode(message).finish()
    };
  }

Current output

toProtoMsg(message: EthAccount): EthAccountProtoMsg {
    return {
      typeUrl: "/ethermint.types.v1.EthAccount",
      value: EthAccount.encode(message).finish()
    };
  }

nowooj avatar Apr 18 '25 05:04 nowooj