github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/x/auth/exported/exported_test.go (about)

     1  package exported_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/fibonacci-chain/fbc/libs/tendermint/crypto/secp256k1"
     7  	"github.com/stretchr/testify/require"
     8  
     9  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
    10  	"github.com/fibonacci-chain/fbc/libs/cosmos-sdk/x/auth/exported"
    11  	authtypes "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/x/auth/types"
    12  )
    13  
    14  func TestGenesisAccountsContains(t *testing.T) {
    15  	pubkey := secp256k1.GenPrivKey().PubKey()
    16  	addr := sdk.AccAddress(pubkey.Address())
    17  	acc := authtypes.NewBaseAccount(addr, nil, secp256k1.GenPrivKey().PubKey(), 0, 0)
    18  
    19  	genAccounts := exported.GenesisAccounts{}
    20  	require.False(t, genAccounts.Contains(acc.GetAddress()))
    21  
    22  	genAccounts = append(genAccounts, acc)
    23  	require.True(t, genAccounts.Contains(acc.GetAddress()))
    24  }