Skip to content

Commit

Permalink
🐛 Fix writers prop access
Browse files Browse the repository at this point in the history
  • Loading branch information
andremacedopv committed Jan 12, 2023
1 parent e3f23a3 commit a281c6a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions transactions/createAssetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ var CreateAssetType = Transaction{

props := make([]assets.AssetProp, len(assetType["props"].([]interface{})))
for i, prop := range assetType["props"].([]interface{}) {
propMap := prop.(map[string]interface{})

writersArray := propMap["writers"].([]interface{})
writers := make([]string, len(writersArray))
for j, writer := range writersArray {
writers[j] = writer.(string)
}

props[i] = assets.AssetProp{
Tag: prop.(map[string]interface{})["tag"].(string),
Label: prop.(map[string]interface{})["label"].(string),
Required: prop.(map[string]interface{})["required"].(bool),
DataType: prop.(map[string]interface{})["dataType"].(string),
IsKey: prop.(map[string]interface{})["isKey"].(bool),
Writers: prop.(map[string]interface{})["writers"].([]string),
Tag: propMap["tag"].(string),
Label: propMap["label"].(string),
Required: propMap["required"].(bool),
DataType: propMap["dataType"].(string),
IsKey: propMap["isKey"].(bool),
Writers: writers,
}
}

Expand Down

0 comments on commit a281c6a

Please sign in to comment.