findonflow / find

.find people and NFTs #OnFlow
MIT License
35 stars 6 forks source link

Overflow with flowkit 1 #373

Closed benbackend closed 1 year ago

benbackend commented 1 year ago

one of the tests is failing : TestFindForge/Should_not_be_able_to_mint_Example_NFTs_with_non-exist_traits

In this test, it is supposed to mint an NFT and fail at NFT init function. Seems that the error message didn't go that far to print out the error at NFT init function. But, instead, returned at the line that "create NFT"

💩 Error executing transaction: devMintExampleNFT error:execution error code 1101: [Error Code: 1101] error caused by: 1 error occurred:
    * transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed:
  --> 57b4f4fa48719c766e305a6df247c445a18568d5fdf73bb3e37f7fe467b209ff:56:2
   |
56 |        FindForge.mint(lease: lease, forgeType: forgeType, data: mintData, receiver: nftReceiver)
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   --> 179b6b1cb6755e31.FindForge:265:2
    |
265 |       FindForge.adminMint(lease: leaseName, forgeType: forgeType , data: data, receiver: receiver)
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   --> 179b6b1cb6755e31.FindForge:289:13
    |
289 |       let nft <- forge.mint(platform: minterPlatform, data: data, verifier: verifier)
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   --> 179b6b1cb6755e31.ExampleNFT:311:13
    |
311 |           return <- ExampleNFT.mintNFT(name: info.name,
312 |                                         description: info.description,
313 |                                         thumbnail: info.thumbnail,
314 |                                         soulBound: info.soulBound,
315 |                                         traits: info.traits,
316 |                                         royalties: MetadataViews.Royalties(royalties))
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   --> 179b6b1cb6755e31.ExampleNFT:287:29
    |
287 |         var newNFT <- create NFT(
288 |             id: ExampleNFT.totalSupply,
289 |             name: name,
290 |             description: description,
291 |             thumbnail: thumbnail,
292 |             soulBound: soulBound,
293 |             traits: traits,
294 |             royalties: royalties
295 |         )
    |

We suppose to see the panic message in init block

        init(
            id: UInt64,
            name: String,
            description: String,
            thumbnail: String,
            soulBound: Bool,
            traits : [UInt64],
            royalties: MetadataViews.Royalties
        ) {
            self.id = id
            self.name = name
            self.description = description
            self.thumbnail = thumbnail
            self.soulBound = soulBound
            self.royalties = royalties

            for traitId in traits {
                if !ExampleNFT.traits.containsKey(traitId) {
                    panic("This trait does not exist ID :".concat(traitId.toString()))
                }
            }
            self.traits=traits
            self.changedRoyalties = false
        }
benbackend commented 1 year ago

@bjartek FYI

bjartek commented 1 year ago

I traced this all the way back to EmulatorGateway GetTransactionResult and there the message is truncated from the Emulator. So maybe this is an emulator bug and not a cli bug?