trufflesuite / drizzle

Reactive Ethereum dapp UI suite
905 stars 235 forks source link

@drizzle/store new version of redux-saga #29

Open MrRefactoring opened 4 years ago

MrRefactoring commented 4 years ago

You can see new features and fixes in changelog

adrianmcli commented 4 years ago

This just needs testing, it's on my list of things to do. Thanks @MrRefactoring.

0xTimepunk commented 4 years ago

Can this be merged? What is holding this update?

adrianmcli commented 4 years ago

Ahh this fell by the wayside, apologies to @MrRefactoring. I just ran tests on it and it seems like the tests are failing with a few tests complaining that .toPromise() is not a function:

TypeError: (0 , _reduxSaga.runSaga)(...).toPromise is not a function

@MrRefactoring do you think you can fix these?

Log:

@drizzle/store: FAIL test/web3.test.js
@drizzle/store:   ● Resolving Web3 › with ethereum, EIP-1102 compliance › loads when user opts in
@drizzle/store:     TypeError: (0 , _reduxSaga.runSaga)(...).toPromise is not a function
@drizzle/store:       64 |         dispatch: (action) => dispatched.push(action),
@drizzle/store:       65 |         getState: () => ({ state: 'test' })
@drizzle/store:     > 66 |       }, initializeWeb3, {}).toPromise()
@drizzle/store:          |                              ^
@drizzle/store:       67 |
@drizzle/store:       68 |       // result should be a proper web3 provider
@drizzle/store:       69 |       expect(result).toBeInstanceOf(require('web3'))
@drizzle/store:       at toPromise (test/web3.test.js:66:30)
@drizzle/store:       at tryCatch (../../node_modules/regenerator-runtime/runtime.js:45:40)
@drizzle/store:       at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:271:22)
@drizzle/store:       at Generator.prototype.(anonymous function) [as next] (../../node_modules/regenerator-runtime/runtime.js:97:21)
@drizzle/store:       at asyncGeneratorStep (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
@drizzle/store:       at _next (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
@drizzle/store:       at ../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
@drizzle/store:       at Object.<anonymous> (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
@drizzle/store:   ● Resolving Web3 › with ethereum, EIP-1102 compliance › does not load when user opts out
@drizzle/store:     TypeError: (0 , _reduxSaga.runSaga)(...).toPromise is not a function
@drizzle/store:       82 |         initializeWeb3,
@drizzle/store:       83 |         {}
@drizzle/store:     > 84 |       ).toPromise()
@drizzle/store:          |         ^
@drizzle/store:       85 |
@drizzle/store:       86 |       // saga result should be undefined if an exception occurs
@drizzle/store:       87 |       expect(web3Result).toBe(undefined)
@drizzle/store:       at toPromise (test/web3.test.js:84:9)
@drizzle/store:       at tryCatch (../../node_modules/regenerator-runtime/runtime.js:45:40)
@drizzle/store:       at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:271:22)
@drizzle/store:       at Generator.prototype.(anonymous function) [as next] (../../node_modules/regenerator-runtime/runtime.js:97:21)
@drizzle/store:       at asyncGeneratorStep (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
@drizzle/store:       at _next (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
@drizzle/store:       at ../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
@drizzle/store:       at Object.<anonymous> (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
@drizzle/store:   ● Resolving Web3 › with ethereum, EIP-1102 compliance › does not load when provider throws an error
@drizzle/store:     TypeError: (0 , _reduxSaga.runSaga)(...).toPromise is not a function
@drizzle/store:       101 |         dispatch: (action) => dispatched.push(action),
@drizzle/store:       102 |         getState: () => ({ state: 'test' })
@drizzle/store:     > 103 |       }, initializeWeb3, {}).toPromise()
@drizzle/store:           |                              ^
@drizzle/store:       104 |
@drizzle/store:       105 |       // saga result is undefined when exception is thrown
@drizzle/store:       106 |       expect(result).toBe(undefined)
@drizzle/store:       at toPromise (test/web3.test.js:103:30)
@drizzle/store:       at tryCatch (../../node_modules/regenerator-runtime/runtime.js:45:40)
@drizzle/store:       at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:271:22)
@drizzle/store:       at Generator.prototype.(anonymous function) [as next] (../../node_modules/regenerator-runtime/runtime.js:97:21)
@drizzle/store:       at asyncGeneratorStep (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
@drizzle/store:       at _next (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
@drizzle/store:       at ../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
@drizzle/store:       at Object.<anonymous> (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
MrRefactoring commented 4 years ago

@adrianmcli sorry cannot reproduce.

My log today:

 FAIL  test/drizzle/middleware.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/drizzle/api.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/web3.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/contractStateUtils.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/accountBalances.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/drizzle/getOrCreateWeb3.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/accounts.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/drizzle/options.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/generateStore.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

 FAIL  test/blocks.test.js
  ● Test suite failed to run

    Cannot find module 'scrypt'

      at Object.<anonymous> (../../node_modules/ganache-core/node_modules/scrypt.js/node.js:1:14)

Test Suites: 10 failed, 10 total
Tests:       0 total
Snapshots:   0 total
Time:        4.093s
MrRefactoring commented 4 years ago

@adrianmcli I update yarn.lock and all tests passing. Can you check the tests again?

0xTimepunk commented 4 years ago

Checking in here again @adrianmcli @MrRefactoring :)

Much appreciated to have this merged soon.

ghost commented 3 years ago

Hello, what is the status on this? Without redux-saga 1.01 I can't integrate drizzle into my store, and I can't integrate my store into drizzle's store, due to redux-saga version mismatch errors.