Adds new functionality to the host::invoke function allowing smart contracts to query the module reference and contract name of a smart contract instance.
Changes
Add predicate supportsContractInspectionQueries on the protocol version for determining if the module reference and contract name queries should be available.
Add a new parameter to call_receive_v1 indicating if the functionality for querying the module reference and contract name are available.
Add handlers in invoke for querying the module reference and for querying the contract name.
Add testing smart contracts:
queries-contract-inspect: contracts that use invoke to inspect the module reference and contract name of contract instances.
upgrading-inspect-module0, upgrading-inspect-module1: contracts for testing the interaction between upgrading a contract and querying the module reference. (These contracts are the same except the second one cannot be initialised.)
Checklist
[X] My code follows the style of this project.
[X] The code compiles without warnings.
[X] I have performed a self-review of the changes.
[X] I have documented my code, in particular the intent of the
hard-to-understand areas.
Purpose
Adds new functionality to the
host::invoke
function allowing smart contracts to query the module reference and contract name of a smart contract instance.Changes
supportsContractInspectionQueries
on the protocol version for determining if the module reference and contract name queries should be available.call_receive_v1
indicating if the functionality for querying the module reference and contract name are available.invoke
for querying the module reference and for querying the contract name.queries-contract-inspect
: contracts that useinvoke
to inspect the module reference and contract name of contract instances.upgrading-inspect-module0
,upgrading-inspect-module1
: contracts for testing the interaction between upgrading a contract and querying the module reference. (These contracts are the same except the second one cannot be initialised.)Checklist