onflow / docs

Flow Developer Portal. Discover the developer ecosystem and master the Flow blockchain
https://developers.flow.com
Apache License 2.0
8 stars 55 forks source link

Conditions No Longer Allow State Changes #553

Open nialexsan opened 9 months ago

nialexsan commented 9 months ago

check all prepare and post conditions to not to mutate state, like here(?)

    post {
        self.recipientCollectionRef.getIDs().contains(self.mintingIDBefore): "The next NFT ID should have been minted and delivered"
        ExampleNFT.totalSupply == self.mintingIDBefore + 1: "The total supply should have been increased by 1"
    }
joshuahannan commented 2 months ago

@nialexsan Can you elaborate on what you mean to fix here? I don't think Cadence allows state changes in pre and post conditions anyway. Do you mean to remove all instances of this in the docs site?