trufflesuite / drizzle

Reactive Ethereum dapp UI suite
907 stars 238 forks source link

Missing parts of state object (transactions, transactionStack) #113

Open ilmoi opened 3 years ago

ilmoi commented 3 years ago

I'm using Drizzle inside of Vue (no vue-plugin, just pure Drizzle).

Following the docs on contract interaction I'm doing the following:

const stackId = await state
        .drizzle
        .drizzleInstance
        .contracts['ItemManager']
        .methods['createItem']
        .cacheSend(this.itemId, this.itemCost)

which successfully returns stackId. However when I try to retrieve the transaction from transaction stack:

if (state.transactionStack[stackId]) {
          const txHash = state.transactionStack[stackId]
          return state.transactions[txHash].status
}

I get this error:

"TypeError: Cannot read property '0' of undefined"

Which I figured out is because transcationStack is missing from the state object. In fact the only things I have in state object are:

accounts: {...},
contracts: {...},
drizzle: {...},

and nothing else.

My end goal is to get the hash of the transction, like I can do with web3 code:

const ret_val = await state
        .drizzle
        .drizzleInstance
        .contracts['ItemManager']
        .methods['createItem'](this.itemId, this.itemCost)
        .send()

but obviously without transactionStack being there I can't do so.

What am I missing? Am I doing something wrong or is there a bug somewhere? How can I get the state of the transaction?