Skip to content

Validate tx/sign body and use BaseReq #3176

@fedekunze

Description

@fedekunze

Summary

POST body is not validated because it doesn't use BaseReq nor the StdTx.ValidateBasic()

Problem Definition

We are using SignBody for POST tx/sign but the StdTx is not validated at any point of the request.

// SignBody defines the properties of a sign request's body.
type SignBody struct {
Tx auth.StdTx `json:"tx"`
LocalAccountName string `json:"name"`
Password string `json:"password"`
ChainID string `json:"chain_id"`
AccountNumber uint64 `json:"account_number"`
Sequence uint64 `json:"sequence"`
AppendSig bool `json:"append_sig"`
}

Proposal

Use BaseReq with its validation function and use StdTx.Validate() to validate the transaction.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions