Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

fix(profiles): throw an exception if the ID of a newly signed transaction is a duplicate #653

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ export class TransactionService {
private async signTransaction(type: string, input: any, options?: Contracts.TransactionOptions): Promise<string> {
const transaction: DTO.SignedTransactionData = await this.getService()[type](input, options);

if (this.#signed[transaction.id()] !== undefined) {
throw new Error(
`A transaction with the id [${transaction.id()}] already exists. Please ensure that you increase your nonce, and if applicable, set an explicit expiration.`,
);
}

this.#signed[transaction.id()] = transaction;

return transaction.id();
Expand Down