0g-chain/app/app_test.go

63 lines
1.6 KiB
Go
Raw Normal View History

2019-06-20 13:37:57 +00:00
package app
import (
"os"
"testing"
2020-04-30 14:23:41 +00:00
"github.com/tendermint/tendermint/libs/log"
2020-04-30 14:27:28 +00:00
db "github.com/tendermint/tm-db"
2019-06-20 13:37:57 +00:00
)
func TestNewApp(t *testing.T) {
2019-09-11 22:33:20 +00:00
NewApp(
log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
db.NewMemDB(),
DefaultNodeHome,
nil,
MakeEncodingConfig(),
Options{},
2019-07-18 17:36:31 +00:00
)
2019-06-20 13:37:57 +00:00
}
// func TestExport(t *testing.T) {
// db := db.NewMemDB()
// app := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, AppOptions{})
// setGenesis(app)
// // Making a new app object with the db, so that initchain hasn't been called
// newApp := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, AppOptions{})
// _, _, err := newApp.ExportAppStateAndValidators(false, []string{})
// require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
// }
// // ensure that black listed addresses are properly set in bank keeper
// func TestBlackListedAddrs(t *testing.T) {
// db := db.NewMemDB()
// app := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, AppOptions{})
// for acc := range mAccPerms {
// require.Equal(t, !allowedReceivingModAcc[acc], app.bankKeeper.BlacklistedAddr(app.supplyKeeper.GetModuleAddress(acc)))
// }
// }
// func setGenesis(app *App) error {
// genesisState := NewDefaultGenesisState()
// stateBytes, err := codec.MarshalJSONIndent(app.cdc, genesisState)
// if err != nil {
// return err
// }
// // Initialize the chain
// app.InitChain(
// abci.RequestInitChain{
// Validators: []abci.ValidatorUpdate{},
// AppStateBytes: stateBytes,
// },
// )
// app.Commit()
// return nil
// }