github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/store/transient/store_test.go (about)

     1  package transient
     2  
     3  import (
     4  	"github.com/fibonacci-chain/fbc/libs/iavl"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  var k, v = []byte("hello"), []byte("world")
    11  
    12  func TestTransientStore(t *testing.T) {
    13  	tstore := NewStore()
    14  
    15  	require.Nil(t, tstore.Get(k))
    16  
    17  	tstore.Set(k, v)
    18  
    19  	require.Equal(t, v, tstore.Get(k))
    20  
    21  	tstore.Commit(&iavl.TreeDelta{}, nil)
    22  
    23  	require.Nil(t, tstore.Get(k))
    24  }