package consensus
import (
+ "encoding/binary"
"strings"
"github.com/bytom/protocol/bc"
// BTMAssetID is BTM's asset id, the soul asset of Bytom
var BTMAssetID = &bc.AssetID{
- V0: uint64(18446744073709551615),
- V1: uint64(18446744073709551615),
- V2: uint64(18446744073709551615),
- V3: uint64(18446744073709551615),
+ V0: binary.BigEndian.Uint64([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}),
+ V1: binary.BigEndian.Uint64([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}),
+ V2: binary.BigEndian.Uint64([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}),
+ V3: binary.BigEndian.Uint64([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}),
}
// InitialSeed is SHA3-256 of Byte[0^32]
package bc
import (
+ "encoding/binary"
"errors"
"io"
// NewAssetID convert byte array to aseet id
func NewAssetID(b [32]byte) (a AssetID) {
- return AssetID(NewHash(b))
+ return AssetID{
+ V0: binary.BigEndian.Uint64(b[0:8]),
+ V1: binary.BigEndian.Uint64(b[8:16]),
+ V2: binary.BigEndian.Uint64(b[16:24]),
+ V3: binary.BigEndian.Uint64(b[24:32]),
+ }
}
// Byte32 return the byte array representation