-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(simulation): update simulation models (breaking change) (#632)
* feat(sim): update sim models (breaking change) * update type * fix: add cookie to resolutions * fix: vulnerabilities and upgrade dependencies --------- Co-authored-by: tirumerla <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,808 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,96 @@ | ||
// Copied from openzeppelin/defender/models/src/types/simulation.res.d.ts | ||
|
||
export type Address = string; | ||
export type EventArgs = EventArgValues[]; | ||
/** | ||
* @minItems 3 | ||
*/ | ||
export type Log = [ | ||
Address | string[] | string, | ||
Address | string[] | string, | ||
Address | string[] | string, | ||
...(Address | string[] | string)[], | ||
]; | ||
export type BigUInt = string | string | number; | ||
export type BigUInt = string | number; | ||
|
||
export interface SimulationResponse { | ||
contractProposalId: string; | ||
createdAt: string; | ||
transaction: SimulationTransaction; | ||
meta: SimulationMetadata; | ||
states: ContractState[]; | ||
events: LogEvent[]; | ||
logs?: Log[]; | ||
storage: StorageState[]; | ||
traces: TransactionTrace[]; | ||
transfers: TransactionTrace[]; | ||
export interface SimulationRequest { | ||
blockNumber?: BigUInt; | ||
transactionData: Transaction; | ||
} | ||
export interface SimulationTransaction { | ||
export interface Transaction { | ||
from?: string; | ||
to: string; | ||
from: string; | ||
data: string; | ||
value: string; | ||
nonce: number; | ||
gasPrice: number; | ||
gasLimit?: number; | ||
} | ||
export interface SimulationMetadata { | ||
network: string; | ||
blockNumber: number; | ||
forkedBlockNumber: number; | ||
simulatedBlockNumber: number; | ||
gasUsed: number; | ||
returnValue: string; | ||
returnString: string; | ||
reverted: boolean; | ||
value: BigUInt; | ||
gasPrice?: number; | ||
gas?: number; | ||
nonce?: number; | ||
maxFeePerGas?: number; | ||
maxPriorityFeePerGas?: number; | ||
} | ||
export interface ContractState { | ||
function: string; | ||
types: string[]; | ||
states: { | ||
previous: string; | ||
current: string; | ||
|
||
export interface SimulationResponse { | ||
summary: { | ||
network: string; | ||
blockNumber: number; | ||
totalCalls: number; | ||
cummulativeGasUsed: number; | ||
reverted: boolean; | ||
result?: string; | ||
revertReason?: string; | ||
events: IEvent[]; | ||
contractStates: ContractState[]; | ||
states: TraceRecordStateDiff[]; | ||
transfers: TraceRecordTransaction[]; | ||
}; | ||
records: { | ||
index: number; | ||
transaction: TraceRecordTransaction; | ||
events?: IEvent[]; | ||
states?: TraceRecordStateDiff[]; | ||
status: { | ||
reverted: boolean; | ||
gasUsed: string; | ||
returnValue: string; | ||
}; | ||
revertReason?: string; | ||
}[]; | ||
contractProposalId: string; | ||
createdAt: string; | ||
error?: string; | ||
} | ||
export interface LogEvent { | ||
address: Address; | ||
export interface IEvent { | ||
address?: string; | ||
name: string; | ||
signature: string; | ||
topics?: string[]; | ||
args: EventArgs; | ||
topics: string[]; | ||
args: EventArg[]; | ||
} | ||
export interface EventArgValues { | ||
name?: string; | ||
type?: string; | ||
indexed?: boolean; | ||
value: string | Record<string, unknown>; | ||
export interface EventArg { | ||
value: string | number | boolean | object; | ||
name: string; | ||
indexed: boolean; | ||
type: string; | ||
} | ||
export interface StorageState { | ||
address: Address; | ||
slot: string; | ||
export interface ContractState { | ||
address: string; | ||
states: { | ||
previous?: string; | ||
current: string; | ||
[k: string]: ContractStateValue; | ||
}; | ||
} | ||
export interface TransactionTrace { | ||
depth: number; | ||
type: string; | ||
gas: BigUInt; | ||
to: string; | ||
value: BigUInt; | ||
data: string; | ||
export interface ContractStateValue { | ||
types: string[]; | ||
pre: string; | ||
post: string; | ||
changed: boolean; | ||
} | ||
|
||
// Copied from openzeppelin/defender/models/src/types/simulation.req.d.ts | ||
|
||
export interface SimulationRequest { | ||
blockNumber?: BigUInt; | ||
transactionData: TransactionData; | ||
export interface TraceRecordStateDiff { | ||
address: string; | ||
key: string; | ||
pre: string; | ||
post: string; | ||
changed: boolean; | ||
} | ||
export interface TransactionData { | ||
to: Address; | ||
from?: Address; | ||
value: BigUInt; | ||
export interface TraceRecordTransaction { | ||
type: 'CALL' | 'DELEGATECALL' | 'STATICCALL'; | ||
data: string; | ||
[k: string]: unknown; | ||
from: string; | ||
to: string; | ||
gas?: string; | ||
gasPrice?: string; | ||
value?: string; | ||
nonce?: string; | ||
blockNumber?: string; | ||
description?: { | ||
[k: string]: unknown; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.