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
From @LHerskind: "The interfaces seems to have wrappers for private -> something but not from public to something. Many public functions are callable from both, but they have different return values and contexts etc."
Options seem to be:
Align the return values of public and private calls (but that ruins the safety of the interface, and would confuse users who'll receive useless return values when making public calls from private)
Create two MyContractInterface structs: MyContractInterface_CallableFromPrivate and MyContractInterface_CallableFromPublic (naming could be improved 😅). A bit ugly, but would actually make it clear that you can't make a conventional 'call' to a private function from a public function (because we'd omit private functions from the MyContractInterface_CallableFromPublic interface.
Create two versions of each function, within a single interface MyContractInterface, foo_from_private and foo_from_public, but that's pretty disgusting, as these names don't match the names of the original contract!
There's consensus that Option 2 is the best approach.
Generates two interface structs for each contract `Foo`: a
`FooPrivateContextInterface` and a `FooPublicContextInterface`. The
former is exactly as the one we had already, while the latter only
contains public methods and uses public contexts instead of private
ones.
Fixes#1782
From @LHerskind:
"The interfaces seems to have wrappers for private -> something but not from public to something. Many public functions are callable from both, but they have different return values and contexts etc."
Options seem to be:
MyContractInterface
structs:MyContractInterface_CallableFromPrivate
andMyContractInterface_CallableFromPublic
(naming could be improved 😅). A bit ugly, but would actually make it clear that you can't make a conventional 'call' to a private function from a public function (because we'd omit private functions from theMyContractInterface_CallableFromPublic
interface.MyContractInterface
,foo_from_private
andfoo_from_public
, but that's pretty disgusting, as these names don't match the names of the original contract!There's consensus that Option 2 is the best approach.
With option 2, the importing contract would do:
The text was updated successfully, but these errors were encountered: