Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Unrecoverable error if user has "bad accounts" in their keystore (.near-credentials/betanet) #5

Open
mattlockyer opened this issue Jan 8, 2021 · 0 comments

Comments

@mattlockyer
Copy link

I had a bunch of badly named accounts from testing various things.

They were in my /betanet keystore.

https://github.com/near/near-web3-provider/blob/e88c4f82d2fc04ed33e74c75e2b8c6816e803be1/src/index.js#L385

Seems to load all keys and start calling:

https://github.com/near/near-web3-provider/blob/e88c4f82d2fc04ed33e74c75e2b8c6816e803be1/src/index.js#L390

Which just fails when it encounters a badly named account with this error:

AssertionError [ERR_ASSERTION]: nearAccountToEvmAddress must pass in valid accountID
    at utils.nearAccountToEvmAddress (/home/matt/Projects/near/near-pet-shop/node_modules/near-web3-provider/src/utils.js:294:5)
    at Array.map (<anonymous>)
    at NearProvider.routeEthAccounts (/home/matt/Projects/near/near-pet-shop/node_modules/near-web3-provider/src/index.js:390:38)
Truffle v5.1.57 (core: 5.1.57)
Node v14.15.3

Potential solutions:

  • add a helpful (colorful) tip to tell someone to clean up their near-credentials?

  • console.warn but don't error?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant