cosmos-sdk/cmd/gaia/app/genesis_test.go

37 lines
987 B
Go
Raw Normal View History

2018-04-25 21:49:53 -07:00
package app
import (
"testing"
2018-04-26 11:16:17 -07:00
sdk "github.com/cosmos/cosmos-sdk/types"
2018-04-25 21:49:53 -07:00
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
2018-04-25 21:49:53 -07:00
)
func TestToAccount(t *testing.T) {
priv := ed25519.GenPrivKey()
2018-07-06 00:06:53 -07:00
addr := sdk.AccAddress(priv.PubKey().Address())
2018-04-25 21:49:53 -07:00
authAcc := auth.NewBaseAccountWithAddress(addr)
2018-04-26 11:16:17 -07:00
genAcc := NewGenesisAccount(&authAcc)
require.Equal(t, authAcc, *genAcc.ToAccount())
2018-04-25 21:49:53 -07:00
}
func TestGaiaAppGenTx(t *testing.T) {
cdc := MakeCodec()
2018-04-26 11:16:17 -07:00
_ = cdc
2018-04-25 21:49:53 -07:00
//TODO test that key overwrite flags work / no overwrites if set off
//TODO test validator created has provided pubkey
//TODO test the account created has the correct pubkey
}
func TestGaiaAppGenState(t *testing.T) {
cdc := MakeCodec()
2018-04-26 11:16:17 -07:00
_ = cdc
2018-04-25 21:49:53 -07:00
// TODO test must provide at least genesis transaction
// TODO test with both one and two genesis transactions:
// TODO correct: genesis account created, canididates created, pool token variance
}