|
1 | 1 | /* eslint-disable sonarjs/no-duplicate-string */
|
2 |
| -import { Asset, Cardano, metadatum, nativeScriptPolicyId } from '@cardano-sdk/core'; |
| 2 | +import { Asset, Cardano, Serialization, metadatum, nativeScriptPolicyId } from '@cardano-sdk/core'; |
3 | 3 | import { Assets, BaseWallet, FinalizeTxProps } from '@cardano-sdk/wallet';
|
4 | 4 | import { InitializeTxProps } from '@cardano-sdk/tx-construction';
|
5 | 5 | import { KeyRole, TransactionSigner, util } from '@cardano-sdk/key-management';
|
@@ -168,13 +168,17 @@ describe('PersonalWallet.assets/nft', () => {
|
168 | 168 |
|
169 | 169 | const unsignedTx = await wallet.initializeTx(txProps);
|
170 | 170 |
|
| 171 | + const witness = { redeemers: unsignedTx.redeemers, scripts: [policyScript], signatures: new Map() }; |
| 172 | + |
171 | 173 | const finalizeProps: FinalizeTxProps = {
|
172 |
| - auxiliaryData, |
173 | 174 | signingOptions: {
|
174 | 175 | extraSigners: [policySigner]
|
175 | 176 | },
|
176 |
| - tx: unsignedTx, |
177 |
| - witness: { scripts: [policyScript] } |
| 177 | + tx: new Serialization.Transaction( |
| 178 | + Serialization.TransactionBody.fromCore(unsignedTx.body), |
| 179 | + Serialization.TransactionWitnessSet.fromCore(witness), |
| 180 | + Serialization.AuxiliaryData.fromCore(auxiliaryData) |
| 181 | + ) |
178 | 182 | };
|
179 | 183 |
|
180 | 184 | const signedTx = await wallet.finalizeTx(finalizeProps);
|
@@ -284,12 +288,16 @@ describe('PersonalWallet.assets/nft', () => {
|
284 | 288 |
|
285 | 289 | const unsignedTx = await wallet.initializeTx(txProps);
|
286 | 290 |
|
| 291 | + const witness = { redeemers: unsignedTx.redeemers, scripts: [policyScript], signatures: new Map() }; |
| 292 | + |
287 | 293 | const finalizeProps: FinalizeTxProps = {
|
288 | 294 | signingOptions: {
|
289 | 295 | extraSigners: [policySigner]
|
290 | 296 | },
|
291 |
| - tx: unsignedTx, |
292 |
| - witness: { scripts: [policyScript] } |
| 297 | + tx: new Serialization.Transaction( |
| 298 | + Serialization.TransactionBody.fromCore(unsignedTx.body), |
| 299 | + Serialization.TransactionWitnessSet.fromCore(witness) |
| 300 | + ) |
293 | 301 | };
|
294 | 302 |
|
295 | 303 | const signedTx = await wallet.finalizeTx(finalizeProps);
|
@@ -354,13 +362,17 @@ describe('PersonalWallet.assets/nft', () => {
|
354 | 362 |
|
355 | 363 | const unsignedTx = await wallet.initializeTx(txProps);
|
356 | 364 |
|
| 365 | + const witness = { redeemers: unsignedTx.redeemers, scripts: [policyScript], signatures: new Map() }; |
| 366 | + |
357 | 367 | const finalizeProps: FinalizeTxProps = {
|
358 |
| - auxiliaryData, |
359 | 368 | signingOptions: {
|
360 | 369 | extraSigners: [policySigner]
|
361 | 370 | },
|
362 |
| - tx: unsignedTx, |
363 |
| - witness: { scripts: [policyScript] } |
| 371 | + tx: new Serialization.Transaction( |
| 372 | + Serialization.TransactionBody.fromCore(unsignedTx.body), |
| 373 | + Serialization.TransactionWitnessSet.fromCore(witness), |
| 374 | + Serialization.AuxiliaryData.fromCore(auxiliaryData) |
| 375 | + ) |
364 | 376 | };
|
365 | 377 |
|
366 | 378 | const signedTx = await wallet.finalizeTx(finalizeProps);
|
|
0 commit comments