Hey Nick, just wanted to mention there's a typo in your example. Where you're defining the FriendsFacet.sol file, you're naming the contract PersonsFacet and I think you want it to be FriendsFacet.
Hi Nick, when using an upgraded facet where you have added a new function with the DiamondCut is it common to get an error: "Error: missing revert data in call exception; Transaction reverted without a reason." When printing out the contract it looks like the newly added function did make it but I am unable to use any functions that were added added.
hm, I can call any function from the facets first deployment. However, when I try to call functions that were added to the facet with an upgrade they error out. Is there an example of upgrading an existing facet I can check out?
Are you calling functions on the diamond address or facet address? Functions are added to a diamond, not a facet. So you have to call functions on the diamond address.
Hey Nick, just wanted to mention there's a typo in your example. Where you're defining the FriendsFacet.sol file, you're naming the contract PersonsFacet and I think you want it to be FriendsFacet.
Hi Josh. You are right. I fixed it. Thanks for that.
Hi Nick, when using an upgraded facet where you have added a new function with the DiamondCut is it common to get an error: "Error: missing revert data in call exception; Transaction reverted without a reason." When printing out the contract it looks like the newly added function did make it but I am unable to use any functions that were added added.
I don't know why you are getting that error. Just a guess, maybe you are trying to call the function at the wrong contract address.
hm, I can call any function from the facets first deployment. However, when I try to call functions that were added to the facet with an upgrade they error out. Is there an example of upgrading an existing facet I can check out?
Are you calling functions on the diamond address or facet address? Functions are added to a diamond, not a facet. So you have to call functions on the diamond address.
I am calling functions on the diamond address.
Great. Make sure that you are calling functions with enough gas. Beyond that try some of the debugging techniques in this article: https://dev.to/mudgen/how-to-debug-code-2850
Also, one or more of the tutorials in Awesome Diamonds may help: https://github.com/mudgen/awesome-diamonds
I did see these tests: https://github.com/mudgen/diamond-1-hardhat/blob/main/test/diamondTest.js#L70
How would you continue to add functions to the Test1Facet after this?
Thanks for telling me this. I fixed it.