diff --git a/test-cases/invoke-contract-delegate/README.md b/test-cases/invoke-contract-delegate/README.md index 0bebd77..7811f7f 100644 --- a/test-cases/invoke-contract-delegate/README.md +++ b/test-cases/invoke-contract-delegate/README.md @@ -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 environment’s database. Function `invoke_contract_impl()` fetches the reference and calls it. Before and after this call it takes care of execution context bookkeeping.