Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Jan 9, 2025
1 parent dbb495f commit 5badae0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions mempool/init_test.go

This file was deleted.

2 changes: 0 additions & 2 deletions mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,10 @@ func (p *Pool) handleTransaction(userTxn *BroadcastedTransaction) error {
if tailValue != nil {
// Update old tail to point to the new item
var oldTailElem storageElem
fmt.Println(" - error here")
oldTailElem, err := p.dbElem(dbTxn, tailValue)
if err != nil {
return err
}
fmt.Println(" - error here solved")
oldTailElem.NextHash = userTxn.Transaction.Hash()
if err = p.putdbElem(dbTxn, tailValue, &oldTailElem); err != nil {
return err
Expand Down
7 changes: 5 additions & 2 deletions mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/NethermindEth/juno/core/felt"
"github.com/NethermindEth/juno/db"
"github.com/NethermindEth/juno/db/pebble"
_ "github.com/NethermindEth/juno/encoder/registry"
"github.com/NethermindEth/juno/mempool"
"github.com/NethermindEth/juno/mocks"
"github.com/NethermindEth/juno/utils"
Expand Down Expand Up @@ -150,7 +151,7 @@ func TestRestoreMempool(t *testing.T) {
}

// check the db has stored the transactions
time.Sleep(4000 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
lenDB, err = pool.LenDB()
require.NoError(t, err)
require.Equal(t, uint16(3), lenDB)
Expand Down Expand Up @@ -181,7 +182,9 @@ func TestRestoreMempool(t *testing.T) {

func TestWait(t *testing.T) {
log := utils.NewNopZapLogger()
testDB := pebble.NewMemTest(t)
testDB, dbCloser, err := setupDatabase("testwait", true)
require.NoError(t, err)
defer dbCloser()
mockCtrl := gomock.NewController(t)
t.Cleanup(mockCtrl.Finish)
state := mocks.NewMockStateHistoryReader(mockCtrl)
Expand Down

0 comments on commit 5badae0

Please sign in to comment.