Skip to content

Commit

Permalink
fix code snippet paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoenburg committed Oct 24, 2019
1 parent a02cbb9 commit 73e999a
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 139 deletions.
15 changes: 9 additions & 6 deletions hellochain/tutorial/00-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ In this tutorial we will create an app with the following file structure.
│   ├── cli
│   │ ├── query.go
│   │ └── tx.go
├── types
├── msgs.go
└── types.go
├── handler.go
├── keeper.go
├── internal
├── types
| ├── msgs.go
| └── types.go
├─ keeper
└── querier.go
├── keeper.go
├── alias.go
├── module.go
── querier.go
── handler.go

```

Expand Down
2 changes: 1 addition & 1 deletion hellochain/tutorial/05-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ define this struct and other necessary components in a types file.

Save this to `x/greeter/types/types.go`

<<< @/x/greeter/types/types.go
<<< @/hellochain/x/greeter/types/types.go
2 changes: 1 addition & 1 deletion hellochain/tutorial/06-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Let's make use of `starter.BlankModule` to skip much of the boilerplate here.
Then we will come back and implement the methods for our module that we need.
Save the following in `x/greeter/module.go`

<<< @/x/greeter/module.go
<<< @/hellochain/x/greeter/module.go
2 changes: 1 addition & 1 deletion hellochain/tutorial/07-msgs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ well as the body of the "greeting".

Save the following in `x/greeter/types/msgs.go`

<<< @/x/greeter/types/msgs.go
<<< @/hellochain/x/greeter/types/msgs.go
2 changes: 1 addition & 1 deletion hellochain/tutorial/08-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ terms this would be the 'controller'.

Add this to `x/greeter/handler.go`

<<< @/x/greeter/handler.go
<<< @/hellochain/x/greeter/handler.go
4 changes: 2 additions & 2 deletions hellochain/tutorial/09-keeper.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ sophisticated applications, modules may have access to each other's Keepers for
cross-module interactions but in this simple case our Keeper will manage the
state of Greetings on its own.

Add this to `x/greeter/keeper.go`
Add this to `x/greeter/internal/keeper/keeper.go`

<<< @/x/greeter/keeper.go
<<< @/hellochain/x/greeter/internal/keeper/keeper.go
4 changes: 2 additions & 2 deletions hellochain/tutorial/10-querier.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ queries that clients can send via websocket/rpc to which our application will
respond. We will keep it simple with a single query for all "greetings" that
takes an optional "from" parameter.

Save this in `x/greeter/querier.go`
Save this in `x/greeter/internal/keeperquerier.go`

<<< @/x/greeter/querier.go
<<< @/hellochain/x/greeter/internal/keeper/querier.go
2 changes: 1 addition & 1 deletion hellochain/tutorial/11-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ order: 11

Lets create `x/greeter/alias.go` to expose the necessary types and vars from our greeter module.

<<< @/x/greeter/alias.go
<<< @/hellochain/x/greeter/alias.go
6 changes: 3 additions & 3 deletions hellochain/tutorial/12-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sending a greeting to an account address.

Add this to `x/greeter/client/cli/tx.go`

<<< @/x/greeter/client/cli/tx.go
<<< @/hellochain/x/greeter/client/cli/tx.go

## QueryCmd

Expand All @@ -28,7 +28,7 @@ querying our blockchain for all greetings from a given address.

And add this to `x/greeter/client/query.go`

<<< @/x/greeter/client/cli/query.go
<<< @/hellochain/x/greeter/client/cli/query.go

Ok great now its time to build our CLI tool

Expand All @@ -40,4 +40,4 @@ we've implemented.
Update `/x/greeter/module.go` to reflect the following (updated lines
highlighted).

<<< @/x/greeter/module.go{12,45,50,50,66}
<<< @/hellochain/x/greeter/module.go{12,45,50,50,66}
2 changes: 1 addition & 1 deletion hellochain/tutorial/13-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ our `hccli` CLI tool so we can create and query greetings!

Your `cmd/hccli/main.go` should look like this (add the highlighted lines).

<<< @/cmd/hccli/main.go{8,13}
<<< @/hellochain/cmd/hccli/main.go{8,13}

We call `starter.BuildModuleBasics()` to add `greeter`. `starter.GetTxCmd` and
`starter.GetQueryCmd` collect the Tx and query commands for every module in the
Expand Down
2 changes: 1 addition & 1 deletion hellochain/tutorial/14-full-cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ greeter into the ModuleBasicManager.
Your `cmd/hcd/main.go` should look like this (you will need to add the two
highlighted lines).

<<< @/cmd/hcd/main.go{13,8}
<<< @/hellochain/cmd/hcd/main.go{13,8}
2 changes: 1 addition & 1 deletion hellochain/tutorial/15-full-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ and add greeter's AppModuleBasic and AppModule alongside the other modules.

Update your `app.go` to look like the following

<<< @/app.go{12,1326,27,34,37,40,45,46,50,51,54}
<<< @/hellochain/app.go{12,1326,27,34,37,40,45,46,50,51,54}
2 changes: 1 addition & 1 deletion hellochain/x/greeter/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
gtypes "github.com/cosmos/sdk-tutorials/hellochain/x/greeter/types"
gtypes "github.com/cosmos/sdk-tutorials/hellochain/x/greeter/internal/types"
)

// GetTxCmd returns the parent transaction command for the greeting module
Expand Down
3 changes: 1 addition & 2 deletions hellochain/x/greeter/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/sdk-tutorials/hellochain/starter"
gtypes "github.com/cosmos/sdk-tutorials/hellochain/x/greeter/types"

"github.com/cosmos/sdk-tutorials/hellochain/x/greeter/client/cli"
gtypes "github.com/cosmos/sdk-tutorials/hellochain/x/greeter/internal/types"
)

// AppModuleBasic is the minimal struct for a module
Expand Down
52 changes: 0 additions & 52 deletions hellochain/x/greeter/types/msgs.go

This file was deleted.

63 changes: 0 additions & 63 deletions hellochain/x/greeter/types/types.go

This file was deleted.

0 comments on commit 73e999a

Please sign in to comment.