From a6ec87385cc9dcb8407793df1c49f2f77e0a7364 Mon Sep 17 00:00:00 2001 From: bchamagne Date: Tue, 12 Dec 2023 09:27:56 +0100 Subject: [PATCH] Forward the generateEncryptedSeedSC flag to the TransactionRPC --- src/transaction_builder.ts | 3 ++- src/types.ts | 1 + tests/transaction_builder.test.ts | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/transaction_builder.ts b/src/transaction_builder.ts index 0a17aa1..a14cc24 100644 --- a/src/transaction_builder.ts +++ b/src/transaction_builder.ts @@ -476,7 +476,8 @@ export default class TransactionBuilder { }, previousPublicKey: uint8ArrayToHex(this.previousPublicKey), previousSignature: uint8ArrayToHex(this.previousSignature), - originSignature: this.originSignature && uint8ArrayToHex(this.originSignature) + originSignature: this.originSignature && uint8ArrayToHex(this.originSignature), + generateEncryptedSeedSC: this.generateEncryptedSeedSC }; } diff --git a/src/types.ts b/src/types.ts index 870eb35..fb4ec67 100644 --- a/src/types.ts +++ b/src/types.ts @@ -237,6 +237,7 @@ export type TransactionRPC = { previousPublicKey: string; previousSignature: string; originSignature?: string; + generateEncryptedSeedSC?: boolean; }; export type TransactionFee = { diff --git a/tests/transaction_builder.test.ts b/tests/transaction_builder.test.ts index 05f330f..6df600d 100644 --- a/tests/transaction_builder.test.ts +++ b/tests/transaction_builder.test.ts @@ -446,6 +446,13 @@ describe("Transaction builder", () => { expect(tx.generateEncryptedSeedSC).toEqual(generateEncryptedSeedSC); }); + it("should affect the TransactionRPC", () => { + const generateEncryptedSeedSC = true; + const tx = new TransactionBuilder("transfer").setGenerateEncryptedSeedSC(generateEncryptedSeedSC); + const txRPC = tx.toNodeRPC() + + expect(txRPC).toHaveProperty("generateEncryptedSeedSC", true); + }); }); describe("build", () => {