Skip to content

Commit

Permalink
Forward the generateEncryptedSeedSC flag to the TransactionRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne authored and samuelmanzanera committed Dec 12, 2023
1 parent 309c82a commit 5577386
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transaction_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}

Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export type TransactionRPC = {
previousPublicKey: string;
previousSignature: string;
originSignature?: string;
generateEncryptedSeedSC?: boolean;
};

export type TransactionFee = {
Expand Down
7 changes: 7 additions & 0 deletions tests/transaction_builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down

0 comments on commit 5577386

Please sign in to comment.