-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from dongsam/84-fix-module-app-settings
fix: solve module, sdk issues
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package app | ||
|
||
import ( | ||
"encoding/json" | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
abci "github.com/tendermint/tendermint/abci/types" | ||
"github.com/tendermint/tendermint/libs/log" | ||
dbm "github.com/tendermint/tm-db" | ||
) | ||
|
||
func TestSimAppExportAndBlockedAddrs(t *testing.T) { | ||
encCfg := MakeTestEncodingConfig() | ||
db := dbm.NewMemDB() | ||
app := NewFarmingApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{}) | ||
|
||
genesisState := NewDefaultGenesisState(encCfg.Marshaler) | ||
stateBytes, err := json.MarshalIndent(genesisState, "", " ") | ||
require.NoError(t, err) | ||
|
||
// Initialize the chain | ||
app.InitChain( | ||
abci.RequestInitChain{ | ||
Validators: []abci.ValidatorUpdate{}, | ||
AppStateBytes: stateBytes, | ||
}, | ||
) | ||
app.Commit() | ||
|
||
res, err := app.ExportAppStateAndValidators(false, []string{}) | ||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error") | ||
_, err = res.AppState.MarshalJSON() | ||
require.NoError(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters