Skip to content

Commit

Permalink
Merge pull request cosmos#6085: Move codec/std to std
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc authored Apr 27, 2020
1 parent 9b51908 commit cc90f2e
Show file tree
Hide file tree
Showing 39 changed files with 236 additions and 237 deletions.
2 changes: 1 addition & 1 deletion client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
)
Expand Down
10 changes: 0 additions & 10 deletions codec/std/doc.go

This file was deleted.

5 changes: 2 additions & 3 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
codecstd "github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -141,8 +140,8 @@ func NewSimApp(
) *SimApp {

// TODO: Remove cdc in favor of appCodec once all modules are migrated.
cdc := codecstd.MakeCodec(ModuleBasics)
appCodec := codecstd.NewAppCodec(cdc)
cdc := std.MakeCodec(ModuleBasics)
appCodec := std.NewAppCodec(cdc)

bApp := baseapp.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
Expand Down
7 changes: 4 additions & 3 deletions simapp/cmd/simcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"os"
"path"

"github.com/cosmos/cosmos-sdk/std"

"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/tendermint/go-amino"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/lcd"
"github.com/cosmos/cosmos-sdk/client/rpc"
codecstd "github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
Expand All @@ -25,8 +26,8 @@ import (
)

var (
cdc = codecstd.MakeCodec(simapp.ModuleBasics)
appCodec = codecstd.NewAppCodec(cdc)
cdc = std.MakeCodec(simapp.ModuleBasics)
appCodec = std.NewAppCodec(cdc)
)

func init() {
Expand Down
5 changes: 3 additions & 2 deletions simapp/cmd/simd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import (
"errors"
"fmt"

"github.com/cosmos/cosmos-sdk/std"

"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client/flags"
codecstd "github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -32,7 +33,7 @@ const (

// AddGenesisAccountCmd returns add-genesis-account cobra Command.
func AddGenesisAccountCmd(
ctx *server.Context, depCdc *amino.Codec, cdc *codecstd.Codec, defaultNodeHome, defaultClientHome string,
ctx *server.Context, depCdc *amino.Codec, cdc *std.Codec, defaultNodeHome, defaultClientHome string,
) *cobra.Command {

cmd := &cobra.Command{
Expand Down
7 changes: 4 additions & 3 deletions simapp/cmd/simd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"encoding/json"
"io"

"github.com/cosmos/cosmos-sdk/std"

"github.com/spf13/cobra"
"github.com/spf13/viper"
abci "github.com/tendermint/tendermint/abci/types"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
codecstd "github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store"
Expand All @@ -30,8 +31,8 @@ const flagInvCheckPeriod = "inv-check-period"
var invCheckPeriod uint

func main() {
cdc := codecstd.MakeCodec(simapp.ModuleBasics)
appCodec := codecstd.NewAppCodec(cdc)
cdc := std.MakeCodec(simapp.ModuleBasics)
appCodec := std.NewAppCodec(cdc)

config := sdk.GetConfig()
config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub)
Expand Down
4 changes: 2 additions & 2 deletions simapp/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package simapp
import (
"encoding/json"

codecstd "github.com/cosmos/cosmos-sdk/codec/std"
"github.com/cosmos/cosmos-sdk/std"
)

// The genesis state of the blockchain is represented here as a map of raw json
Expand All @@ -17,6 +17,6 @@ type GenesisState map[string]json.RawMessage

// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState() GenesisState {
cdc := codecstd.MakeCodec(ModuleBasics)
cdc := std.MakeCodec(ModuleBasics)
return ModuleBasics.DefaultGenesis(cdc)
}
5 changes: 3 additions & 2 deletions simapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"fmt"
"testing"

"github.com/cosmos/cosmos-sdk/std"

"github.com/stretchr/testify/require"
tmkv "github.com/tendermint/tendermint/libs/kv"

codecstd "github.com/cosmos/cosmos-sdk/codec/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
)

func TestGetSimulationLog(t *testing.T) {
cdc := codecstd.MakeCodec(ModuleBasics)
cdc := std.MakeCodec(ModuleBasics)

decoders := make(sdk.StoreDecoderRegistry)
decoders[auth.StoreKey] = func(kvAs, kvBs tmkv.Pair) string { return "10" }
Expand Down
File renamed without changes.
Loading

0 comments on commit cc90f2e

Please sign in to comment.