Skip to content

Commit

Permalink
✨ Datatype validation on dynamic asset type creation
Browse files Browse the repository at this point in the history
  • Loading branch information
andremacedopv committed Jan 12, 2023
1 parent 0c34914 commit 7947d9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transactions/createAssetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ func BuildAssetProp(propMap map[string]interface{}) (assets.AssetProp, errors.IC
return assets.AssetProp{}, errors.WrapError(err, "invalid dataType value")
}

dataTypeObj := assets.FetchDataType(dataTypeValue.(string))
if dataTypeObj == nil {
return assets.AssetProp{}, errors.NewCCError("invalid dataType value", http.StatusBadRequest)
}

assetProp := assets.AssetProp{
Tag: tagValue.(string),
Label: labelValue.(string),
Expand Down

0 comments on commit 7947d9a

Please sign in to comment.