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
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-cadenceHow are you running the tests? (e.g. with what version)
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@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?
I'm gonna verify that they actually are the same versions of
FungibleToken
firstmy initial guess is that it's maybe caused by some bootstrapping, potentially internally, where e.g. some accounts are created / funded
That would be my guess as well since state is maintained throughout the test file
yeah. They were the same. I'll create a bug report
https://github.com/onflow/cadence-tools/issues/337
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
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•8mo ago
Message Not Public
Sign In & Join Server To View
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•8mo ago
Message Not Public
Sign In & Join Server To View