OSDN Git Service

modify import path (#1805)
[bytom/bytom.git] / asset / image.go
index 6c0aca9..3b7627d 100644 (file)
@@ -5,7 +5,7 @@ import (
 
        log "github.com/sirupsen/logrus"
 
-       "github.com/bytom/common"
+       "github.com/bytom/bytom/common"
 )
 
 // Image is the struct for hold export asset data
@@ -41,7 +41,7 @@ func (reg *Registry) Restore(image *Image) error {
                        log.WithFields(log.Fields{"alias": asset.Alias, "id": asset.AssetID}).Warning("skip restore asset due to already existed")
                        continue
                }
-               if existed := reg.db.Get(AliasKey(*asset.Alias)); existed != nil {
+               if existed := reg.db.Get(aliasKey(*asset.Alias)); existed != nil {
                        return ErrDuplicateAlias
                }
 
@@ -53,7 +53,7 @@ func (reg *Registry) Restore(image *Image) error {
                if asset.Signer.KeyIndex > maxAssetIndex {
                        maxAssetIndex = asset.Signer.KeyIndex
                }
-               storeBatch.Set(AliasKey(*asset.Alias), asset.AssetID.Bytes())
+               storeBatch.Set(aliasKey(*asset.Alias), []byte(asset.AssetID.String()))
                storeBatch.Set(Key(&asset.AssetID), rawAsset)
        }