diff --git a/CHANGELOG.md b/CHANGELOG.md index d82201ed2e..465110ae9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,11 +22,15 @@ and this project adheres to `createStakingAminoConverters`. This made `prefix` in `SigningCosmWasmClientOptions` and `SigningStargateClientOptions` obsolete, so this was also deleted. ([#1291]) +- @cosmjs/proto-signing: Remove `fromJSON`/`toJSON` from `TsProtoGeneratedType` + such that generated types are not required to generate those anymore. The + methods were provided by ts-proto but we never needed them. ([#1329]) [#1002]: https://github.com/cosmos/cosmjs/issues/1002 [#1240]: https://github.com/cosmos/cosmjs/pull/1240 [#1289]: https://github.com/cosmos/cosmjs/issues/1289 [#1291]: https://github.com/cosmos/cosmjs/issues/1291 +[#1329]: https://github.com/cosmos/cosmjs/pull/1329 [#1341]: https://github.com/cosmos/cosmjs/issues/1341 ## [0.29.5] - 2022-12-07 diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts index 3a81e6a334..fac9198078 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts @@ -879,10 +879,6 @@ describe("SigningCosmWasmClient", () => { throw new Error("decode method should not be required"); }, - fromJSON(): CustomMsgDelegate { - throw new Error("fromJSON method should not be required"); - }, - fromPartial(object: DeepPartial): CustomMsgDelegate { const message = { ...baseCustomMsgDelegate } as CustomMsgDelegate; if (object.customDelegatorAddress !== undefined && object.customDelegatorAddress !== null) { @@ -902,10 +898,6 @@ describe("SigningCosmWasmClient", () => { } return message; }, - - toJSON(): unknown { - throw new Error("toJSON method should not be required"); - }, }; customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate); const customAminoTypes = new AminoTypes({ @@ -1178,10 +1170,6 @@ describe("SigningCosmWasmClient", () => { throw new Error("decode method should not be required"); }, - fromJSON(): CustomMsgDelegate { - throw new Error("fromJSON method should not be required"); - }, - fromPartial(object: DeepPartial): CustomMsgDelegate { const message = { ...baseCustomMsgDelegate } as CustomMsgDelegate; if (object.customDelegatorAddress !== undefined && object.customDelegatorAddress !== null) { @@ -1201,10 +1189,6 @@ describe("SigningCosmWasmClient", () => { } return message; }, - - toJSON(): unknown { - throw new Error("toJSON method should not be required"); - }, }; customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate); const customAminoTypes = new AminoTypes({ diff --git a/packages/proto-signing/src/registry.ts b/packages/proto-signing/src/registry.ts index 5be89db54f..503f7abe7d 100644 --- a/packages/proto-signing/src/registry.ts +++ b/packages/proto-signing/src/registry.ts @@ -12,9 +12,10 @@ import type protobuf from "protobufjs"; export interface TsProtoGeneratedType { readonly encode: (message: any | { [k: string]: any }, writer?: protobuf.Writer) => protobuf.Writer; readonly decode: (input: Uint8Array | protobuf.Reader, length?: number) => any; - readonly fromJSON: (object: any) => any; readonly fromPartial: (object: any) => any; - readonly toJSON: (message: any | { [k: string]: any }) => unknown; + // Methods from ts-proto types we don't need + // readonly fromJSON: (object: any) => any; + // readonly toJSON: (message: any | { [k: string]: any }) => unknown; } /** diff --git a/packages/stargate/src/signingstargateclient.spec.ts b/packages/stargate/src/signingstargateclient.spec.ts index b8e5f1df25..e0a58e2b8e 100644 --- a/packages/stargate/src/signingstargateclient.spec.ts +++ b/packages/stargate/src/signingstargateclient.spec.ts @@ -542,10 +542,6 @@ describe("SigningStargateClient", () => { throw new Error("decode method should not be required"); }, - fromJSON(): CustomMsgDelegate { - throw new Error("fromJSON method should not be required"); - }, - fromPartial(object: DeepPartial): CustomMsgDelegate { const message = { ...baseCustomMsgDelegate } as CustomMsgDelegate; if (object.customDelegatorAddress !== undefined && object.customDelegatorAddress !== null) { @@ -565,10 +561,6 @@ describe("SigningStargateClient", () => { } return message; }, - - toJSON(): unknown { - throw new Error("toJSON method should not be required"); - }, }; customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate); const customAminoTypes = new AminoTypes({ @@ -830,10 +822,6 @@ describe("SigningStargateClient", () => { throw new Error("decode method should not be required"); }, - fromJSON(): CustomMsgDelegate { - throw new Error("fromJSON method should not be required"); - }, - fromPartial(object: DeepPartial): CustomMsgDelegate { const message = { ...baseCustomMsgDelegate } as CustomMsgDelegate; if (object.customDelegatorAddress !== undefined && object.customDelegatorAddress !== null) { @@ -853,10 +841,6 @@ describe("SigningStargateClient", () => { } return message; }, - - toJSON(): unknown { - throw new Error("toJSON method should not be required"); - }, }; customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate); const customAminoTypes = new AminoTypes({