hyperweb-io / hyperweb-io/telescope
use implicit recursion similar to fromPartial for toAmino/fromAmino
- Dominant language
- TypeScript
- Stars
- 154
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
currently the toAmino/fromAmino functionality requires the proto parser store and proto refs so that it can query information about nested dependencies and imports.
This could be simplified by taking an approach for amino encoding similar to how `fromPartial`, `fromJSON`, `toJSON` and other methods inspired from `ts-proto`
This could be accomplished by adding toAmino` and `fromAmino` methods to the message objects:
```js
export const MsgCreateValidator = {
encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.description !== undefined) {
Description.encode(message.description, writer.uint32(10).fork()).ldelim();
}
if (message.commission !== undefined) {
CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim();
}
}
toAmino(message, obj) {
if (message.description !== undefined) {
obj.description = Description.toAmino(message.description);
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.