Skip to content

Commit

Permalink
fix auto merge issue make test encoding config
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Apr 12, 2024
1 parent e1c28cc commit 17de51d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"encoding/json"
"fmt"
"os"
"sort"
"testing"

Expand All @@ -23,6 +24,7 @@ import (

abci "github.com/cometbft/cometbft/abci/types"

"github.com/provenance-io/provenance/app/params"
markermodule "github.com/provenance-io/provenance/x/marker"
markertypes "github.com/provenance-io/provenance/x/marker/types"
)
Expand Down Expand Up @@ -425,3 +427,22 @@ func TestFilterBeginBlockerEvents(t *testing.T) {
})
}
}

// MakeTestEncodingConfig creates an encoding config suitable for unit tests.
func MakeTestEncodingConfig(t *testing.T) params.EncodingConfig {
tempDir, err := os.MkdirTemp("", "tempprovapp")
switch {
case t != nil:
require.NoError(t, err, "failed to create temp dir %q", tempDir)
case err != nil:
panic(fmt.Errorf("failed to create temp dir %q: %w", tempDir, err))
}
defer os.RemoveAll(tempDir)

tempApp := New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, nil,
tempDir,
0,
simtestutil.EmptyAppOptions{},
)
return tempApp.GetEncodingConfig()
}

0 comments on commit 17de51d

Please sign in to comment.