Skip to content

Commit

Permalink
Merge #4218
Browse files Browse the repository at this point in the history
4218: get_operation_id r=Eitu33 a=Eitu33



Co-authored-by: Thomas Plisson <[email protected]>
  • Loading branch information
bors[bot] and Thomas Plisson authored Jul 6, 2023
2 parents c1b1328 + 15ef232 commit 215bce5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 32 deletions.
77 changes: 45 additions & 32 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions massa-execution-worker/src/interface_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,14 @@ impl Interface for InterfaceImpl {
Ok(())
}

// Returns the operation id that originated the current execution if there is one
fn get_origin_operation_id(&self) -> Result<Option<String>> {
let operation_id = context_guard!(self)
.origin_operation_id
.map(|op_id| op_id.to_string());
Ok(operation_id)
}

/// Returns the period of the current execution slot
fn get_current_period(&self) -> Result<u64> {
let slot = context_guard!(self).slot;
Expand Down
1 change: 1 addition & 0 deletions massa-node/base_config/gas_costs/abi_gas_costs.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"assembly_script_print": 171,
"assembly_script_seed": 72,
"assembly_script_send_message": 286,
"assembly_script_get_origin_operation_id": 157,
"assembly_script_set_bytecode": 187,
"assembly_script_set_bytecode_for": 227,
"assembly_script_set_data": 188,
Expand Down

0 comments on commit 215bce5

Please sign in to comment.