fix(substreams): Fix storage changes indexing for DELEGATECALL

This commit is contained in:
Florian Pellissier
2024-07-19 12:18:58 +02:00
parent 00ab3fd7c9
commit 33e5f6a236

View File

@@ -131,7 +131,11 @@ pub fn extract_contract_changes<F: Fn(&[u8]) -> bool>(
block_tx
.calls
.iter()
.filter(|call| !call.state_reverted && inclusion_predicate(&call.address))
.filter(|call| {
!call.state_reverted && inclusion_predicate(&call.address) ||
inclusion_predicate(&call.caller) // In the context of DELEGATECALL
// call.caller changes it's own state
})
.for_each(|call| {
storage_changes.extend(call.storage_changes.iter());
balance_changes.extend(call.balance_changes.iter());