Validator doesn't validate v2 schema on v2 APIs.
This is temporal patch for testing environment.
For real one, v2/configValidateSendTransaction should be set as true.
@@ -113,8 +113,13 @@ type getTransactionResultResponse struct {
Code int `json:"code"`
}
+const (
+ configValidateSendTransaction = false
+)
+
// JSON-RPC Request Params Validator
func validateParam(s interface{}) *jsonrpc.Error {
+ if configValidateSendTransaction {
ok, err := govalidator.ValidateStruct(s)
if !ok || err != nil {
if err != nil {
@@ -122,6 +127,7 @@ func validateParam(s interface{}) *jsonrpc.Error {
}
return jsonrpc.ErrInvalidParams()
}
+ }
return nil
}
