-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp_new_test.go
More file actions
53 lines (45 loc) · 1.71 KB
/
app_new_test.go
File metadata and controls
53 lines (45 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package app
import (
"path/filepath"
"testing"
"cosmossdk.io/log"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func TestNewApp_NoPanic(t *testing.T) {
defer func() {
if r := recover(); r != nil {
t.Fatalf("app.New panicked: %v", r)
}
}()
opts := sims.AppOptionsMap{"aethelred.pqc.mode": "simulated"}
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(AccountAddressPrefix, AccountAddressPrefix+"pub")
cfg.SetBech32PrefixForValidator(AccountAddressPrefix+"valoper", AccountAddressPrefix+"valoperpub")
cfg.SetBech32PrefixForConsensusNode(AccountAddressPrefix+"valcons", AccountAddressPrefix+"valconspub")
_ = New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, opts)
}
func TestNewApp_InitializesAuditAPI(t *testing.T) {
homeDir := t.TempDir()
opts := sims.AppOptionsMap{
"aethelred.pqc.mode": "simulated",
flags.FlagHome: homeDir,
}
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(AccountAddressPrefix, AccountAddressPrefix+"pub")
cfg.SetBech32PrefixForValidator(AccountAddressPrefix+"valoper", AccountAddressPrefix+"valoperpub")
cfg.SetBech32PrefixForConsensusNode(AccountAddressPrefix+"valcons", AccountAddressPrefix+"valconspub")
app := New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, opts)
if app.auditStudio == nil {
t.Fatal("expected audit studio to be initialized")
}
if app.auditServer == nil {
t.Fatal("expected audit server to be initialized")
}
wantDir := filepath.Join(homeDir, "data", "audit", "control-ledgers")
if app.auditControlLedgerDir != wantDir {
t.Fatalf("expected audit control ledger dir %q, got %q", wantDir, app.auditControlLedgerDir)
}
}