You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable testing of ZCF and synchronous updates within a contract, contracts launched
by a tester must be able to provide direct access to objects within the contract, including
the zcf contract facet.
Description of the Design
ZCF is extended with the setTestJig operation, to which it can provide a function that will only be invoked when run in a test environment. That function returns an object to the test that launched the contract. The returned "jig" can hold properties for all the relevant access that the test needs.
The test provides a function (called setJig here) that will be invoked with the above testJig, extended
with a zcf argument to provide synchronous access to the contract's zcf contract facet. Typically, the setJig will simply set a variable in teh test environment. For fancier uses, it could extract or merge the
properties into an overall test jig, allowing multiple contracts to contribute to the overall test access for
integration tests, for example.
Security Considerations
The contract provides access to internal state for testing, but:
MUST NOT provide that state in production
MUST NOT receive state from the tester
Test Plan
Integrated into the ZCF and Soe test helpers code. Also used with an actual async membrane in the stablecoin dapp.
The text was updated successfully, but these errors were encountered:
What is the Problem Being Solved?
To enable testing of ZCF and synchronous updates within a contract, contracts launched
by a tester must be able to provide direct access to objects within the contract, including
the
zcf
contract facet.Description of the Design
ZCF is extended with the
setTestJig
operation, to which it can provide a function that will only be invoked when run in a test environment. That function returns an object to the test that launched the contract. The returned "jig" can hold properties for all the relevant access that the test needs.The test provides a function (called
setJig
here) that will be invoked with the abovetestJig
, extendedwith a
zcf
argument to provide synchronous access to the contract'szcf
contract facet. Typically, thesetJig
will simply set a variable in teh test environment. For fancier uses, it could extract or merge theproperties into an overall test jig, allowing multiple contracts to contribute to the overall test access for
integration tests, for example.
Security Considerations
The contract provides access to internal state for testing, but:
Test Plan
Integrated into the ZCF and Soe test helpers code. Also used with an actual async membrane in the stablecoin dapp.
The text was updated successfully, but these errors were encountered: