-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R4R: Staking Gaia-lite (ex LCD) refactor #1880
Changes from 34 commits
2f75f66
6f87e3f
df3e021
72553a2
5f5b07d
0174084
3a26b46
efcc11b
8f5334a
f0d2eb5
bb540d4
88e1bd5
dbc284d
551cef2
deedd2c
a013f84
35c4ff7
21a05d1
ee87537
c3b29fa
e867c8c
e57980e
d7297b5
00baf3f
71bc4d1
0f4040c
20c490f
d6dc156
e2cab9f
84b3de7
eb611e1
14ec625
a7884db
120be9c
e2064a4
7722435
9ee3d47
c683089
43f3ca8
f53130f
724aae6
8fe38e3
e0a8f04
71cc9ce
a0e35c9
33f763f
8abcdaa
7030081
a8261a3
9ea4d6d
94c7507
ab25efe
ccb3fcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ import ( | |
"github.com/cosmos/cosmos-sdk/client/context" | ||
) | ||
|
||
// Tx Broadcast Body | ||
// BroadcastTxBody Tx Broadcast Body | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert addition |
||
type BroadcastTxBody struct { | ||
TxBytes string `json:"tx"` | ||
} | ||
|
||
// BroadcastTx REST Handler | ||
// BroadcastTxRequestHandlerFn BroadcastTx REST Handler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert addition |
||
func BroadcastTxRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc { | ||
return func(w http.ResponseWriter, r *http.Request) { | ||
var m BroadcastTxBody | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ const ( | |
flagAny = "any" | ||
) | ||
|
||
// default client command to search through tagged transactions | ||
// SearchTxCmd Default client command to search through tagged transactions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this change |
||
func SearchTxCmd(cdc *wire.Codec) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "txs", | ||
|
@@ -53,7 +53,7 @@ func SearchTxCmd(cdc *wire.Codec) *cobra.Command { | |
return cmd | ||
} | ||
|
||
func searchTxs(ctx context.CoreContext, cdc *wire.Codec, tags []string) ([]txInfo, error) { | ||
func searchTxs(ctx context.CoreContext, cdc *wire.Codec, tags []string) ([]Info, error) { | ||
if len(tags) == 0 { | ||
return nil, errors.New("must declare at least one tag to search") | ||
} | ||
|
@@ -74,17 +74,18 @@ func searchTxs(ctx context.CoreContext, cdc *wire.Codec, tags []string) ([]txInf | |
return nil, err | ||
} | ||
|
||
info, err := formatTxResults(cdc, res.Txs) | ||
info, err := FormatTxResults(cdc, res.Txs) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return info, nil | ||
} | ||
|
||
func formatTxResults(cdc *wire.Codec, res []*ctypes.ResultTx) ([]txInfo, error) { | ||
// FormatTxResults Parse the indexed txs into an array of Info | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
func FormatTxResults(cdc *wire.Codec, res []*ctypes.ResultTx) ([]Info, error) { | ||
var err error | ||
out := make([]txInfo, len(res)) | ||
out := make([]Info, len(res)) | ||
for i := range res { | ||
out[i], err = formatTxResult(cdc, res[i]) | ||
if err != nil { | ||
|
@@ -97,7 +98,7 @@ func formatTxResults(cdc *wire.Codec, res []*ctypes.ResultTx) ([]txInfo, error) | |
///////////////////////////////////////// | ||
// REST | ||
|
||
// Search Tx REST Handler | ||
// SearchTxRequestHandlerFn Search Tx REST Handler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert addition |
||
func SearchTxRequestHandlerFn(ctx context.CoreContext, cdc *wire.Codec) http.HandlerFunc { | ||
return func(w http.ResponseWriter, r *http.Request) { | ||
tag := r.FormValue("tag") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ import ( | |
keys "github.com/cosmos/cosmos-sdk/crypto/keys" | ||
) | ||
|
||
// REST request body | ||
// SignTxBody REST request body for signed txs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
// TODO does this need to be exposed? | ||
type SignTxBody struct { | ||
Name string `json:"name"` | ||
Password string `json:"password"` | ||
TxBytes string `json:"tx"` | ||
} | ||
|
||
// sign transaction REST Handler | ||
// SignTxRequstHandler Sign transaction REST Handler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
func SignTxRequstHandler(w http.ResponseWriter, r *http.Request) { | ||
var kb keys.Keybase | ||
var m SignTxBody | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++