You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to construct a CompositeType from an identifier including the address of a test account results in an error. This can be seen in test runs in ci runs for flow-ft and flow-nft Cadence 1.0 updates where test cases cover events emitted by attempting to construct a CompositeType of the event.
The resulting error outputs as:
- FAIL: testContractInitializedEventEmitted
Execution failed:
error: internal error: could not find account with address 0000000000000005
I would expect the CompositeType to construct given a properly formatted identifier containing a valid contract address, name, and event type.
Steps To Reproduce
Either of the PRs in flow-ft & flow-nft have failing test cases that showcase this error, but the following simple case might help for easy illustration:
I think what's happening here is the created account foo is on the blockchain, whereas the composite type creation CompositeType("A.0000000000000005.Foo.ContractInitialized") happens off-chain (in the test script). So the account is not accessible/available off-chain. This is not really a bug rather the expected behavior.
I believe the new changes done to unify the environment (and removing the blockchain concept) and the improvement done in this PR should allow this use-case now. Given the changes are already on master, they would be available with the next CLI preview build.
cc: @m-Peter
Current Behavior
Attempting to construct a
CompositeType
from an identifier including the address of a test account results in an error. This can be seen in test runs in ci runs for flow-ft and flow-nft Cadence 1.0 updates where test cases cover events emitted by attempting to construct a CompositeType of the event.The resulting error outputs as:
Where the failing test case looks like:
Expected Behavior
I would expect the CompositeType to construct given a properly formatted identifier containing a valid contract address, name, and event type.
Steps To Reproduce
Either of the PRs in flow-ft & flow-nft have failing test cases that showcase this error, but the following simple case might help for easy illustration:
Say you have a project with the contract below:
The following scripts:
And the following test:
Running the following command:
flow test --cover tests/test_foo.cdc
Shortened results shown below:
Test results: "tests/test_foo.cdc" - FAIL: testContractInitialized Execution failed: error: internal error: could not find account with address 0000000000000005 - FAIL: testContractInitializedAlt Execution failed: error: internal error: could not find account with address 0000000000000005 - PASS: testGetAccountAddress - PASS: testHasFooDeployed
Environment
The text was updated successfully, but these errors were encountered: