Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix: make debug_storageRangeAt return all known keys at transaction…
Browse files Browse the repository at this point in the history
… index (#3470)

Co-authored-by: MicaiahReid <[email protected]>
  • Loading branch information
davidmurdoch and MicaiahReid committed Feb 14, 2023
1 parent 533f002 commit 57f0423
Show file tree
Hide file tree
Showing 9 changed files with 588 additions and 539 deletions.
15 changes: 12 additions & 3 deletions src/chains/ethereum/ethereum/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3135,11 +3135,12 @@ export default class EthereumApi implements Api {
* console.log(transactionTrace);
* ```
*/
@assertArgLength(1, 2)
async debug_traceTransaction(
transactionHash: DATA,
options?: Ethereum.TraceTransactionOptions
options: Ethereum.TraceTransactionOptions = {}
): Promise<Ethereum.TraceTransactionResult<"private">> {
return this.#blockchain.traceTransaction(transactionHash, options || {});
return this.#blockchain.traceTransaction(transactionHash, options);
}

// TODO: example doesn't return correct value
Expand Down Expand Up @@ -3186,14 +3187,22 @@ export default class EthereumApi implements Api {
* console.log(storage);
* ```
*/
@assertArgLength(5)
async debug_storageRangeAt(
blockHash: DATA,
transactionIndex: number,
contractAddress: DATA,
startKey: DATA,
maxResult: number
): Promise<Ethereum.StorageRangeAtResult<"private">> {
return this.#blockchain.storageRangeAt(
const blockchain = this.#blockchain;
if (blockchain.fallback) {
throw new Error(
"debug_storageRangeAt is not supported on a forked network. See https://github.com/trufflesuite/ganache/issues/3488 for details."
);
}

return blockchain.storageRangeAt(
blockHash,
Quantity.toNumber(transactionIndex),
contractAddress,
Expand Down
Loading

0 comments on commit 57f0423

Please sign in to comment.