Skip to content

Commit

Permalink
Feedback improvement #335
Browse files Browse the repository at this point in the history
  • Loading branch information
cdc-Hitesh committed Sep 14, 2021
1 parent 2a1440f commit 9937871
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions lib/src/transaction/msg/ibc/applications/MsgTransfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Testing MsgTransfer', function () {
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
};

const testRunner = fuzzy(fuzzy.ObjArg(anyValidOptions));
Expand All @@ -50,7 +50,7 @@ describe('Testing MsgTransfer', function () {
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
});

const rawMsg: Msg = {
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Testing MsgTransfer', function () {
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
});

const anySigner = {
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('Testing MsgTransfer', function () {
sender: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
};

expect(() => new cro.ibc.MsgTransfer(params1)).to.throw('Provided `sender` does not match network selected');
Expand All @@ -124,7 +124,7 @@ describe('Testing MsgTransfer', function () {
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: '0x7e00664398A54AE12648CAe2785c36d00dd51672',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
};

expect(() => new cro.ibc.MsgTransfer(params1)).to.throw(
Expand All @@ -140,7 +140,7 @@ describe('Testing MsgTransfer', function () {
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutHeight,
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
});
expect(isAminoMsgTransfer(MsgTransfer.toRawAminoMsg()).valueOf()).to.be.true;
expect(MsgTransfer.toRawAminoMsg()).to.deep.eq({
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('Testing MsgTransfer', function () {
sourceChannel: 'channel-33',
sender: 'tcro15sfupd26sp6qf37ll5q6xuf330k7df9tnvrqht',
receiver: 'cosmos1vw4ucaeagtduv5ep4sa95e3aqzqpsk5meda08c',
timeoutTimestamp: Long.fromString('1620640362229420996'),
timeoutTimestampInNanoSeconds: Long.fromString('1620640362229420996'),
});

expect(msgTransferIBC_UNdefined.toRawAminoMsg()).to.deep.eq({
Expand Down
8 changes: 4 additions & 4 deletions lib/src/transaction/msg/ibc/applications/MsgTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const msgTransferIBC = function (config: InitConfigurations) {
this.sender = options.sender;
this.receiver = options.receiver;
this.timeoutHeight = options.timeoutHeight;
this.timeoutTimestampInNanoSeconds = options.timeoutTimestamp;
this.timeoutTimestampInNanoSeconds = options.timeoutTimestampInNanoSeconds;

this.validateAddresses();
}
Expand All @@ -67,7 +67,7 @@ export const msgTransferIBC = function (config: InitConfigurations) {
receiver: this.receiver,
timeoutHeight: this.timeoutHeight,
timeoutTimestamp: this.timeoutTimestampInNanoSeconds,
} as MsgTransferOptions,
},
};
}

Expand Down Expand Up @@ -126,7 +126,7 @@ export const msgTransferIBC = function (config: InitConfigurations) {
token: cro.v2.CoinV2.fromCustomAmountDenom(parsedMsg.token.amount, parsedMsg.token.denom),
sender: parsedMsg.sender,
receiver: parsedMsg.receiver,
timeoutTimestamp: Long.fromString(parsedMsg.timeout_timestamp),
timeoutTimestampInNanoSeconds: Long.fromString(parsedMsg.timeout_timestamp),
timeoutHeight,
});
}
Expand Down Expand Up @@ -158,7 +158,7 @@ export type MsgTransferOptions = {
sender: string;
receiver: string;
timeoutHeight?: IHeight | null;
timeoutTimestamp: Long;
timeoutTimestampInNanoSeconds: Long;
};

export type IHeight = {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/transaction/msg/ow.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const owMsgTransferIBCOptions = owStrictObject().exactShape({
sender: ow.string,
receiver: ow.string,
timeoutHeight: owIBCHeightOptional(),
timeoutTimestamp: owLong(),
timeoutTimestampInNanoSeconds: owLong(),
});

export const owMsgUpgradeClientOptions = owStrictObject().exactShape({
Expand Down

0 comments on commit 9937871

Please sign in to comment.