drizzle icon indicating copy to clipboard operation
drizzle copied to clipboard

Possible name collisions in contract state

Open balasan opened this issue 6 years ago • 5 comments

If a contract contains any of the following public variables it would create a naming collision in the drizzle store: initialized, 'synced', 'events'

I propose keeping the contract state in inside a separate state object:

  • would be nice to add the contract methods in there as well so we don't have to access the drizzle instance to call functions (this is a very confusing and cumbersome experience right now)
contracts: {
    contractName: {
      initialized,
      synced,
      events,
      state: {
        callerFunctionName: {
          argsHash: {
            args,
            value
          }
        }
      },
      methods: {}
    }
  },

balasan avatar Mar 27 '18 16:03 balasan

Another approach would to be to let allow generateStore to be invoked with other arguments such as some app reducers, initialState and middlewares.

julien51 avatar Apr 06 '18 14:04 julien51

I did this in my own branch:

julien51 avatar Apr 06 '18 14:04 julien51

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 26 '19 07:03 stale[bot]

This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if there is no reply to further comments.

stale[bot] avatar Apr 02 '19 07:04 stale[bot]

For 2.0 consideration

cds-amal avatar Sep 26 '19 20:09 cds-amal