netgum / archanova

Archanova monorepo
https://archanova.io/
19 stars 11 forks source link

Account nonce not updating as I would expect #79

Closed morelazers closed 4 years ago

morelazers commented 4 years ago

This code:

  const withdrawEstimate = await sdk.estimateWithdrawFromAccountVirtualBalance(
    sdk.state.account.balance.virtual
  )
  const withdrawTx = await sdk.submitAccountTransaction(withdrawEstimate)
  const sendEstimate = await sdk.estimateAccountTransaction(
    to,
    sdk.state.account.balance.virtual,
    null
  )
  const sendTx = await sdk.submitAccountTransaction(sendEstimate)

Makes a couple of transactions sequentially, however the second transaction always reverts because the nonce sent along with it is the same as the first.

Example withdrawTx: https://rinkeby.etherscan.io/tx/0x6fefae6341db5580ab97c66bbab0ab5717dec6b6c6df667b907d31d91a4b677c

Example sendTx: https://rinkeby.etherscan.io/tx/0xf2298d3ab90f2b659c9a1837a870da70b0af2e5bd7e30a597aafe51fdacf9b6a

stanislaw-glogowski commented 4 years ago

@morelazers It will be easier if you create payment to to and process it with https://playground.archanova.run/#withdraw_account_payment

It will reduce transactions to single one.

morelazers commented 4 years ago

@stanislaw-glogowski I'm trying to send to a non-abridged address

stanislaw-glogowski commented 4 years ago

@morelazers It doesn't matter. You can call withdraw account payment from sender account.

morelazers commented 4 years ago

Oh cool okay, so create a payment then call withdraw and the payment manager contract handles the rest?

stanislaw-glogowski commented 4 years ago

Exactly