OSDN Git Service

Merge branch 'mov_crossin_tx' of https://github.com/Bytom/vapor into mov_crossin_tx
[bytom/vapor.git] / common / crossin_asset.go
1 package common
2
3 import (
4         "encoding/json"
5 )
6
7 func IsCrossChainAssetOfNoBytom(rawDefinitionByte []byte) bool {
8         var defMap map[string]interface{}
9         json.Unmarshal(rawDefinitionByte, &defMap)
10
11         description, ok := defMap["description"].(map[string]interface{})
12         if !ok {
13                 return false
14         }
15
16         issueAssetAction, ok := description["issue_asset_action"].(string)
17         if !ok {
18                 return false
19         }
20
21         if issueAssetAction != "cross_chain" {
22                 return false
23         }
24         return true
25 }