Skip to content

Commit

Permalink
Update to use viper from server context (#184)
Browse files Browse the repository at this point in the history
* Update to use viper from server context

* go mod changes

Co-authored-by: Amaury <[email protected]>
  • Loading branch information
atheeshp and amaury1093 authored Nov 26, 2020
1 parent f6d9386 commit a207df5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/wasm_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package app

import (
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/spf13/viper"
"github.com/cosmos/cosmos-sdk/server"
)

// WasmWrapper allows us to use namespacing in the config file
Expand All @@ -13,7 +13,8 @@ type WasmWrapper struct {

func getWasmConfig() wasm.Config {
wasmWrap := WasmWrapper{Wasm: wasm.DefaultWasmConfig()}
err := viper.Unmarshal(&wasmWrap)
ctx := server.NewDefaultContext()
err := ctx.Viper.Unmarshal(&wasmWrap)
if err != nil {
panic("error while reading wasm config: " + err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v1.1.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
github.com/tendermint/tendermint v0.34.0-rc5
github.com/tendermint/tm-db v0.6.2
Expand Down

0 comments on commit a207df5

Please sign in to comment.