near / near-workspaces-js

Write tests once, run them both on NEAR TestNet and a controlled NEAR Sandbox local environment
https://near.github.io/near-workspaces-js/
GNU General Public License v3.0
42 stars 22 forks source link

Misleading "no matching key pair found" Error in beforeEach hook #173

Open idea404 opened 2 years ago

idea404 commented 2 years ago

Error thrown when a contract account is initialized with too little initialBalance. Example code that triggered this error (in beforeEach):

...
 const nft_contract = await root.createAndDeploy(
 root.getSubAccount("nft-contract").accountId,
 "../../out/main.wasm",

 { initialBalance: NEAR.parse('3 N').toJSON() } 

,
 );
 ...

Throws following error which is currently misleading as it reads:

Increasing the balance in the contract code to 100 as below addressed this error:

...
 const nft_contract = await root.createAndDeploy(
 root.getSubAccount("nft-contract").accountId,
 "../../out/main.wasm",

 { initialBalance: NEAR.parse('100 N').toJSON() } 

,
 );
 ...