func initNativeAsset() {
alias := consensus.BTMAlias
- definitionBytes, _ := SerializeAssetDef(consensus.BTMDefinitionMap)
+ definitionBytes, _ := serializeAssetDef(consensus.BTMDefinitionMap)
DefaultNativeAsset = &Asset{
AssetID: *consensus.BTMAssetID,
Alias: &alias,
return assets, nil
}
-// SerializeAssetDef produces a canonical byte representation of an asset
+// serializeAssetDef produces a canonical byte representation of an asset
// definition. Currently, this is implemented using pretty-printed JSON.
// As is the standard for Go's map[string] serialization, object keys will
// appear in lexicographic order. Although this is mostly meant for machine
// consumption, the JSON is pretty-printed for easy reading.
-func SerializeAssetDef(def map[string]interface{}) ([]byte, error) {
+func serializeAssetDef(def map[string]interface{}) ([]byte, error) {
if def == nil {
def = make(map[string]interface{}, 0)
}
// Handle asset definition.
// Asset issuance's legality is guaranteed by the federation.
- rawDefinition, err := SerializeAssetDef(a.AssetDefinition)
+ rawDefinition, err := serializeAssetDef(a.AssetDefinition)
if err != nil {
return ErrSerializing
}
}
if preAsset, _ := a.assets.GetAsset(a.AssetId.String()); preAsset != nil {
// GetAsset() doesn't unmashall for RawDefinitionBytes
- preRawDefinition, err := SerializeAssetDef(preAsset.DefinitionMap)
+ preRawDefinition, err := serializeAssetDef(preAsset.DefinitionMap)
if err != nil {
return ErrSerializing
}