Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

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

Open
ilmoi opened this issue Apr 17, 2021 · 0 comments
Open

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

ilmoi opened this issue Apr 17, 2021 · 0 comments

Comments

@ilmoi
Copy link

ilmoi commented Apr 17, 2021

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?

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

2 participants
@ilmoi and others