mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(examples): ExEx rollup reverts (#8151)
This commit is contained in:
@ -114,14 +114,14 @@ impl Database {
|
||||
if reverts.accounts.len() > 1 {
|
||||
eyre::bail!("too many blocks in account reverts");
|
||||
}
|
||||
for (address, account) in
|
||||
reverts.accounts.first().ok_or(eyre::eyre!("no account reverts"))?
|
||||
{
|
||||
if let Some(account_reverts) = reverts.accounts.into_iter().next() {
|
||||
for (address, account) in account_reverts {
|
||||
tx.execute(
|
||||
"INSERT INTO account_revert (block_number, address, data) VALUES (?, ?, ?) ON CONFLICT(block_number, address) DO UPDATE SET data = excluded.data",
|
||||
(block.header.number.to_string(), address.to_string(), serde_json::to_string(account)?),
|
||||
(block.header.number.to_string(), address.to_string(), serde_json::to_string(&account)?),
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
for PlainStorageChangeset { address, wipe_storage, storage } in changeset.storage {
|
||||
if wipe_storage {
|
||||
@ -139,9 +139,8 @@ impl Database {
|
||||
if reverts.storage.len() > 1 {
|
||||
eyre::bail!("too many blocks in storage reverts");
|
||||
}
|
||||
for PlainStorageRevert { address, wiped, storage_revert } in
|
||||
reverts.storage.into_iter().next().ok_or(eyre::eyre!("no storage reverts"))?
|
||||
{
|
||||
if let Some(storage_reverts) = reverts.storage.into_iter().next() {
|
||||
for PlainStorageRevert { address, wiped, storage_revert } in storage_reverts {
|
||||
let storage = storage_revert
|
||||
.into_iter()
|
||||
.map(|(k, v)| (B256::new(k.to_be_bytes()), v))
|
||||
@ -154,6 +153,7 @@ impl Database {
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (hash, bytecode) in changeset.contracts {
|
||||
tx.execute(
|
||||
|
||||
Reference in New Issue
Block a user