Skip to content

Commit d531d87

Browse files
fix(sdk-coin-iota): update method params for iota controller
Ticket: WIN-8054 TICKET: WIN-8054
1 parent 2959566 commit d531d87

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

modules/sdk-coin-iota/src/iota.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ export class Iota extends BaseCoin {
9191
* @inheritDoc
9292
*/
9393
async explainTransaction(params: ExplainTransactionOptions): Promise<TransactionExplanation> {
94-
const rawTx = params.txBase64;
94+
const rawTx = params.txHex;
9595
if (!rawTx) {
96-
throw new Error('missing required tx prebuild property txBase64');
96+
throw new Error('missing required tx prebuild property txHex');
9797
}
9898
const transaction = await this.rebuildTransaction(rawTx);
9999
if (!transaction) {
@@ -108,9 +108,9 @@ export class Iota extends BaseCoin {
108108
*/
109109
async verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
110110
const { txPrebuild: txPrebuild, txParams: txParams } = params;
111-
const rawTx = txPrebuild.txBase64;
111+
const rawTx = txPrebuild.txHex;
112112
if (!rawTx) {
113-
throw new Error('missing required tx prebuild property txBase64');
113+
throw new Error('missing required tx prebuild property txHex');
114114
}
115115
const transaction = await this.rebuildTransaction(rawTx);
116116
if (!transaction) {
@@ -145,7 +145,7 @@ export class Iota extends BaseCoin {
145145
* @param params
146146
*/
147147
async parseTransaction(params: IotaParseTransactionOptions): Promise<ParsedTransaction> {
148-
const transactionExplanation = await this.explainTransaction({ txBase64: params.txBase64 });
148+
const transactionExplanation = await this.explainTransaction({ txHex: params.txHex });
149149

150150
if (!transactionExplanation) {
151151
throw new Error('Invalid transaction');

modules/sdk-coin-iota/src/lib/iface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export interface TransferTxData extends TxData {
4343
}
4444

4545
export interface ExplainTransactionOptions {
46-
txBase64: string;
46+
txHex: string;
4747
}
4848

4949
export interface IotaParseTransactionOptions extends BaseParseTransactionOptions {
50-
txBase64: string;
50+
txHex: string;
5151
}

modules/sdk-coin-iota/test/unit/iota.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ describe('IOTA:', function () {
136136
});
137137

138138
describe('explainTransaction', () => {
139-
it('should throw error for missing txBase64', async function () {
139+
it('should throw error for missing txHex', async function () {
140140
await assert.rejects(
141-
async () => await basecoin.explainTransaction({ txBase64: '' }),
142-
/missing required tx prebuild property txBase64/
141+
async () => await basecoin.explainTransaction({ txHex: '' }),
142+
/missing required tx prebuild property txHex/
143143
);
144144
});
145145

146146
it('should throw error for invalid transaction', async function () {
147147
await assert.rejects(
148-
async () => await basecoin.explainTransaction({ txBase64: 'invalidTxBase64' }),
148+
async () => await basecoin.explainTransaction({ txHex: 'invalidTxHex' }),
149149
/Failed to rebuild transaction/
150150
);
151151
});
@@ -171,14 +171,14 @@ describe('IOTA:', function () {
171171
});
172172

173173
describe('verifyTransaction', () => {
174-
it('should throw error for missing txBase64', async function () {
174+
it('should throw error for missing txHex', async function () {
175175
await assert.rejects(
176176
async () =>
177177
await basecoin.verifyTransaction({
178178
txPrebuild: {},
179179
txParams: { recipients: testData.recipients },
180180
}),
181-
/missing required tx prebuild property txBase64/
181+
/missing required tx prebuild property txHex/
182182
);
183183
});
184184

@@ -237,7 +237,7 @@ describe('IOTA:', function () {
237237
describe('parseTransaction', () => {
238238
it('should throw error for invalid transaction', async function () {
239239
await assert.rejects(
240-
async () => await basecoin.parseTransaction({ txBase64: 'invalidTxBase64' }),
240+
async () => await basecoin.parseTransaction({ txHex: 'invalidTxHex' }),
241241
/Failed to rebuild transaction/
242242
);
243243
});

0 commit comments

Comments
 (0)