Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2044 from bandprotocol/tempdir
Browse files Browse the repository at this point in the history
chain: Use ioutil.TempDir for test bandd directory
  • Loading branch information
sorawit authored Jun 24, 2020
2 parents 99c1430 + 97ef296 commit f36d977
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- (bug) [\#2047](https://github.com/bandprotocol/bandchain/pull/2047) Fix request search ordering in 0.38.
- (bug) [\#2046](https://github.com/bandprotocol/bandchain/pull/2043) Use dash for bandcli report-info.
- (impv) [\#2043](https://github.com/bandprotocol/bandchain/pull/2043) Add full raw requests information in request struct.
- (chore) [\#2040](https://github.com/bandprotocol/bandchain/pull/2040) Set HomeFlag to /tmp for SimApp.
- (chore) [\#2040](https://github.com/bandprotocol/bandchain/pull/2040) + [\#2044](https://github.com/bandprotocol/bandchain/pull/2044) Set HomeFlag to /tmp for SimApp.
- (patch) [\#2037](https://github.com/bandprotocol/bandchain/pull/2037) Patch Multistore proof to new structure tree of 0.38.
- (impv) [\#1892](https://github.com/bandprotocol/bandchain/pull/1892) Rewrite execution environment for wasmer
- (patch) [\#1999](https://github.com/bandprotocol/bandchain/pull/1999) Patch to Cosmos-SDK 0.38.4
Expand Down
9 changes: 7 additions & 2 deletions chain/simapp/app.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package simapp

import (
"io/ioutil"
"math/rand"
"time"

Expand Down Expand Up @@ -101,8 +102,12 @@ func createValidatorTx(chainID string, acc Account, moniker string, selfDelegati

// NewSimApp creates instance of our app using in test.
func NewSimApp(chainID string, logger log.Logger) *bandapp.BandApp {
// Set HomeFlag to /tmp folder for simulation run.
viper.Set(cli.HomeFlag, "/tmp")
// Sets HomeFlag to a temp folder for simulation run.
dir, err := ioutil.TempDir("", "bandd")
if err != nil {
panic(err)
}
viper.Set(cli.HomeFlag, dir)
db := dbm.NewMemDB()
app := bandapp.NewBandApp(logger, db, nil, true, 0, map[int64]bool{}, "")
genesis := bandapp.NewDefaultGenesisState()
Expand Down

0 comments on commit f36d977

Please sign in to comment.