Skip to content

Commit

Permalink
Handle ibc version as optional in MsgConnectionOpenInit
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed May 6, 2024
1 parent f5f590e commit 36c2121
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 6 additions & 6 deletions src/core/ibc/core/connection/msgs/MsgConnectionOpenInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand All @@ -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
);
Expand All @@ -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,
};
Expand All @@ -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
);
Expand All @@ -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,
});
Expand All @@ -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;
}
Expand Down

0 comments on commit 36c2121

Please sign in to comment.