F
Flow8mo ago
joshua

joshua | Flow (2024-04-09)

C1.0: Anyone know why the Cadence testing framework would be telling me that there are 43 FungibleToken.Deposited events in a single mint transaction? This is from this part of the test: https://github.com/joshuahannan/flow-usdc/blob/feature/cadence-1/tests/fiattoken_test.cdc#L80-L82 Testing https://github.com/joshuahannan/flow-usdc/blob/feature/cadence-1/transactions/mint/mint.cdc with https://github.com/joshuahannan/flow-usdc/blob/feature/cadence-1/contracts/FiatToken.cdc FungibleToken.Deposited is the standard event that is emitted from a pre-condition every time a FungibleToken.Receiver.deposit() happens. This transaction is only doing one deposit, so the max it should emit is 2, 1 for the deposit in the transaction, and maybe one for tx fees.
13 Replies
Needle
Needle8mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
turbolent
turbolent8mo ago
How are you running the tests? (e.g. with what version)
joshua
joshuaOP8mo ago
v1.17.0-cadence-v1.0.0-preview.18 flow-c1 test --cover --covercode="contracts" tests/*.cdc I'm getting it in the flow-ft repo too actually. In both instances, I am using the version of FungibleToken that comes pre-deployed to the emulator if I switch to deploying a new version and using that, it only shows one event but both versions should be the same, so I don't know what would be different
turbolent
turbolent8mo ago
@joshua | Flow thanks for all the info! could you please open a bug report in https://github.com/onflow/cadence-tools with these details? @mpeter do you maybe have any clue how that could happen?
joshua
joshuaOP8mo ago
I'm gonna verify that they actually are the same versions of FungibleToken first
turbolent
turbolent8mo ago
my initial guess is that it's maybe caused by some bootstrapping, potentially internally, where e.g. some accounts are created / funded
Giovanni S
Giovanni S8mo ago
That would be my guess as well since state is maintained throughout the test file
joshua
joshuaOP8mo ago
yeah. They were the same. I'll create a bug report https://github.com/onflow/cadence-tools/issues/337
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
joshua
joshuaOP8mo ago
okay, I see. Yeah I guess it wasn't clear to me that that was what it was doing. I'll update the test to do it properly. Should I close the issue that I opened?
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
turbolent
turbolent8mo ago
Would a function to reset events help? or maybe it’s possible to specify a “since” point in time (eg since last transaction, since last block, etc)?
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server