From fc31aa897b214277d15b180fad0d733d3bbdabdb Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Fri, 3 May 2024 20:11:15 +0200 Subject: [PATCH] actually use pubdata diff --- src/instruction_handlers/storage.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/instruction_handlers/storage.rs b/src/instruction_handlers/storage.rs index a57779fb..6475b04f 100644 --- a/src/instruction_handlers/storage.rs +++ b/src/instruction_handlers/storage.rs @@ -61,8 +61,7 @@ fn sstore(vm: &mut VirtualMachine, instruction: *const Instruction) -> Instructi // Note, that the diff may be negative, e.g. in case the new write returns to the previous value. let diff = (to_pay_by_user as i32) - (prepaid as i32); - - // ^ This is the current pubdata price payed by user + vm.state.current_frame.total_pubdata_spent += diff; vm.world .insert_prepaid_for_write(vm.state.current_frame.address, key, to_pay_by_user);