Skip to content

Commit

Permalink
fix: change tenderly tranasction type to optional on tenderly simulat…
Browse files Browse the repository at this point in the history
…ion (#103)
  • Loading branch information
yvesfracari authored Jan 15, 2025
1 parent 716f308 commit cd42b48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SimulationData {
// { [address: string]: { [token: string]: balanceDiff: string } }
// example: { '0x123': { '0x456': '100', '0xabc': '-100' } }
cumulativeBalancesDiff: Record<string, Record<string, string>>;
gasUsed: string;
gasUsed?: string;
}

export const simulationRepositorySymbol = Symbol.for('SimulationRepository');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class SimulationRepositoryTenderly implements SimulationRepository {

const balancesDiff = this.buildBalancesDiff(
response.simulation_results.map(
(result) => result.transaction.transaction_info.asset_changes || []
(result) => result.transaction?.transaction_info.asset_changes || []
)
);

Expand All @@ -62,7 +62,7 @@ export class SimulationRepositoryTenderly implements SimulationRepository {
id: simulation_result.simulation.id,
link: getTenderlySimulationLink(simulation_result.simulation.id),
cumulativeBalancesDiff: balancesDiff[i],
gasUsed: simulation_result.transaction.gas_used.toString(),
gasUsed: simulation_result.transaction?.gas_used.toString(),
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type TenderlySimulatePayload = {
// certainly not entirely accurate (and they have some interesting type names)

export interface TenderlySimulation {
transaction: Transaction;
transaction?: Transaction;
simulation: Simulation;
contracts: TenderlyContract[];
generated_access_list: GeneratedAccessList[];
Expand Down

0 comments on commit cd42b48

Please sign in to comment.