Skip to content

Commit

Permalink
Merge pull request #233 from cosmos/rename-cosmos-sdk
Browse files Browse the repository at this point in the history
Rename basecoin to cosmos-sdk
  • Loading branch information
ethanfrey authored Aug 21, 2017
2 parents 8a43064 + 5927524 commit d77e81a
Show file tree
Hide file tree
Showing 141 changed files with 1,017 additions and 1,017 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GOTOOLS = github.com/mitchellh/gox \
github.com/rigelrozanski/shelldown/cmd/shelldown
TUTORIALS=$(shell find docs/guide -name "*md" -type f)

LINKER_FLAGS:="-X github.com/tendermint/basecoin/client/commands.CommitHash=`git rev-parse --short HEAD`"
LINKER_FLAGS:="-X github.com/cosmos/cosmos-sdk/client/commands.CommitHash=`git rev-parse --short HEAD`"

all: get_vendor_deps install test

Expand Down
22 changes: 11 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin"
"github.com/tendermint/basecoin/errors"
"github.com/tendermint/basecoin/stack"
sm "github.com/tendermint/basecoin/state"
"github.com/tendermint/basecoin/version"
sdk "github.com/cosmos/cosmos-sdk"
"github.com/cosmos/cosmos-sdk/errors"
"github.com/cosmos/cosmos-sdk/stack"
sm "github.com/cosmos/cosmos-sdk/state"
"github.com/cosmos/cosmos-sdk/version"
)

