Skip to content

Commit

Permalink
Merge pull request #14 from quilt/bugfix/aa-nonce
Browse files Browse the repository at this point in the history
Fix nonce issue for aa contracts
  • Loading branch information
villanuevawill authored Jun 11, 2020
2 parents afc79d2 + e1666e2 commit 9f83812
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ func (l *txList) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Tran
// provided threshold. Every removed transaction is returned for any post-removal
// maintenance.
func (l *txList) Forward(threshold uint64) types.Transactions {
if l.isAA {
return types.Transactions{}
}

return l.txs.Forward(threshold)
}

Expand Down
3 changes: 3 additions & 0 deletions core/tx_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func TestAAQueue(t *testing.T) {

pool.currentState.SetCode(address1, common.FromHex(contractCode))
pool.currentState.AddBalance(address1, big.NewInt(1000000))
pool.currentState.SetNonce(address1, 1)

<-pool.requestReset(nil, nil)
pool.add(tx1, false)
Expand Down Expand Up @@ -401,6 +402,7 @@ func TestAAQueue2(t *testing.T) {

pool.currentState.SetCode(address1, common.FromHex(contractCode))
pool.currentState.AddBalance(address1, big.NewInt(1000000))
pool.currentState.SetNonce(address1, 1)

pool.reset(nil, nil)
pool.add(tx1, false)
Expand Down Expand Up @@ -433,6 +435,7 @@ func TestAAPending(t *testing.T) {

pool.currentState.SetCode(address1, common.FromHex(contractCode))
pool.currentState.AddBalance(address1, big.NewInt(1000000))
pool.currentState.SetNonce(address1, 1)

<-pool.requestReset(nil, nil)

Expand Down

0 comments on commit 9f83812

Please sign in to comment.