OSDN Git Service

add block witness update function (#176)
[bytom/vapor.git] / protocol / bc / asset.go
index 553cd71..91285fa 100644 (file)
@@ -5,7 +5,6 @@ import (
        "errors"
        "io"
 
-       "github.com/vapor/crypto/sha3pool"
        "github.com/vapor/encoding/blockchain"
 )
 
@@ -43,28 +42,6 @@ func (a *AssetID) ReadFrom(r io.Reader) (int64, error) { return (*Hash)(a).ReadF
 // IsZero tells whether a Asset pointer is nil or points to an all-zero hash.
 func (a *AssetID) IsZero() bool { return (*Hash)(a).IsZero() }
 
-// ComputeAssetID calculate the asset id from AssetDefinition
-func (ad *AssetDefinition) ComputeAssetID() (assetID AssetID) {
-       h := sha3pool.Get256()
-       defer sha3pool.Put256(h)
-       writeForHash(h, *ad) // error is impossible
-       var b [32]byte
-       h.Read(b[:]) // error is impossible
-       return NewAssetID(b)
-}
-
-// ComputeAssetID implement the assetID calculate logic
-func ComputeAssetID(prog []byte, vmVersion uint64, data *Hash) AssetID {
-       def := &AssetDefinition{
-               IssuanceProgram: &Program{
-                       VmVersion: vmVersion,
-                       Code:      prog,
-               },
-               Data: data,
-       }
-       return def.ComputeAssetID()
-}
-
 // ReadFrom read the AssetAmount from the bytes
 func (a *AssetAmount) ReadFrom(r *blockchain.Reader) (err error) {
        var assetID AssetID