From c529eccc6e4a4693e68861a1661eae560fbd23e7 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 21 Mar 2018 02:27:50 +0100 Subject: [PATCH] parser -> decoder --- x/auth/commands/account.go | 10 +++++----- x/auth/rest/query.go | 10 +++++----- x/ibc/commands/relay.go | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/x/auth/commands/account.go b/x/auth/commands/account.go index 382e4f6fb3..c8a68a178c 100644 --- a/x/auth/commands/account.go +++ b/x/auth/commands/account.go @@ -32,11 +32,11 @@ func GetAccountDecoder(cdc *wire.Codec) sdk.AccountDecoder { // GetAccountCmd returns a query account that will display the // state of the account at a given address -func GetAccountCmd(storeName string, cdc *wire.Codec, parser sdk.AccountDecoder) *cobra.Command { +func GetAccountCmd(storeName string, cdc *wire.Codec, decoder sdk.AccountDecoder) *cobra.Command { cmdr := commander{ storeName, cdc, - parser, + decoder, } return &cobra.Command{ Use: "account
", @@ -48,7 +48,7 @@ func GetAccountCmd(storeName string, cdc *wire.Codec, parser sdk.AccountDecoder) type commander struct { storeName string cdc *wire.Codec - parser sdk.AccountDecoder + decoder sdk.AccountDecoder } func (c commander) getAccountCmd(cmd *cobra.Command, args []string) error { @@ -66,8 +66,8 @@ func (c commander) getAccountCmd(cmd *cobra.Command, args []string) error { res, err := builder.Query(key, c.storeName) - // parse out the value - account, err := c.parser(res) + // decode the value + account, err := c.decoder(res) if err != nil { return err } diff --git a/x/auth/rest/query.go b/x/auth/rest/query.go index 75220ed59c..1ef9abe449 100644 --- a/x/auth/rest/query.go +++ b/x/auth/rest/query.go @@ -16,11 +16,11 @@ import ( type commander struct { storeName string cdc *wire.Codec - parser sdk.AccountDecoder + decoder sdk.AccountDecoder } -func QueryAccountRequestHandler(storeName string, cdc *wire.Codec, parser sdk.AccountDecoder) func(http.ResponseWriter, *http.Request) { - c := commander{storeName, cdc, parser} +func QueryAccountRequestHandler(storeName string, cdc *wire.Codec, decoder sdk.AccountDecoder) func(http.ResponseWriter, *http.Request) { + c := commander{storeName, cdc, decoder} return func(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) addr := vars["address"] @@ -46,8 +46,8 @@ func QueryAccountRequestHandler(storeName string, cdc *wire.Codec, parser sdk.Ac return } - // parse out the value - account, err := c.parser(res) + // decode the value + account, err := c.decoder(res) if err != nil { w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(fmt.Sprintf("Could't parse query result. Result: %s. Error: %s", res, err.Error()))) diff --git a/x/ibc/commands/relay.go b/x/ibc/commands/relay.go index 8af5b83ab3..091b0e9206 100644 --- a/x/ibc/commands/relay.go +++ b/x/ibc/commands/relay.go @@ -27,7 +27,7 @@ const ( type relayCommander struct { cdc *wire.Codec address sdk.Address - parser sdk.AccountDecoder + decoder sdk.AccountDecoder mainStore string ibcStore string } @@ -35,7 +35,7 @@ type relayCommander struct { func IBCRelayCmd(cdc *wire.Codec) *cobra.Command { cmdr := relayCommander{ cdc: cdc, - parser: authcmd.GetAccountDecoder(cdc), + decoder: authcmd.GetAccountDecoder(cdc), ibcStore: "ibc", mainStore: "main", } @@ -162,7 +162,7 @@ func (c relayCommander) getSequence(node string) int64 { if err != nil { panic(err) } - account, err := c.parser(res) + account, err := c.decoder(res) if err != nil { panic(err) }