Skip to content

Commit

Permalink
okay so.. technically this fixes test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Mar 13, 2024
1 parent 5f9f6a1 commit 067e66f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ cache
state

configs/logs.json

exclusive.lock
19 changes: 17 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import (
"encoding/json"
"fmt"
"io"
"math/rand"
"os"
"path"
"path/filepath"
"sort"
"time"

wasmd "github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
Expand Down Expand Up @@ -609,7 +612,9 @@ func NewApp(

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
// availableCapabilities := strings.Join(AllCapabilities(), ",")

const charset = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
Expand All @@ -624,7 +629,7 @@ func NewApp(
app.TransferKeeper,
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
path.Join(wasmDir, StringWithCharset(12, charset)), // for testing
wasmConfig,
append(wasmd.AllCapabilities(), "token_factory"),
govModAddress,
Expand Down Expand Up @@ -1182,3 +1187,13 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(wasmtypes.ModuleName)
return paramsKeeper
}

var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))

func StringWithCharset(length int, charset string) string {
b := make([]byte, length)
for i := range b {
b[i] = charset[seededRand.Intn(len(charset))]
}
return string(b)
}

0 comments on commit 067e66f

Please sign in to comment.