OSDN Git Service

revert
authorHAOYUatHZ <haoyu@protonmail.com>
Wed, 22 May 2019 02:08:38 +0000 (10:08 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Wed, 22 May 2019 02:08:38 +0000 (10:08 +0800)
asset/asset.go
asset/builder.go

index a20a545..12ae60b 100644 (file)
@@ -33,7 +33,7 @@ var (
 func initNativeAsset() {
        alias := consensus.BTMAlias
 
-       definitionBytes, _ := SerializeAssetDef(consensus.BTMDefinitionMap)
+       definitionBytes, _ := serializeAssetDef(consensus.BTMDefinitionMap)
        DefaultNativeAsset = &Asset{
                AssetID:           *consensus.BTMAssetID,
                Alias:             &alias,
@@ -275,12 +275,12 @@ func (reg *Registry) ListAssets(id string) ([]*Asset, error) {
        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)
        }
index 10a04a3..7de19cb 100644 (file)
@@ -66,7 +66,7 @@ func (a *crossInAction) Build(ctx context.Context, builder *txbuilder.TemplateBu
 
        // 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
        }
@@ -76,7 +76,7 @@ func (a *crossInAction) Build(ctx context.Context, builder *txbuilder.TemplateBu
        }
        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
                }