// ContractKey account control promgram store prefix
func ContractKey(hash bc.Hash) []byte {
- // h := hash.String()
- // return append([]byte(ContractPrefix), []byte(h)...)
return append([]byte(ContractPrefix), hash.Bytes()...)
}
// StandardUTXOKey makes an account unspent outputs key to store
func StandardUTXOKey(id bc.Hash) []byte {
- // name := id.String()
- // return append(UTXOPrefix, []byte(name)...)
return append(UTXOPrefix, id.Bytes()...)
}
// ContractUTXOKey makes a smart contract unspent outputs key to store
func ContractUTXOKey(id bc.Hash) []byte {
- // name := id.String()
- // return append(SUTXOPrefix, []byte(name)...)
return append(SUTXOPrefix, id.Bytes()...)
}
// ListAccountUTXOs get all account unspent outputs
func (store *WalletStore) ListAccountUTXOs(key string) ([]*acc.UTXO, error) {
- fmt.Println("ListAccountUTXOs []byte(key):", []byte(key))
accountUtxoIter := store.walletDB.IteratorPrefix([]byte(key))
defer accountUtxoIter.Release()
// StandardUTXOKey makes an account unspent outputs key to store
func StandardUTXOKey(id bc.Hash) []byte {
- // name := id.String()
- // return append(UTXOPrefix, []byte(name)...)
return append(UTXOPrefix, id.Bytes()...)
}
// ContractUTXOKey makes a smart contract unspent outputs key to store
func ContractUTXOKey(id bc.Hash) []byte {
- // name := id.String()
- // return append(SUTXOPrefix, []byte(name)...)
return append(SUTXOPrefix, id.Bytes()...)
}