mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 10:21:40 +00:00
Regular → Executable
+29
-2
@@ -5,12 +5,14 @@ import (
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
)
|
||||
|
||||
func TestAppExport(t *testing.T) {
|
||||
@@ -34,6 +36,7 @@ func TestAppExport(t *testing.T) {
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
newGapp := NewChainApp(
|
||||
logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
|
||||
EVMAppOptions,
|
||||
)
|
||||
_, err = newGapp.ExportAppStateAndValidators(false, []string{}, nil)
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
@@ -51,12 +54,36 @@ func TestBlockedAddrs(t *testing.T) {
|
||||
} else {
|
||||
addr = gapp.AccountKeeper.GetModuleAddress(acc)
|
||||
}
|
||||
require.True(t, gapp.BankKeeper.BlockedAddr(addr), "ensure that blocked addresses are properly set in bank keeper")
|
||||
require.True(
|
||||
t,
|
||||
gapp.BankKeeper.BlockedAddr(addr),
|
||||
"ensure that blocked addresses are properly set in bank keeper",
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetMaccPerms(t *testing.T) {
|
||||
dup := GetMaccPerms()
|
||||
require.Equal(t, maccPerms, dup, "duplicated module account permissions differed from actual module account permissions")
|
||||
require.Equal(
|
||||
t,
|
||||
maccPerms,
|
||||
dup,
|
||||
"duplicated module account permissions differed from actual module account permissions",
|
||||
)
|
||||
}
|
||||
|
||||
// TestMergedRegistry tests that fetching the gogo/protov2 merged registry
|
||||
// doesn't fail after loading all file descriptors.
|
||||
func TestMergedRegistry(t *testing.T) {
|
||||
r, err := proto.MergedRegistry()
|
||||
require.NoError(t, err)
|
||||
require.Greater(t, r.NumFiles(), 0)
|
||||
}
|
||||
|
||||
func TestProtoAnnotations(t *testing.T) {
|
||||
r, err := proto.MergedRegistry()
|
||||
require.NoError(t, err)
|
||||
err = msgservice.ValidateProtoAnnotations(r)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user