Open tifrel opened 2 years ago
We were able to reliably reproduce the same error in testnet, but sandbox were passed. The tests are: https://github.com/near-examples/nft-tutorial/tree/feat-testing/onchain_tests. We're working on a fix, and will see if that solves your problem.
For now you do a very quick workaround to sequentially run tests, which fixes the tests for me. Edit this file, node_modules/near-workspaces-ava/dist/index.js, change this line:
(0, ava_1.default)(description, async (t) => {
to:
(0, ava_1.serial)(description, async (t) => {
The problem is UnencryptedFileSystemKeyStore doesn't handle concurrent access of key files well. We're still investigating a fix, maybe in near-api-js.
I would add to this issue:
Can not sign transactions for account
Rejected Promise
errors on testnet@tifrel In our fails, this failure is due to the account creation failed (alice.factory.test.near
). The keypair is there but the account wasn't successfully created will also give this error message (our bad :(), and it's much more frequent than the key really doesn't exist.
Please try:
const balance = await alice.availableBalance();
console.log(balance);
If it errors, we can confirm alice doesn't exist. Call availableBalance
doesn't need key.
@ailisp Thanks a lot for your support. In my case, I have fixed the issue by not using the factory to deploy the contract, and instead testing the upgrade on a directly deployed store. I did however take the time to check this. alice
exists on my sandbox node. Furthermore I tried the same with store
, as that is the variable for account alice.factory.test.near
. I checked everything in a repo where I didn't download the closed-source parts, to eliminate the chances of those interfering.
I'd like to add to this that all my other tests pass, and all of them require account creation. The only part where I am facing troubles is the key copying.
I can currently not sign a transaction due to a missing key:
Taking a look into that directory, the key pair does actually exist, as I have copied it over from the
factory
account as part of the tests. The test output confirms that. You can [check it out](https://github.com/Mintbase/mintbase-core/blob/0b6c0e388b35da3f6517cd41d085b80f6db29694/testing/tests/nft.upgrade.ava.ts), but I can not open-source the whole repo. I have also replaced the theUnencryptedFileSystemKeyStore
for the offending account, but that doesn't work (see l. 197 in linked code). My best idea right now is that theInMemorySigner
keeps an outdated version ofUnencryptedFileSystemKeyStore
, but I cannot find where to replace that signer.