//nolint
Expand All @@ -27,7 +27,7 @@ type Basecoin struct {
info *sm.ChainState
state *Store

handler basecoin.Handler
handler sdk.Handler

pending []*abci.Validator
height uint64
Expand All @@ -37,7 +37,7 @@ type Basecoin struct {
var _ abci.Application = &Basecoin{}

// NewBasecoin - create a new instance of the basecoin application
func NewBasecoin(handler basecoin.Handler, store *Store, logger log.Logger) *Basecoin {
func NewBasecoin(handler sdk.Handler, store *Store, logger log.Logger) *Basecoin {
return &Basecoin{
handler: handler,
info: sm.NewChainState(),
Expand Down Expand Up @@ -96,7 +96,7 @@ func (app *Basecoin) SetOption(key string, value string) string {

// DeliverTx - ABCI
func (app *Basecoin) DeliverTx(txBytes []byte) abci.Result {
tx, err := basecoin.LoadTx(txBytes)
tx, err := sdk.LoadTx(txBytes)
if err != nil {
return errors.Result(err)
}
Expand All @@ -112,12 +112,12 @@ func (app *Basecoin) DeliverTx(txBytes []byte) abci.Result {
return errors.Result(err)
}
app.addValChange(res.Diff)
return basecoin.ToABCI(res)
return sdk.ToABCI(res)
}

// CheckTx - ABCI
func (app *Basecoin) CheckTx(txBytes []byte) abci.Result {
tx, err := basecoin.LoadTx(txBytes)
tx, err := sdk.LoadTx(txBytes)
if err != nil {
return errors.Result(err)
}
Expand All @@ -132,7 +132,7 @@ func (app *Basecoin) CheckTx(txBytes []byte) abci.Result {
if err != nil {
return errors.Result(err)
}
return basecoin.ToABCI(res)
return sdk.ToABCI(res)
}

// Query - ABCI
Expand Down
38 changes: 19 additions & 19 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import (
"github.com/stretchr/testify/require"

abci "github.com/tendermint/abci/types"
"github.com/tendermint/basecoin"
"github.com/tendermint/basecoin/modules/auth"
"github.com/tendermint/basecoin/modules/base"
"github.com/tendermint/basecoin/modules/coin"
"github.com/tendermint/basecoin/modules/fee"
"github.com/tendermint/basecoin/modules/ibc"
"github.com/tendermint/basecoin/modules/nonce"
"github.com/tendermint/basecoin/modules/roles"
"github.com/tendermint/basecoin/stack"
"github.com/tendermint/basecoin/state"
sdk "github.com/cosmos/cosmos-sdk"
"github.com/cosmos/cosmos-sdk/modules/auth"
"github.com/cosmos/cosmos-sdk/modules/base"
"github.com/cosmos/cosmos-sdk/modules/coin"
"github.com/cosmos/cosmos-sdk/modules/fee"
"github.com/cosmos/cosmos-sdk/modules/ibc"
"github.com/cosmos/cosmos-sdk/modules/nonce"
"github.com/cosmos/cosmos-sdk/modules/roles"
"github.com/cosmos/cosmos-sdk/stack"
"github.com/cosmos/cosmos-sdk/state"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/tmlibs/log"
)

// DefaultHandler for the tests (coin, roles, ibc)
func DefaultHandler(feeDenom string) basecoin.Handler {
func DefaultHandler(feeDenom string) sdk.Handler {
// use the default stack
r := roles.NewHandler()
i := ibc.NewHandler()
Expand Down Expand Up @@ -70,30 +70,30 @@ func newAppTest(t *testing.T) *appTest {
}

// baseTx is the
func (at *appTest) baseTx(coins coin.Coins) basecoin.Tx {
func (at *appTest) baseTx(coins coin.Coins) sdk.Tx {
in := []coin.TxInput{{Address: at.acctIn.Actor(), Coins: coins}}
out := []coin.TxOutput{{Address: at.acctOut.Actor(), Coins: coins}}
tx := coin.NewSendTx(in, out)
return tx
}

func (at *appTest) signTx(tx basecoin.Tx) basecoin.Tx {
func (at *appTest) signTx(tx sdk.Tx) sdk.Tx {
stx := auth.NewMulti(tx)
auth.Sign(stx, at.acctIn.Key)
return stx.Wrap()
}

func (at *appTest) getTx(coins coin.Coins, sequence uint32) basecoin.Tx {
func (at *appTest) getTx(coins coin.Coins, sequence uint32) sdk.Tx {
tx := at.baseTx(coins)
tx = nonce.NewTx(sequence, []basecoin.Actor{at.acctIn.Actor()}, tx)
tx = nonce.NewTx(sequence, []sdk.Actor{at.acctIn.Actor()}, tx)
tx = base.NewChainTx(at.chainID, 0, tx)
return at.signTx(tx)
}

func (at *appTest) feeTx(coins coin.Coins, toll coin.Coin, sequence uint32) basecoin.Tx {
func (at *appTest) feeTx(coins coin.Coins, toll coin.Coin, sequence uint32) sdk.Tx {
tx := at.baseTx(coins)
tx = fee.NewFee(tx, toll, at.acctIn.Actor())
tx = nonce.NewTx(sequence, []basecoin.Actor{at.acctIn.Actor()}, tx)
tx = nonce.NewTx(sequence, []sdk.Actor{at.acctIn.Actor()}, tx)
tx = base.NewChainTx(at.chainID, 0, tx)
return at.signTx(tx)
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func (at *appTest) reset() {
require.True(at.t, resabci.IsOK(), resabci)
}

func getBalance(key basecoin.Actor, store state.SimpleDB) (coin.Coins, error) {
func getBalance(key sdk.Actor, store state.SimpleDB) (coin.Coins, error) {
cspace := stack.PrefixedStore(coin.NameCoin, store)
acct, err := coin.GetAccount(cspace, key)
return acct.Coins, err
Expand All @@ -143,7 +143,7 @@ func getAddr(addr []byte, state state.SimpleDB) (coin.Coins, error) {
}

// returns the final balance and expected balance for input and output accounts
func (at *appTest) exec(t *testing.T, tx basecoin.Tx, checkTx bool) (res abci.Result, diffIn, diffOut coin.Coins) {
func (at *appTest) exec(t *testing.T, tx sdk.Tx, checkTx bool) (res abci.Result, diffIn, diffOut coin.Coins) {
require := require.New(t)

initBalIn, err := getBalance(at.acctIn.Actor(), at.app.GetState())
Expand Down
2 changes: 1 addition & 1 deletion app/app_val_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/abci/types"
"github.com/tendermint/basecoin/modules/base"
"github.com/cosmos/cosmos-sdk/modules/base"
wire "github.com/tendermint/go-wire"
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"
Expand Down
2 changes: 1 addition & 1 deletion app/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin/modules/coin"
"github.com/cosmos/cosmos-sdk/modules/coin"
)

const genesisFilepath = "./testdata/genesis.json"
Expand Down
2 changes: 1 addition & 1 deletion app/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin/state"
"github.com/cosmos/cosmos-sdk/state"
)

// Store contains the merkle tree, and all info to handle abci requests
Expand Down
24 changes: 12 additions & 12 deletions benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin"
"github.com/tendermint/basecoin/app"
"github.com/tendermint/basecoin/modules/auth"
"github.com/tendermint/basecoin/modules/base"
"github.com/tendermint/basecoin/modules/coin"
"github.com/tendermint/basecoin/modules/fee"
"github.com/tendermint/basecoin/modules/nonce"
"github.com/tendermint/basecoin/modules/roles"
"github.com/tendermint/basecoin/stack"
sdk "github.com/cosmos/cosmos-sdk"
"github.com/cosmos/cosmos-sdk/app"
"github.com/cosmos/cosmos-sdk/modules/auth"
"github.com/cosmos/cosmos-sdk/modules/base"
"github.com/cosmos/cosmos-sdk/modules/coin"
"github.com/cosmos/cosmos-sdk/modules/fee"
"github.com/cosmos/cosmos-sdk/modules/nonce"
"github.com/cosmos/cosmos-sdk/modules/roles"
"github.com/cosmos/cosmos-sdk/stack"
)

type BenchApp struct {
Expand All @@ -27,7 +27,7 @@ type BenchApp struct {
}

// DefaultHandler - placeholder to just handle sendtx
func DefaultHandler(feeDenom string) basecoin.Handler {
func DefaultHandler(feeDenom string) sdk.Handler {
// use the default stack
c := coin.NewHandler()
r := roles.NewHandler()
Expand All @@ -46,7 +46,7 @@ func DefaultHandler(feeDenom string) basecoin.Handler {
).Use(d)
}

func NewBenchApp(h basecoin.Handler, chainID string, n int,
func NewBenchApp(h sdk.Handler, chainID string, n int,
persist bool) BenchApp {

logger := log.NewNopLogger()
Expand Down Expand Up @@ -107,7 +107,7 @@ func (b BenchApp) makeTx(useFee bool) []byte {
tx = fee.NewFee(tx, toll, sender.Actor())
}
sequence := sender.NextSequence()
tx = nonce.NewTx(sequence, []basecoin.Actor{sender.Actor()}, tx)
tx = nonce.NewTx(sequence, []sdk.Actor{sender.Actor()}, tx)
tx = base.NewChainTx(b.ChainID, 0, tx)
stx := auth.NewMulti(tx)
auth.Sign(stx, sender.Key)
Expand Down
14 changes: 7 additions & 7 deletions client/commands/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

rpcclient "github.com/tendermint/tendermint/rpc/client"

"github.com/tendermint/basecoin"
"github.com/tendermint/basecoin/modules/auth"
sdk "github.com/cosmos/cosmos-sdk"
"github.com/cosmos/cosmos-sdk/modules/auth"
)

var (
Expand Down Expand Up @@ -86,9 +86,9 @@ func GetCertifier() (*certifiers.InquiringCertifier, error) {

// ParseActor parses an address of form:
// [<chain>:][<app>:]<hex address>
// into a basecoin.Actor.
// into a sdk.Actor.
// If app is not specified or "", then assume auth.NameSigs
func ParseActor(input string) (res basecoin.Actor, err error) {
func ParseActor(input string) (res sdk.Actor, err error) {
chain, app := "", auth.NameSigs
input = strings.TrimSpace(input)
spl := strings.SplitN(input, ":", 3)
Expand All @@ -108,7 +108,7 @@ func ParseActor(input string) (res basecoin.Actor, err error) {
if err != nil {
return res, errors.Errorf("Address is invalid hex: %v\n", err)
}
res = basecoin.Actor{
res = sdk.Actor{
ChainID: chain,
App: app,
Address: addr,
Expand All @@ -118,8 +118,8 @@ func ParseActor(input string) (res basecoin.Actor, err error) {

// ParseActors takes a comma-separated list of actors and parses them into
// a slice
func ParseActors(key string) (signers []basecoin.Actor, err error) {
var act basecoin.Actor
func ParseActors(key string) (signers []sdk.Actor, err error) {
var act sdk.Actor
for _, k := range strings.Split(key, ",") {
act, err = ParseActor(k)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion client/commands/proxy/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

// RootCmd represents the base command when called without any subcommands
Expand Down
2 changes: 1 addition & 1 deletion client/commands/query/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/tendermint/merkleeyes/iavl"
"github.com/tendermint/tendermint/rpc/client"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

// GetParsed does most of the work of the query commands, but is quite
Expand Down
4 changes: 2 additions & 2 deletions client/commands/query/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/basecoin/app"
"github.com/tendermint/basecoin/modules/eyes"
"github.com/cosmos/cosmos-sdk/app"
"github.com/cosmos/cosmos-sdk/modules/eyes"
)

var node *nm.Node
Expand Down
2 changes: 1 addition & 1 deletion client/commands/query/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package query

import (
"github.com/spf13/cobra"
"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

// nolint
Expand Down
2 changes: 1 addition & 1 deletion client/commands/query/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

// KeyQueryCmd - CLI command to query a state by key with proof
Expand Down
8 changes: 4 additions & 4 deletions client/commands/query/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/tendermint/basecoin"
sdk "github.com/cosmos/cosmos-sdk"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/tendermint/types"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

// TxQueryCmd - CLI command to query a transaction with proof
Expand Down Expand Up @@ -65,9 +65,9 @@ func txQueryCmd(cmd *cobra.Command, args []string) error {
return showTx(res.Height, res.Proof.Data)
}

// showTx parses anything that was previously registered as basecoin.Tx
// showTx parses anything that was previously registered as sdk.Tx
func showTx(h int, tx types.Tx) error {
var info basecoin.Tx
var info sdk.Tx
err := wire.ReadBinaryBytes(tx, &info)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion client/commands/rpc/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"

"github.com/tendermint/tendermint/rpc/client"
)
Expand Down
2 changes: 1 addition & 1 deletion client/commands/rpc/insecure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package rpc
import (
"github.com/spf13/cobra"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

var statusCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion client/commands/rpc/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
certclient "github.com/tendermint/light-client/certifiers/client"
"github.com/tendermint/tendermint/rpc/client"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion client/commands/rpc/secure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/tendermint/basecoin/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands"
)

func init() {
Expand Down
Loading

0 comments on commit d77e81a

Please sign in to comment.