Skip to content

Commit

Permalink
fix: return deep clone on transactionRequest from method
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad committed Sep 3, 2024
1 parent b00fd02 commit f1eb990
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export interface BlobTransactionRequestLike extends BaseTransactionRequestLike {
export class BlobTransactionRequest extends BaseTransactionRequest {
static from(obj: BlobTransactionRequestLike) {
if (obj instanceof this) {
return obj;
return structuredClone(obj);
}
return new this(obj);
return structuredClone(obj);
}

/** Type of the transaction */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export interface CreateTransactionRequestLike extends BaseTransactionRequestLike
export class CreateTransactionRequest extends BaseTransactionRequest {
static from(obj: CreateTransactionRequestLike) {
if (obj instanceof this) {
return obj;
return structuredClone(obj);
}
return new this(obj);
return structuredClone(obj);
}

/** Type of the transaction */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export interface ScriptTransactionRequestLike extends BaseTransactionRequestLike
export class ScriptTransactionRequest extends BaseTransactionRequest {
static from(obj: ScriptTransactionRequestLike) {
if (obj instanceof this) {
return obj;
return structuredClone(obj);
}
return new this(obj);
return structuredClone(obj);
}

/** Type of the transaction */
Expand Down

0 comments on commit f1eb990

Please sign in to comment.