Skip to content

Commit

Permalink
Update massa-sc-runtime dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Damir Vodenicarevic <damipator@gmail.com>
Signed-off-by: Jean-François Morcillo <jfm@massa.net>
  • Loading branch information
damip authored and Jean-François Morcillo committed May 3, 2023
1 parent 3059967 commit d9b7cc8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 78 deletions.
86 changes: 19 additions & 67 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion massa-execution-exports/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ massa_storage = { path = "../massa-storage" }
massa_final_state = { path = "../massa-final-state" }
massa_ledger_exports = { path = "../massa-ledger-exports", optional = true }
massa_module_cache = { path = "../massa-module-cache" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "testnet_22" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch="testnet_22" }

# for more information on what are the following features used for, see the cargo.toml at workspace level

Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ massa_versioning_worker = { path = "../massa-versioning-worker" }
tokio = { version = "1.23", features = ["sync"] }
massa_pos_worker = { path = "../massa-pos-worker" }
massa_ledger_worker = { path = "../massa-ledger-worker" }
serial_test = "0.10"
serial_test = "1.0.0"
tempfile = "3.2"
hex-literal = "0.3.4"
# custom modules with testing enabled
Expand Down
19 changes: 10 additions & 9 deletions massa-execution-worker/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,10 +840,11 @@ impl ExecutionState {
self.config.gas_costs.clone(),
);
match response {
Ok(Response { init_cost, .. }) | Err(VMError::ExecutionError { init_cost, .. }) => {
Ok(Response { init_gas_cost, .. })
| Err(VMError::ExecutionError { init_gas_cost, .. }) => {
self.module_cache
.write()
.set_init_cost(&bytecode, init_cost);
.set_init_cost(&bytecode, init_gas_cost);
}
_ => (),
}
Expand Down Expand Up @@ -938,17 +939,17 @@ impl ExecutionState {
self.config.gas_costs.clone(),
);
match response {
Ok(Response { init_cost, .. }) => {
Ok(Response { init_gas_cost, .. }) => {
self.module_cache
.write()
.set_init_cost(&bytecode, init_cost);
.set_init_cost(&bytecode, init_gas_cost);
Ok(())
}
Err(error) => {
if let VMError::ExecutionError { init_cost, .. } = error {
if let VMError::ExecutionError { init_gas_cost, .. } = error {
self.module_cache
.write()
.set_init_cost(&bytecode, init_cost);
.set_init_cost(&bytecode, init_gas_cost);
}
// execution failed: reset context to snapshot and reimburse sender
let err = ExecutionError::VMError {
Expand Down Expand Up @@ -1408,11 +1409,11 @@ impl ExecutionState {
self.config.gas_costs.clone(),
);
match response {
Ok(Response { init_cost, .. })
| Err(VMError::ExecutionError { init_cost, .. }) => {
Ok(Response { init_gas_cost, .. })
| Err(VMError::ExecutionError { init_gas_cost, .. }) => {
self.module_cache
.write()
.set_init_cost(&bytecode, init_cost);
.set_init_cost(&bytecode, init_gas_cost);
}
_ => (),
}
Expand Down

0 comments on commit d9b7cc8

Please sign in to comment.