Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cf1c093
create debug storage contract for testing
eshaben Jan 26, 2021
cce0f48
add initial debug_storageRangeAt entry point to api
eshaben Jan 26, 2021
5af3f4f
create initial test
eshaben Jan 26, 2021
b6fa4b0
add debug_traceTransaction logic so we can recompute txs
eshaben Jan 26, 2021
2299c0f
use contract address to set state root
eshaben Jan 26, 2021
c1318ac
use startKey and maxResult to iterate over storage entries
eshaben Jan 26, 2021
57c8940
oops remove left over comment
eshaben Jan 26, 2021
0c3caef
get nextKey and format return data correctly
eshaben Jan 26, 2021
a118a50
return result and update test assertions
eshaben Jan 26, 2021
10a9b39
add more tests
eshaben Jan 26, 2021
61eeed6
add keccak hash key to storage output
eshaben Jan 28, 2021
7ab7c86
remove irrelevant logic
eshaben Feb 9, 2021
522672d
create an in memory map for storage keys and write it to block
eshaben Feb 9, 2021
14b462e
fill in memory storage map with raw and hashed version of storage keys
eshaben Feb 9, 2021
abdff2e
create storageKeys db
eshaben Feb 9, 2021
cf5d306
save storage keys to the database one at a time
eshaben Feb 9, 2021
49eed1d
remove irrelevant comment
eshaben Feb 9, 2021
d142bbf
create function to get storage keys
eshaben Feb 9, 2021
b7939c5
fix tests
eshaben Feb 9, 2021
1b8b8d6
check if the startKey matches any of the keys from the trie stream
eshaben Feb 9, 2021
d014318
try hashing the startKey and seeing if the hashed key matches any of …
eshaben Feb 9, 2021
9fbd8b9
handle arbitrary hexadecimal strings as startKeys
eshaben Feb 9, 2021
6bf68a2
add complex storage for additional testing
eshaben Feb 11, 2021
9aeb4f6
sort keys and filter by start key to get storage results
eshaben Feb 11, 2021
574649a
fix conditional as we want to include keys that are the same
eshaben Feb 11, 2021
e35a7ca
add debug complex storage tests
eshaben Feb 11, 2021
f0aec98
remove .only flag on tests
eshaben Feb 11, 2021
49f6915
remove duplicate traceTransaction code
eshaben Feb 11, 2021
2467308
update comments for storageRangeAt
eshaben Feb 11, 2021
c699f6f
update fn name
eshaben Feb 11, 2021
46b1d79
add typings
eshaben Feb 11, 2021
01e6f7f
remove extra describe block
eshaben Feb 11, 2021
2c785f7
fix spacing
eshaben Feb 11, 2021
b774179
update comments
eshaben Feb 11, 2021
aaad871
add api annotation
eshaben Feb 11, 2021
b5bba2f
throw error if we can't find the address in the trie
eshaben Feb 17, 2021
f4ee6d7
super messy but transaction indexes now work
eshaben Feb 18, 2021
99ee6eb
clean up test for transaction indexes
eshaben Feb 18, 2021
d52b5bf
remove comments
eshaben Feb 18, 2021
d37a8a4
clean up comments
eshaben Feb 18, 2021
02e5654
the rawKey shouldn't need to be padded
eshaben Feb 18, 2021
b6b14ef
wip
eshaben Feb 19, 2021
c40ac9d
add descriptions to parameters
eshaben Feb 23, 2021
b24b558
fix typo
eshaben Feb 23, 2021
0abc80b
remove unused import
eshaben Feb 23, 2021
166db81
update comment for accuracy
eshaben Feb 23, 2021
e90dd00
remove unnecessary async keyword
eshaben Feb 23, 2021
9b516b6
update keys declaration
eshaben Feb 23, 2021
3e9ae3c
remove unnecessary try/catch
eshaben Feb 23, 2021
ca4124e
clean up test
eshaben Feb 23, 2021
2c5e1b3
create reusable getFromTrie function
eshaben Feb 25, 2021
c062285
create internal traceTransaction function
eshaben Feb 25, 2021
045074f
remove .only
eshaben Feb 25, 2021
21b9e03
pass storageKeys to runtimeBlock.finalize
eshaben Feb 25, 2021
760e8ba
move StepEvent type to utils
eshaben Feb 25, 2021
733d314
use assert.rejects in test
eshaben Feb 25, 2021
2f970bb
wrap test in snapshot and revert
eshaben Feb 25, 2021
ea431f5
use Promise.all in test
eshaben Feb 25, 2021
0c71c3b
update storageKeys key to be a string instead of a buffer
eshaben Feb 25, 2021
3d21b85
remove .only on test
eshaben Feb 25, 2021
468c623
update error message for tx index out of range
eshaben Feb 25, 2021
a6187d7
create test for transaction index out of range
eshaben Feb 25, 2021
62ad4f1
remove unnecessary async keyword
eshaben Feb 25, 2021
726bfa8
update comments
eshaben Feb 25, 2021
487c80f
fix typing of keys array
eshaben Feb 25, 2021
b5cc898
throw error instead of console.log it
eshaben Feb 25, 2021
d9966c4
remove unneccessary for loop
eshaben Feb 25, 2021
20ab776
clean up promises
eshaben Feb 25, 2021
c383f1c
update keccak import
eshaben Feb 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update keys declaration
  • Loading branch information
eshaben committed Feb 25, 2021
commit 9b516b6a5dd6744ba1778a83e45a1f38e0d931f5
6 changes: 3 additions & 3 deletions src/chains/ethereum/ethereum/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,8 @@ export default class Blockchain extends Emittery.Typed<
])[2];

// use the addresses storage trie to get relevant hashed keys
let keys: Buffer[] = [];
const getStorageKeys = () => {
let keys: Buffer[] = [];
return new Promise((resolve, reject) => {
trie
.createReadStream()
Expand Down Expand Up @@ -1548,7 +1548,7 @@ export default class Blockchain extends Emittery.Typed<
});
});
};
await getStorageKeys();
const keys = await getStorageKeys();

// get txHash using txIndex
const transactions = targetBlock.getTransactions();
Expand All @@ -1562,7 +1562,7 @@ export default class Blockchain extends Emittery.Typed<
const { storage } = await this.erinTraceTransaction(
transactionHash,
contractAddress,
keys,
keys as Buffer[],
{
disableMemory: true,
disableStack: false,
Expand Down