Skip to content

Commit

Permalink
Added Update on Correcting this Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoBeccar authored Nov 17, 2023
1 parent d800633 commit 9a20525
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test-cases/invoke-contract-delegate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ While the end-to-end test operates correctly by successfully delegating the call
## Result

This function has a lot of overlap with invoke_contract. Once one of the two is implemented the other one should cost only a few more days.

## Update on Correcting this Issue

Functions `invoke_contract()` and `invoke_contract_delegate()` have almost identical implementations in our proposed [PR #1988](https://github.com/paritytech/ink/pull/1988).

After getting their arguments from the `CallParams` object they call a new internal function `invoke_contract_impl()` which handles the invocation logic. Of note is that the actual call into the generated dispatch function is done by `execute_contract_call()`. This function is only instantiated by rustc per-contract when a test calls `ink::env::test::upload_code()`. Function `upload_code()` adds a reference to `execute_contract_call()` to the environments database. Function `invoke_contract_impl()` fetches the reference and calls it. Before and after this call it takes care of execution context bookkeeping.

0 comments on commit 9a20525

Please sign in to comment.