MCPcopy Create free account
hub / github.com/Sifchain/sifnode / TestSimAppExportAndBlockedAddrs

Function TestSimAppExportAndBlockedAddrs

app/app_test.go:221–251  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func TestSimAppExportAndBlockedAddrs(t *testing.T) {
222 encCfg := MakeTestEncodingConfig()
223 db := dbm.NewMemDB()
224 app := NewSifApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
225 SetConfig(false)
226 for acc := range maccPerms {
227 require.True(
228 t,
229 app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc)),
230 "ensure that blocked addresses are properly set in bank keeper",
231 )
232 }
233
234 genesisState := NewDefaultGenesisState(encCfg.Marshaler)
235 stateBytes, err := json.MarshalIndent(genesisState, "", " ")
236 require.NoError(t, err)
237
238 // Initialize the chain
239 app.InitChain(
240 abci.RequestInitChain{
241 Validators: []abci.ValidatorUpdate{},
242 AppStateBytes: stateBytes,
243 },
244 )
245 app.Commit()
246
247 // Making a new app object with the db, so that initchain hasn't been called
248 app2 := NewSifApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
249 _, err = app2.ExportAppStateAndValidators(false, []string{})
250 require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
251}
252
253func TestAddressFormatValidation(t *testing.T) {
254 addr0 := make([]byte, 0)

Callers

nothing calls this directly

Calls 6

NewSifAppFunction · 0.85
NewDefaultGenesisStateFunction · 0.85
MakeTestEncodingConfigFunction · 0.70
SetConfigFunction · 0.70
InitChainMethod · 0.65

Tested by

no test coverage detected