I am using an ensure constraint to check whether the original owner of the Wallet is the only one who can create an UpgradeWallet template for their wallet. This is what I have:
owner : Party
public : [Party]
oldWalletId : ContractId Wallet
(let walletTest = (
oldWallet <- fetch @Wallet oldWalletId
if oldWallet.owner == owner then pure True else pure False)
However, I am getting the parse error on input error in the closing bracket. I understand that this is because the let command doesn’t returns anything and just assigns the value to the walletTest variable. Can I somehow make the ensure constraint check the value of walletTest variable for it’s boolean check?