Skip to content

Commit

Permalink
Merge pull request #3268 from 0chain/fix/txn-errors
Browse files Browse the repository at this point in the history
Fix transaction errors
  • Loading branch information
dabasov committed May 1, 2024
2 parents 0481652 + 145cd55 commit 2380ae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/go/0chain.net/smartcontract/dbs/event/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ func (edb *EventDb) GetTransactionsForBlocks(blockStart, blockEnd int64) ([]Tran
}

func (edb *EventDb) UpdateTransactionErrors(current int64) error {
from := (current - 1) * edb.settings.PermanentPartitionChangePeriod
to := (current) * edb.settings.PermanentPartitionChangePeriod
from := (current) * edb.settings.PermanentPartitionChangePeriod
to := (current + 1) * edb.settings.PermanentPartitionChangePeriod

lastPartition := edb.partTableName("transactions", from, to)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func TestTransactionErrors(t *testing.T) {
"output4",
})

err := edb.UpdateTransactionErrors(1)
err := edb.UpdateTransactionErrors(0)
require.NoError(t, err)

txnErrors, err := edb.GetTransactionErrors()
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestTransactionErrors(t *testing.T) {
"output4",
})

err = edb.UpdateTransactionErrors(1)
err = edb.UpdateTransactionErrors(0)
require.NoError(t, err)

txnErrors, err = edb.GetTransactionErrors()
Expand Down

0 comments on commit 2380ae3

Please sign in to comment.