Skip to content

TransactionMapping fromDTO fails to load transactions #107

@dgarcia360

Description

@dgarcia360
  1. Expected behavior and actual behavior.

Using TransactionMapping class we can create Transactions using the DTO format. Once we turn a transaction to DTO, and try to recreate it using TransactionMapping.fromDTO(transaction.toJSON()) we get the following error:

TypeError: Cannot read property 'type' of undefined from \nem2sdk\dist\src\infrastructure\transaction\CreateTransactionFromDTO.js:60:36.

  1. Steps to reproduce the problem.
    const transferTransaction = TransferTransaction.create(
        Deadline.create(),
        Address.createFromRawAddress('SAGYCE-QM5SK2-TGFUC5-Z5GZJR-ATKTBS-UQQMMH-KW5B'),
        [NetworkCurrencyMosaic.createRelative(10)],
        PlainMessage.create('hello'),
        NetworkType.MIJIN_TEST
    );
    TransactionMapping.createFromDTO(transferTransaction.toJSON());

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions