From eeb62be039927d461bcd5bebc456e3ab1a31307c Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 20 Aug 2020 00:27:32 -0400 Subject: move nonce to EVMOutput/Input --- plugin/evm/export_tx.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugin/evm/export_tx.go') diff --git a/plugin/evm/export_tx.go b/plugin/evm/export_tx.go index 9af11e0..423c754 100644 --- a/plugin/evm/export_tx.go +++ b/plugin/evm/export_tx.go @@ -33,8 +33,6 @@ type UnsignedExportTx struct { Ins []EVMInput `serialize:"true" json:"inputs"` // Outputs that are exported to the chain ExportedOutputs []*avax.TransferableOutput `serialize:"true" json:"exportedOutputs"` - // EVM nonce - nonce uint64 } // InputUTXOs returns an empty set @@ -157,10 +155,10 @@ func (tx *UnsignedExportTx) EVMStateTransfer(state *state.StateDB) error { return errInsufficientFunds } state.SubBalance(from.Address, amount) - if state.GetNonce(from.Address) != tx.nonce { + if state.GetNonce(from.Address) != from.Nonce { return errInvalidNonce } - state.SetNonce(from.Address, tx.nonce+1) + state.SetNonce(from.Address, from.Nonce+1) } return nil } -- cgit v1.2.3