Skip to content

Commit

Permalink
Update massa-sc-runtime dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-François Morcillo <jfm@massa.net>
Signed-off-by: Damir Vodenicarevic <damipator@gmail.com>
  • Loading branch information
damip authored and Jean-François Morcillo committed May 3, 2023
1 parent 3059967 commit 9286a86
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 78 deletions.
82 changes: 17 additions & 65 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="bilboquet/issue235_language_agnostic_smartcontract" }

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

Expand Down
4 changes: 2 additions & 2 deletions massa-execution-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ massa_execution_exports = { path = "../massa-execution-exports" }
massa_models = { path = "../massa-models" }
massa_storage = { path = "../massa-storage" }
massa_hash = { path = "../massa-hash" }
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 = "bilboquet/issue235_language_agnostic_smartcontract" }
massa_module_cache = { path = "../massa-module-cache" }
massa_signature = { path = "../massa-signature" }
massa_time = { path = "../massa-time" }
Expand All @@ -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
2 changes: 1 addition & 1 deletion massa-module-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tracing = "0.1"
massa_hash = { path = "../massa-hash" }
massa_models = { path = "../massa-models" }
massa_serialization = { path = "../massa-serialization" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "testnet_22", features = [
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "bilboquet/issue235_language_agnostic_smartcontract", features = [
"testing",
] }

Expand Down

0 comments on commit 9286a86

Please sign in to comment.