github.com/KiraCore/sekai@v0.3.43/x/layer2/keeper/keeper_test.go (about) 1 package keeper_test 2 3 import ( 4 "encoding/hex" 5 "testing" 6 7 simapp "github.com/KiraCore/sekai/app" 8 tmproto "github.com/cometbft/cometbft/proto/tendermint/types" 9 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" 10 cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" 11 sdk "github.com/cosmos/cosmos-sdk/types" 12 "github.com/stretchr/testify/suite" 13 ) 14 15 func newPubKey(pk string) (res cryptotypes.PubKey) { 16 pkBytes, err := hex.DecodeString(pk) 17 if err != nil { 18 panic(err) 19 } 20 21 pubkey := &ed25519.PubKey{Key: pkBytes} 22 23 return pubkey 24 } 25 26 type KeeperTestSuite struct { 27 suite.Suite 28 29 ctx sdk.Context 30 app *simapp.SekaiApp 31 } 32 33 func (suite *KeeperTestSuite) SetupTest() { 34 checkTx := false 35 app := simapp.Setup(checkTx) 36 37 suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) 38 suite.app = app 39 } 40 41 func TestKeeperTestSuite(t *testing.T) { 42 suite.Run(t, new(KeeperTestSuite)) 43 }