OSDN Git Service

rm key
authorChengcheng Zhang <943420582@qq.com>
Sun, 7 Jul 2019 16:07:08 +0000 (00:07 +0800)
committerChengcheng Zhang <943420582@qq.com>
Sun, 7 Jul 2019 16:07:08 +0000 (00:07 +0800)
database/account_store.go
database/wallet_store.go

index f15c072..9836055 100644 (file)
@@ -27,6 +27,29 @@ func accountIndexKey(xpubs []chainkd.XPub) []byte {
        return append(AccountIndexPrefix, hash[:]...)
 }
 
+func Bip44ContractIndexKey(accountID string, change bool) []byte {
+       key := append(ContractIndexPrefix, []byte(accountID)...)
+       if change {
+               return append(key, []byte{1}...)
+       }
+       return append(key, []byte{0}...)
+}
+
+// ContractKey account control promgram store prefix
+func ContractKey(hash bc.Hash) []byte {
+       return append(ContractPrefix, hash.Bytes()...)
+}
+
+// AccountIDKey account id store prefix
+func AccountIDKey(accountID string) []byte {
+       return append(AccountPrefix, []byte(accountID)...)
+}
+
+// StandardUTXOKey makes an account unspent outputs key to store
+func StandardUTXOKey(id bc.Hash) []byte {
+       return append(UTXOPrefix, id.Bytes()...)
+}
+
 // AccountStore satisfies AccountStore interface.
 type AccountStore struct {
        db    dbm.DB
index 0b65fac..85363b7 100644 (file)
@@ -59,29 +59,6 @@ var (
        errGetAsset          = errors.New("Failed to find asset definition")
 )
 
-func Bip44ContractIndexKey(accountID string, change bool) []byte {
-       key := append(ContractIndexPrefix, []byte(accountID)...)
-       if change {
-               return append(key, []byte{1}...)
-       }
-       return append(key, []byte{0}...)
-}
-
-// ContractKey account control promgram store prefix
-func ContractKey(hash bc.Hash) []byte {
-       return append(ContractPrefix, hash.Bytes()...)
-}
-
-// AccountIDKey account id store prefix
-func AccountIDKey(accountID string) []byte {
-       return append(AccountPrefix, []byte(accountID)...)
-}
-
-// StandardUTXOKey makes an account unspent outputs key to store
-func StandardUTXOKey(id bc.Hash) []byte {
-       return append(UTXOPrefix, id.Bytes()...)
-}
-
 // ContractUTXOKey makes a smart contract unspent outputs key to store
 func ContractUTXOKey(id bc.Hash) []byte {
        return append(SUTXOPrefix, id.Bytes()...)