Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "getVariable is not a function" when used with OZ upgrade-plugin. #150

Open
ddnexus opened this issue Aug 21, 2022 · 3 comments
Open

Comments

@ddnexus
Copy link

ddnexus commented Aug 21, 2022

I am not sure whether this is a known limitation or it's just that I am missing something, so here is the description:

I try to use it with an OZ UUPS proxy I get: getVariable is not a function

The contract must be deployed using the upgrades.deployProxy() from the OZ upgrades HH plugin, and I managed to get no complaints from typescript:

const ProxyMock = await smock.mock("MyContract");
const proxyMock = await upgrades.deployProxy(ProxyMock as MockContractFactory<MyContract__factory> & MyContract__factory, [...]) as MyContract & MockContract<MyContract>;

However that does not help.
How should I hook into the customized deployment of the upgrade-plugin, if that is possible, or how can I get around it with some manual work around?

Thanks

@0xlucian
Copy link

0xlucian commented Jul 2, 2023

Have you resolved this problem? I also got stuck into this one and I need to use same function.

@ddnexus
Copy link
Author

ddnexus commented Jul 2, 2023

Well... I avoided it by not using smock, creating my own infrastructure that tests the real code instead.

More work but a lot better testing in my case.

@0xlucian
Copy link

0xlucian commented Jul 2, 2023

Yeah me too. I still use utilize Fakes to fake external dependencies in contracts, but cannot think of any workaround for this case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants