Skip to content

Commit

Permalink
fix missing check from merge with toXDR / fromXDR feature
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed Jun 14, 2024
1 parent 2654c10 commit c96e8c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/contract/assembled_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,16 @@ export class AssembledTransaction<T> {
}

simulate = async ({ restore }: {restore?: boolean} = {}): Promise<this> => {
if (!this.raw) {
throw new Error(
"Transaction has not yet been assembled; " +
"call `AssembledTransaction.build` first."
);
if (!this.built){
if(!this.raw) {
throw new Error(
"Transaction has not yet been assembled; " +
"call `AssembledTransaction.build` first."
);
}
this.built = this.raw.build();
}

restore = restore ?? this.options.restore;
this.built = this.raw.build();

// need to force re-calculation of simulationData for new simulation
delete this.simulationResult;
Expand Down

0 comments on commit c96e8c6

Please sign in to comment.