Skip to content

Commit

Permalink
simple store setter test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shevchuk committed Oct 4, 2023
1 parent 03f9596 commit bbe9e86
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gossip/evmstore/store_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package evmstore

import (
"testing"

"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/assert"

"github.com/Fantom-foundation/lachesis-base/kvdb/memorydb"
)

Expand All @@ -15,3 +20,14 @@ func nonCachedStore() *Store {

return NewStore(memorydb.NewProducer(""), cfg)
}

func TestStoreSetTx(t *testing.T) {
store := cachedStore()

tx := types.NewTx(&types.LegacyTx{Data: []byte("test")})

store.SetTx(tx.Hash(), tx)

txFromStore := store.GetTx(tx.Hash())
assert.Equal(t, tx.Data(), txFromStore.Data())
}

0 comments on commit bbe9e86

Please sign in to comment.