From 36c212178aa79113afaee89784b851f216e66a42 Mon Sep 17 00:00:00 2001 From: joon9823 Date: Mon, 6 May 2024 10:17:43 +0900 Subject: [PATCH] Handle ibc version as optional in MsgConnectionOpenInit --- package-lock.json | 4 ++-- package.json | 2 +- .../core/connection/msgs/MsgConnectionOpenInit.ts | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85ee455..d358687 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@initia/initia.js", - "version": "0.1.46", + "version": "0.1.47", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@initia/initia.js", - "version": "0.1.46", + "version": "0.1.47", "license": "MIT", "dependencies": { "@initia/initia.proto": "^0.1.33", diff --git a/package.json b/package.json index 7577c35..68ff59b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@initia/initia.js", - "version": "0.1.46", + "version": "0.1.47", "description": "The JavaScript SDK for Initia", "license": "MIT", "author": "InitiaLabs", diff --git a/src/core/ibc/core/connection/msgs/MsgConnectionOpenInit.ts b/src/core/ibc/core/connection/msgs/MsgConnectionOpenInit.ts index 0a4db03..72c046b 100644 --- a/src/core/ibc/core/connection/msgs/MsgConnectionOpenInit.ts +++ b/src/core/ibc/core/connection/msgs/MsgConnectionOpenInit.ts @@ -24,7 +24,7 @@ export class MsgConnectionOpenInit extends JSONSerializable< constructor( public client_id: string, public counterparty: ConnectionCounterparty, - public version: IbcVersion, + public version: IbcVersion | undefined, public delay_period: number, public signer: AccAddress ) { @@ -47,7 +47,7 @@ export class MsgConnectionOpenInit extends JSONSerializable< return new MsgConnectionOpenInit( client_id, ConnectionCounterparty.fromData(counterparty), - IbcVersion.fromData(version), + version ? IbcVersion.fromData(version) : undefined, Number.parseInt(delay_period), signer ); @@ -59,7 +59,7 @@ export class MsgConnectionOpenInit extends JSONSerializable< '@type': '/ibc.core.connection.v1.MsgConnectionOpenInit', client_id, counterparty: counterparty.toData(), - version: version.toData(), + version: version?.toData(), delay_period: delay_period.toFixed(), signer, }; @@ -73,7 +73,7 @@ export class MsgConnectionOpenInit extends JSONSerializable< ConnectionCounterparty.fromProto( proto.counterparty as ConnectionCounterparty.Proto ), - IbcVersion.fromProto(proto.version as IbcVersion.Proto), + proto.version ? IbcVersion.fromProto(proto.version) : undefined, proto.delayPeriod.toNumber(), proto.signer ); @@ -84,7 +84,7 @@ export class MsgConnectionOpenInit extends JSONSerializable< return MsgConnectionOpenInit_pb.fromPartial({ clientId: client_id, counterparty: counterparty.toProto(), - version: version.toProto(), + version: version?.toProto(), delayPeriod: Long.fromNumber(delay_period), signer, }); @@ -109,7 +109,7 @@ export namespace MsgConnectionOpenInit { '@type': '/ibc.core.connection.v1.MsgConnectionOpenInit'; client_id: string; counterparty: ConnectionCounterparty.Data; - version: IbcVersion.Data; + version?: IbcVersion.Data; delay_period: string; signer: AccAddress; }