diff --git a/api/account.go b/api/account.go index 5bcaed1..154e989 100644 --- a/api/account.go +++ b/api/account.go @@ -29,6 +29,7 @@ func (a *API) getAccount(c *gin.Context) { } apiAccount.Balance = apitypes.NewBigIntStr(account.Balance) + apiAccount.Nonce = account.Nonce c.JSON(http.StatusOK, apiAccount) } @@ -67,6 +68,7 @@ func (a *API) getAccounts(c *gin.Context) { return } apiAccounts[x].Balance = apitypes.NewBigIntStr(account.Balance) + apiAccounts[x].Nonce = account.Nonce } // Build succesfull response diff --git a/api/api_test.go b/api/api_test.go index f8ae002..7024ee5 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -330,7 +330,10 @@ func TestMain(m *testing.M) { commonL1Txs = append(commonL1Txs, block.Rollup.L1UserTxs...) for _, batch := range block.Rollup.Batches { commonL2Txs = append(commonL2Txs, batch.L2Txs...) - commonAccounts = append(commonAccounts, batch.CreatedAccounts...) + for i := range batch.CreatedAccounts { + batch.CreatedAccounts[i].Nonce = common.Nonce(i) + commonAccounts = append(commonAccounts, batch.CreatedAccounts[i]) + } commonBatches = append(commonBatches, batch.Batch) commonExitTree = append(commonExitTree, batch.ExitTree...) commonL1Txs = append(commonL1Txs, batch.L1CoordinatorTxs...)