Skip to content

Commit

Permalink
Fix cronos (#102)
Browse files Browse the repository at this point in the history
* fix cronos

* fix cronos
  • Loading branch information
defisaur authored Jun 29, 2023
1 parent 99ff25b commit 96c3d87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ vendor/

# Other dirs and files
bin/
coverage.txt
coverage.txt

.idea
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

7 changes: 6 additions & 1 deletion validation/info/fields_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ func ValidateAssetRequiredKeys(a AssetModel) error {
}

func ValidateAssetType(assetType string, chain coin.Coin) error {
chainFromType, err := types.GetChainFromAssetType(assetType)
chainFromTypeRaw, err := types.GetChainFromAssetType(assetType)
if err != nil {
return fmt.Errorf("failed to get chain from asset type: %w", err)
}

chainFromType := chainFromTypeRaw
if chainFromTypeRaw.ID == coin.CRONOS {
chainFromType = coin.Cryptoorg()
}

if chainFromType != chain {
return fmt.Errorf("%w: asset type field", validation.ErrInvalidField)
}
Expand Down

0 comments on commit 96c3d87

Please sign in to comment.