|
2 | 2 | import * as Cardano from '../../../src/Cardano';
|
3 | 3 | import * as Crypto from '@cardano-sdk/crypto';
|
4 | 4 | import { HexBlob } from '@cardano-sdk/util';
|
5 |
| -import { TransactionBody, TxBodyCBOR, TxCBOR } from '../../../src/Serialization'; |
| 5 | +import { Transaction, TransactionBody, TxBodyCBOR, TxCBOR } from '../../../src/Serialization'; |
6 | 6 | import { babbageTx } from '../testData';
|
7 | 7 | import { mintTokenMap, params, txIn, txOut } from './testData';
|
8 | 8 |
|
@@ -273,6 +273,24 @@ describe('TransactionBody', () => {
|
273 | 273 | expect(body.toCore()).toEqual(expectedConwayCore);
|
274 | 274 | });
|
275 | 275 |
|
| 276 | + it('can encode identify transactions output format - Babbage outputs', () => { |
| 277 | + const tx = Transaction.fromCbor( |
| 278 | + TxCBOR( |
| 279 | + '84a500818258207aa1264bcd0c06f34a49ed1dd7307a2bdec5a97bdeb546498759ad5b8ed42fd5010182a200583930195bde3deacb613b7e9eb6280b14db4e353e475e96d19f3f7a5e2d66195bde3deacb613b7e9eb6280b14db4e353e475e96d19f3f7a5e2d66011a00e4e1c0a2005839003d3246dc0c50ab3c74a8ffdd8068313ff99d341c461a8fe31f416d0a8fba06d60d71edc077cc5ebcb8ff82137afbce68df98271909332348011b000000025106a838021a00029309031a04a07bc6081a04a07a40a0f5f6' |
| 280 | + ) |
| 281 | + ); |
| 282 | + expect(tx.body().hasBabbageOutput()).toBeTruthy(); |
| 283 | + }); |
| 284 | + |
| 285 | + it('can encode identify transactions output format - Legacy outputs', () => { |
| 286 | + const tx = Transaction.fromCbor( |
| 287 | + TxCBOR( |
| 288 | + '84a500818258207aa1264bcd0c06f34a49ed1dd7307a2bdec5a97bdeb546498759ad5b8ed42fd501018282583930195bde3deacb613b7e9eb6280b14db4e353e475e96d19f3f7a5e2d66195bde3deacb613b7e9eb6280b14db4e353e475e96d19f3f7a5e2d661a00e4e1c0825839003d3246dc0c50ab3c74a8ffdd8068313ff99d341c461a8fe31f416d0a8fba06d60d71edc077cc5ebcb8ff82137afbce68df982719093323481b000000025106a838021a00029309031a04a07bc6081a04a07a40a0f5f6' |
| 289 | + ) |
| 290 | + ); |
| 291 | + expect(tx.body().hasBabbageOutput()).toBeFalsy(); |
| 292 | + }); |
| 293 | + |
276 | 294 | it('sorts withdrawals canonically', () => {
|
277 | 295 | const body = TransactionBody.fromCbor(cbor);
|
278 | 296 | const withdrawals = body.withdrawals();
|
|
0 commit comments