neo-one icon indicating copy to clipboard operation
neo-one copied to clipboard

Generated createClient does not wait for account setup

Open afragapane opened this issue 4 years ago • 0 comments

Description

generated createClient does not wait for accounts to be created.

Steps to Reproduce

  1. in a neo-one project, run yarn neo-one build
  2. const client = createClient() const helloWorld = createHelloWorldSmartContract() client.getUserAccounts() await helloWorld.hello.confirmed('foo')

Expected behavior: [What you expect to happen] client.getUserAccounts result is list of pre-loaded accounts helloWorld.hello.confirmed('foo') performs invocation

Actual behavior: [What actually happens] client.getUserAccounts is an empty list helloWorld.hello.confirmed('foo') throws [NO_ACCOUNT] error

Reproduces how often: [What percentage of the time does it reproduce?] 100%, but the issue goes away if you just make the program wait a small amount of time before using the client.

Versions

@neo-one/suite 2.3.1

afragapane avatar Mar 25 '20 19:03 afragapane