Skip to content

Commit

Permalink
blockchain: process withdrawals
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
  • Loading branch information
jsign committed Apr 26, 2024
1 parent 7d4deb1 commit df2e117
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/blockchain/blockchain.zig
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ pub const Blockchain = struct {

// TODO: logs bloom calculation.

// for (block.withdrawals) |w| {}
for (block.withdrawals) |w| {
const newBalance = (state.getAccount(w.address).balance + w.amount) * std.math.pow(u256, 10, 9);
try state.setBalance(w.address, newBalance);
}

return .{
.gas_used = block_gas_used,
Expand Down

0 comments on commit df2e117

Please sign in to comment.